Support passing in a date string
See original GitHub issueCorrect me if I am wrong, but it seems like right now it is not possible to pass something like "2016-12-27T16:16:22.585Z"
to set the initial value, but passing a Date
object works, so if I do Date("2016-12-27T16:16:22.585Z")
and then pass that in, it works.
Do you think flatpickr could have an if
to check if the passed value is a string, and convert it to a Date object behind the scenes?
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Passing DateTime strings from different cultures to a service
The Desktop Application starts the service and passes an argument which is a DateTime converted to a String.
Read more >Date() constructor - JavaScript - MDN Web Docs - Mozilla
The Date() constructor can create a Date instance or return a string representing the current time.
Read more >Convert strings to DateTime - Microsoft Learn
Learn techniques to parse strings that represent dates and times to create a DateTime from the date and time string.
Read more >Passing date and get in different format - Help - UiPath Forum
I need to pass the date in “01/17/2019” and need to get back with the ... this string to a dateTime variable and...
Read more >Demystifying DateTime Manipulation in JavaScript - Toptal
In JavaScript, a time stamp is the number of milliseconds that have passed since January 1, 1970. If you don't intend to support...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I just think it would be much easier to follow the code if it were a class with methods, but it’s really no benefit, just syntactic sugar.
I think tests first would be a good idea, then we can revisit possible refactors after we have tests to make sure nothing breaks 😄 .
Let me know where I can help out!
Ah nice, thanks! Would you be interested in some help converting this into an ES2015 class? I’d be glad to help out with that effort, and I think we should write some tests as well.