I have a table with two fields (both datetime type) called start and stop.
Datepicker is enabled and it shows the calendar and clock spinner with AM/PM selector (which is just fine).THE PROBLEM is that anything that is submitted with a PM time, goes into the database as AM time.For example, picking a start time of November 1, 2019 6:00 PM and end time of November 1, 2019 6:30 PM submits the data to the table as:±--------------------------±-------------------------+
| start |stop |
±--------------------------±-------------------------+
| 2019-11-01 06:00:00 | 2019-11-01 06:30:00 |
±-------------------------±--------------------------+When what I NEED is:±--------------------------±-------------------------+
| start |stop |
±--------------------------±-------------------------+
| 2019-11-01 18:00:00 | 2019-11-01 18:30:00 |
±-------------------------±--------------------------+The JSON formatting options being sent to both start and stop in the Date/Time picker extension options are:{“ignoreReadonly”:true,“useCurrent”:true,“format”:“yyyy-mm-dd hh:ii”, “stepping” : 15}This steps the time options by 15 minute intervals exactly the way I want, but isn’t numbering hours in PM format. I swear, I’ve tried every option of h, H hh, HH, mm, MM, i, ii and with ‘A’ and ‘P’ flags but the results are the same.Does anybody have experience with how to correct this?The fields are set to Date/Time in the DIV Tag Atributes and I’m not using any validation.Thanks in advance for any suggestions.
{“ignoreReadonly”:true,“useCurrent”:true,“format”:“YYYY-MM-DD HH:mm:ss”, “stepping” : 15}Please maintain the case of date format string. See if this works for you.
Thanks for replies guys, but I’ve tried that. Still lands in DB with AM times despite selecting PM on the Date/Time picker.Everything still submitting as AM time hours:mysql> SELECT start, stop FROM ticketnote WHERE ticket_number = ‘TKT-00000158’;
±--------------------±--------------------+
| start | stop |
±--------------------±--------------------+
| 2019-11-06 08:00:00 | 2019-11-06 08:30:00 |
| 2019-11-06 08:30:00 | 2019-11-06 11:00:00 |
| 2019-11-07 05:30:00 | 2019-11-07 06:00:00 |
| 2019-11-07 08:00:00 | 2019-11-07 08:30:00 |
| 2019-11-07 10:00:00 | 2019-11-07 10:15:00 |
±--------------------±--------------------+
5 rows in set (0.00 sec)
You better use HH instead of hh. If you must use AM/PM, you may try to use date format “DateTime” in View Tag panel (see the topic Field Setup in help file), not, for example, “YmdHis”.
Hi,
start and stop field view tags are set to DateTime (as mentioned earlier) and I am NOT validating in the edit tag either. I just want a CLEAN submission from the date/time picker.I’ll try the HH in the json option and see how that looks and report back; thanks @arbei.
HH yields same results.Tickets will constantly be serviced across AM->PM hours and vice versa and these calcs are all off when that happens.I’ll try using formal support.