Open ghost opened 3 years ago
Hi @superdeeid,
You can set the date using the setState
method:
dp.setState({
selectedDate: new Date('10/23/2020')
});
As far as the hilightedDate
goes, there is already an open issue (#86) which looks like was never addressed. However, if you want to highlight a specific date every time the date picker is displayed when input has no value, one workaround would be to use the parse
function to assign the date you want:
var dp = TinyDatePicker(document.querySelector('input'), {
parse(str) {
var date = new Date(str);
return isNaN(date) ? new Date('10/26/2017') : date;
}
});
Hi everyone,
Tried with no luck to set a date in the plugin. Tried only with 'selectedDate' or 'hilightedDate' too. Also tested to set the dates in this format (YYYY-MM-DD), no luck either. Is somebody have the solution or it's a bug? It'a always set to now().
IE: min/max working like a charm at least...
Regards,