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] Initial v-model:value doesn't work with date library #10

Closed
rscbeplus opened this issue Mar 4, 2022 · 2 comments
Closed

[Bug] Initial v-model:value doesn't work with date library #10

rscbeplus opened this issue Mar 4, 2022 · 2 comments

Comments

@rscbeplus
Copy link

rscbeplus commented Mar 4, 2022

"vue-datepicker-next": "^1.0.2"
"vue": "^3.0.0",
Browser: All of them

Thank you very much for providing this calendar libary!

Steps to reproduce

  1. Visit: https://vue-vg3x9m.stackblitz.io
  2. See Start/Enddate
  3. But range is not selected in Calendar
    Bildschirmfoto 2022-03-04 um 18 49 11

Reproduction Link or Source Code
https://stackblitz.com/edit/vue-vg3x9m?file=src/App.vue

Expected behavior
A set value in the v-model:value should set the calendar range selected in the Calendar.

Actual behavior
Range is only set by manual clicking and not preset values.
I saw the events, especially the update:value, but have no clue if this will help in my case as value does not change initially.

@rscbeplus rscbeplus changed the title [Bug] Initial v-model:value doesn't work with moment.js [Bug] Initial v-model:value doesn't work with date library Mar 4, 2022
@mengxiong10
Copy link
Owner

Because dayjs() is not a Date Object , you should use toDate.

      timerange: [
        dayjs().isoWeekday(1).toDate(),
        dayjs().isoWeekday(7).toDate(),
      ],

@robinschreiner
Copy link

Thanks for taking the time!
Hadn't thought about that and feel dumb now. 🤦‍♂️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants