Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Slight confusion with the time

Is it possible to add am/pm or change to 24 hour time on the plugin? It seems logical, that the first 12:00 is 12:00am, and the second 12:00 is 12:00pm (noon).


  • Options
    businessdadbusinessdad Stealth contributor MVP

    The plugin was supposed to use 24 hour time, but I found a bug which makes it use 12 hours time without suffix, and causes confusion when the time is saved. Fortunately, fixing it is quite simple. Open file postscheduler.js and replace this:

    $.datepicker.formatTime('hh:mm', TimeObj)

    with this:

    $.datepicker.formatTime('HH:mm', TimeObj)

    The only difference is the "HH" (uppercase). The change will switch the date/time selector to proper 24 hour format.

  • Options
    GaryFunkGaryFunk Senior Application Developer ✭✭

    @businessdad I looked at your code just so I get an insight into how ity works, and I am impressed. I really need to dig more into PHP as a third language.

  • Options
    businessdadbusinessdad Stealth contributor MVP

    @GaryFunk Thanks for the feedback.

    Off Topic
    I must say that, when I started using PHP again last year, after six years of "hiatus", I got a bit confused because so many things had changed, but my experience helped. If you are used to swap languages often (tell me about it), you will pick it up in no time.

    Just beware, even an apparent minor version update of PHP (e.g. 5.3.x vs 5.3.y) can break things, as well as error level settings (E_STRICT above all) and, sometimes, environment settings. Testing and documentation are absolutely vital, but be ready for surprises.

  • Options

    @businessdad When attempting to make the change from 'hh' to 'HH', the postscheduler.js already had 'HH'. I switch it to 'hh' to see if that made a change, but it didn't do anything different?

  • Options
    businessdadbusinessdad Stealth contributor MVP
    edited January 2013

    @peripatew I'm sorry, I mixed up the lines. The correct format is HH:mm, but the line that should be changed is another (line 34, if the version is the same). You should change this:

    timeFormat: 'hh:mm'

    to this:

    timeFormat: 'HH:mm'

    Sorry for the confusion, this is one of the bugs I found and I mixed things up. :)

  • Options

    @businessdad, works great! I had to switch timeFormat to HH and make sure .datepicker.formatTime was hh.

    Thanks again.

Sign In or Register to comment.