-
-
Notifications
You must be signed in to change notification settings - Fork 332
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
wired-calendar selected day can't be update programatically...? #137
Comments
To elaborate a bit further, here is the spec regarding the format that this calendar can understand: IMO, the easiest way to set a day with this calendar is to use the string format YYYY-MM-DD For example, if I create a date like this: const date = new Date('12 April 2020'); // Created in my local time, for me it's UTC+2
const formattedDate = date.toISOString().substr(0,10); // Formatted in UTC+0 time
console.log(`${date.getFullYear()}-${date.getMonth()+1}-${date.getDate()}`)
console.log(formattedDate); The first console.log will output FOR ME (but maybe not for another user, depending on its timezone): I think the calendar README should point to a bunch of good ressources on how to work with dates in JS and format them and all th subtilities (like months starting at 0), because it is aaaaalways a mess :P |
So the problem should be solved by changing how wired-calendar handle |
I think we could improve the readme, that's never bad 😄 new Date (new Date().toLocaleDateString())
//> output: Invalid Date {} Frist However, you can use: new Date(new Date().toDateString()) Regards, |
I'm using wired-calendar with Vue.js with as following:
Although the attribute "selected" is rendered correctly in the HTML, wired-calendar doesn't seem to highlight the selected day...?
The text was updated successfully, but these errors were encountered: