[Resolved] time field js wont run without datetime
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.jsis looking for
$( '.rwmb-time' ), but
inc/fields/time.phpsets the class
rwmb-datetimefor 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
$this.removeClass( 'hasDatepicker' ).timepicker( options );
(That way the options doesn’t have to be normalized with
timeOnlyset to false.)
I found this issue both in 4.2 and 4.2.1.
Thanks for all your hard work!
- The topic ‘[Resolved] time field js wont run without datetime’ is closed to new replies.