1

I am using the XDSoft Datetimepicker. I can choose a datetime, but when I click out of the input field, the hour of the time decrements by one hour. Here is an example:

This is when I pick a datetime (successfully): step 1

And this is what is looks like immediately after choosing a datetime: step 2

Finally, this is what it looks like when the input loses focus, i.e. when I click outside of the input: step 3

Here is the javascript code that I use to set up the datetimepicker:

$("input[name='my_datetimepicker_input']").datetimepicker({

    format: 'Y/m/d h:i A',
    formatTime: 'g:i A',

    minDate: '-1970/01/01',
    step: 15,

    maxTime: '22:00',
});

The problem doesn't seem to happen when I switch the format from 24 time to 12 hour (AM/PM) time.

Any ideas what could be causing this and how to fix this?

qbush
  • 712
  • 2
  • 9
  • 28
  • same problem, did you find any solution? – Sunil Kumar Nov 08 '22 at 10:16
  • Attaching screenshot of the culprit event, but don't know how to fix it yet. https://postimg.cc/XZ2HDg5r – Sunil Kumar Nov 08 '22 at 10:22
  • Does this answer your question? [jQuery DateTimePicker is subtracting one hour on input blur](https://stackoverflow.com/questions/47963072/jquery-datetimepicker-is-subtracting-one-hour-on-input-blur) – Sunil Kumar Nov 08 '22 at 10:39

0 Answers0