AM/PM bug in new Service Date and Time widget

ForumAM/PM bug in new Service Date and Time widget
JimGasperini asked 1 week ago

I discovered an odd minor bug when fixing past services to conform to the new way of entering date and time.
When I entered the time for a 10pm Christmas eve service, the new Service Date and Time widget “corrected” it to 10am. I tried several times, and it refused to accept a pm entry.
As a result, in the sequence of services on our Past Services page
the 11 am service displays as more recent than the services 5 pm and 10 pm.

dgranja replied 1 week ago

Good catch. This appears to be an error in the plugin’s jquery.datetimepicker.full.min.js. I discovered 2 workarounds until it is fixed:
1.) Enter the time in 24 hour format. So, type in 23:00pm for 11:00pm. This is easy and the preferred workaround.
2.) Or you can do this: In the file, /public_html/wp-content/plugins/uua-services/inc/metaboxes.php, look for the lines that say something like:
format:\’d-M-Y g:ia\’,
It will look something like that. I modified mine to be M-d-Y h:ia and 10:00 because I prefer that format and 10:00am is our regular service time. Anyway, do your due dilligence of getting a backup and copying the metaboxes.php file so that you have something to revert to, and then change the g:ia to H:ia, save, and that seems to make it work, but displays in 24 hour format. The actual published display format is different than this (and is set further down in the metaboxes.php file), so there is no worry that this shows in 24 hour format when editing the service entry. This is not the preferred workaround, though, because your changes will be overwritten when the plugin is updated.

dgranja replied 1 week ago

Yaah….Don’t use option number 2 above – it may screw things up. Just enter in the hour in 24 hour format. Even if you type in 23:00am (incorrectly setting it as am), it will adjust it to 11:00pm when you tab off it.

JimGasperini replied 1 week ago

On a practical level, this is a very minor issue. Our church only schedules pm services on Christmas eve. It can wait.