question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support passing in a date string

See original GitHub issue

Correct 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:closed
  • Created 7 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
rwwagner90commented, Apr 25, 2016

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!

1reaction
rwwagner90commented, Apr 24, 2016

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found