https://jsfiddle.net/tj2Lo4z7/233/
I am running following:
Facing this problem when trying to populate the default dates. The code is simple.
const currentTour = {"id":1,"name":"Caribbean T20 League","active":0,"status":1,"startDate":"2018-08-08T00:00:00.000Z","endDate":"2018-09-17T23:59:59.000Z","sportId":2,"totalTeams":6,"totalMatches":34};
const fp = flatpickr(".date", {
enableTime: true,
mode: "range",
dateFormat: "Y-m-d H:i",
defaultDate: (currentTour.startDate
&& currentTour.endDate) ? [ currentTour.startDate, currentTour.endDate ]: null
});
As you can see my date in my data currentTour is different vs. what I get in input when the initialisation is completed. Its converting date to Local timeZone (IST)
I have my dates in UTC in DB and I'd also like to show dates in UCT everywhere I am using flatpickr
What I am missing here ?
One more information I tied including Moment Timezone in document and then initializing a default timezone
moment.tz.setDefault('Africa/Abidjan');
But its still not helping
The above timeZone information was extracted from https://momentjs.com/downloads/moment-timezone-with-data-2012-2022.js
I also have this issue. Flat-pickr is always choosing the local timezone. I would like to be able to set the timezone of pickr to display in the zone I choose.
Closing this as a duplicate of #930 and #975. Flatpickr is using the Date object internally and that always uses the local time of the computer.
We're thinking of a solution to this and it will probably come in the form of documentation. Timezones are hard, unfortunately
Most helpful comment
Closing this as a duplicate of #930 and #975. Flatpickr is using the Date object internally and that always uses the local time of the computer.
We're thinking of a solution to this and it will probably come in the form of documentation. Timezones are hard, unfortunately