Commit 30424284 authored by Aatish Nayak's avatar Aatish Nayak Committed by GitHub
Browse files

change how datepickers get default date (#846)

Showing with 3 additions and 3 deletions
// Initialize all Bootstrap 3 Datetime Pickers on the page
// Initialize all Flatpicker Datetime Pickers on the page
;(function() {
$(document).ready(function() {
......@@ -7,7 +7,7 @@
$(datetimeElts[i]).flatpickr({
enableTime: true,
altInput: true,
defaultDate: new Date(datetimeElts[i].getAttribute("value"))
defaultDate: new Date(moment($(datetimeElts[i]).val()))
})
}
......@@ -16,7 +16,7 @@
for (var i = 0; i < dateElts.length; i++) {
$(dateElts[i]).flatpickr({
altInput: true,
defaultDate: moment($(dateElts[i]).val()).format("MMMM D YYYY")
defaultDate: new Date(moment($(dateElts[i]).val()).format("MMMM D YYYY"))
})
}
});
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment