Correct way to set date value from JS ?
See original GitHub issueIf I need to update date value from JavaScript, what is the correct way to do this? So far I’ve tried -
$('#date').data('value', new_date);
$('#date').pickadate().pickadate('picker').render();
with no much success.
Issue Analytics
- State:
- Created 10 years ago
- Comments:10 (2 by maintainers)
Top Results From Across the Web
Set date in input type date - javascript - Stack Overflow
var today = new Date().toISOString().split ...
Read more >JavaScript Set Date Methods - W3Schools
Set Date methods let you set date values (years, months, days, hours, minutes, ... Use the correct Date method to set the year...
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. Try it.
Read more >Set the Values of Input type Date and Time using JavaScript
Use the value property on the input elements of type date , time and datetime-local to set their values, e.g. dateInput.value = '2026-06-24'...
Read more >Demystifying DateTime Manipulation in JavaScript - Toptal
If you instead want to get the current time stamp, you can create a new Date object and use the getTime() method. const...
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 Free
Top 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
@andrewmartin the easiest way to interact with it is to get the picker:
Hope that clarifies things.
For anyone who got stuck on this:
You might be too smart for your own good assuming the passed string
pickadate('picker')
was supposed to be the variable name. This example would be clearer: