flatpickr
flatpickr copied to clipboard
Time select does not work correctly in 4.6.10 with altInput
Hi, noticed that in the latest version hour, minute and second pickers don't work correctly with the following options (for example): { altFormat: "n/j/Y H:i:S" altInput: true dateFormat: "Y-m-d H:i:S" }
Instead of switching hours, minutes, seconds it switches years
Indeed.
I can confirm I'm also getting this (or something very similar, depending on altFormat
).
{
altInput: true,
altFormat: 'd/m/Y H:i',
dateFormat: 'Y-m-d H:i',
enableTime: true,
time_24hr: true,
locale: {
firstDayOfWeek: 1
}
},
Also can confirm the issue. When selecting a future date the datepicker reverts to 2/2/2022.
$(function() {
$(".datetimepicker").flatpickr({
enableTime: true,
minuteIncrement: 1,
dateFormat: "m/d/Y H:i",
altInput: true
});
});
Commenting out the althInput: true
option allows one to pick a date in the future without it reverting.
Same here, tagging a me too so i can tell people when its fixed, Hope there is a fix ASAP for this...
Hello, The problem is whenever the order of the date segments in "altFormat" is different than the one defined in "dateFormat".
`{ altInput: true, altFormat: 'Y/m/d H:i', dateFormat: 'Y-m-d H:i', enableTime: true, } // is OK
{ altInput: true, altFormat: 'd-m-Y H:i', dateFormat: 'Y-m-d H:i', enableTime: true, } // is ERROR
`
With this configuration, increasing or decreasing the hour picker increases or decreases the month.
{ altInput: true, enableTime: true, dateFormat: 'Y-m-d H:i', disableMobile: true, allowInput: true }
Agreed, this is a significant departure in previously existing functionality
This should be a critical bug imho
I ran into this as well and reverted to 4.6.9 since 4.6.10 broke major portions of my app and flooded my support inbox.
I ran into this as well and reverted to 4.6.9 since 4.6.10 broke major portions of my app and flooded my support inbox.
This is slamming us as well. I am new to NPM can you tell me how you forced it to stick with 4.6.9?
I am experiencing these same problems with my configuration:
{ altInput: true, altFormat: "M-d-Y, H:i:S", dateFormat: "U", enableTime: true, enableSeconds: true, maxDate: "today", time_24hr: true }
It seems to work if the altFormat and dateFormat are matching but I get this error if they do not match (which is what I need):
flatpickr:2 Error: Invalid date provided: Mar-02-2022, 00:00:00 at Object.parseDate (flatpickr:2:8100) at _ (flatpickr:2:10934) at HTMLDocument.X (flatpickr:2:20851)
@streamingsystems I'm not using NPM -- just directly included the following lines of code into my HTML:
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/flatpickr/dist/flatpickr.min.css">
<script src="https://cdn.jsdelivr.net/npm/[email protected]"></script>
It's the @4.6.9
on the end of the script tag URL that worked for me. It previously was <script src="https://cdn.jsdelivr.net/npm/flatpickr"></script>
which is the broken version as of the time I write this comment (version 4.6.10 isn't working for me).
For now I am just capturing the value of the field I want to be changed on output before it gets submitted and converting the string directly using Date objects. This feels pretty hacky though...
This should be the same one as #2653, and will be addressed by #2662.
Hi guys,
v4.6.11 is out with a fix. Thanks for reporting