Support » Plugin: Meta Box » time field js wont run without datetime

  • Resolved fiskhandlarn


    When I took the demo code (from demo/demo.php) and removed all fields except the time field, the jquery-ui-timepicker stopped working. It seemed that I only got it to work again if I also included a datetime field as well.

    The problem seems to be that js/time.js is looking for $( '.rwmb-time' ), but inc/fields/time.php sets the class rwmb-datetime for all time fields (on line 40). A change to this will do the trick:
    '<input type="text" class="rwmb-time" name="%s" value="%s" id="%s" size="%s" data-options="%s" />',

    Also, may I suggest changing line 15 in js/time.js to this?
    $this.removeClass( 'hasDatepicker' ).timepicker( options );
    (That way the options doesn’t have to be normalized with timeOnly set to false.)

    I found this issue both in 4.2 and 4.2.1.
    Thanks for all your hard work!

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘time field js wont run without datetime’ is closed to new replies.