Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Auto Form toDate is not a function when form schema has default value #780

Open
2 tasks
LeclechM opened this issue Sep 23, 2024 · 0 comments
Open
2 tasks
Labels
bug Something isn't working

Comments

@LeclechM
Copy link

Reproduction

https://stackblitz.com/edit/nuxt-vue-3-4-beta-twkyrr?file=src%2Fpages%2Fhome%2FHomePage.vue

Describe the bug

In documentation:

If you want to set default value of date, convert it to Date first using new Date(val).

An error occurs during
{{ slotProps.componentField.modelValue ? df.format(slotProps.componentField.modelValue.toDate(getLocalTimeZone())) : "Pick a date" }}

because slotProps.componentField.modelValue is of type string and not a DateValue like expected by Calendar component.

System Info

System:
    OS: Linux 6.8 Ubuntu 24.04.1 LTS 24.04.1 LTS (Noble Numbat)
    CPU: (12) x64 12th Gen Intel(R) Core(TM) i5-1235U
    Memory: 2.89 GB / 15.30 GB
    Container: Yes
    Shell: 5.9 - /usr/bin/zsh
  Binaries:
    Node: 20.17.0 - ~/.nvm/versions/node/v20.17.0/bin/node
    npm: 10.8.2 - ~/.nvm/versions/node/v20.17.0/bin/npm
    pnpm: 9.10.0 - ~/.local/share/pnpm/pnpm
    bun: 1.1.27 - ~/.bun/bin/bun
  Browsers:
    Chrome: 129.0.6668.58

Contributes

  • I am willing to submit a PR to fix this issue
  • I am willing to submit a PR with failing tests
@LeclechM LeclechM added the bug Something isn't working label Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant