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.js
is looking for$( '.rwmb-time' )
, butinc/fields/time.php
sets the classrwmb-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 withtimeOnly
set to false.)I found this issue both in 4.2 and 4.2.1.
Thanks for all your hard work!
- The topic ‘time field js wont run without datetime’ is closed to new replies.