Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix `time` and `datetime` field

  • Loading branch information...
commit 69c40b6a35805c52485fff2911505aa80f07e0d2 1 parent f6b99ca
@rilwis authored
Showing with 3 additions and 4 deletions.
  1. +1 −2  inc/fields/time.php
  2. +1 −1  js/datetime.js
  3. +1 −1  js/time.js
View
3  inc/fields/time.php
@@ -37,7 +37,7 @@ static function admin_enqueue_scripts( )
static function html( $html, $meta, $field )
{
return sprintf(
- '<input type="text" class="rwmb-datetime" name="%s" value="%s" id="%s" size="%s" data-options="%s" />',
+ '<input type="text" class="rwmb-time" name="%s" value="%s" id="%s" size="%s" data-options="%s" />',
$field['field_name'],
$meta,
isset( $field['clone'] ) && $field['clone'] ? '' : $field['id'],
@@ -63,7 +63,6 @@ static function normalize_field( $field )
// Deprecate 'format', but keep it for backward compatible
// Use 'js_options' instead
$field['js_options'] = wp_parse_args( $field['js_options'], array(
- 'timeOnly' => true,
'showButtonPanel' => true,
'timeFormat' => empty( $field['format'] ) ? 'hh:mm:ss' : $field['format'],
) );
View
2  js/datetime.js
@@ -12,7 +12,7 @@ function rwmb_update_datetime_picker()
options = $this.data( 'options' );
$this.siblings( '.ui-datepicker-append' ).remove(); // Remove appended text
- $this.removeClass( 'hasDatepicker' ).datepicker( options );
+ $this.removeClass( 'hasDatepicker' ).datetimepicker( options );
} );
}
View
2  js/time.js
@@ -12,7 +12,7 @@ function rwmb_update_time_picker()
options = $this.data( 'options' );
$this.siblings( '.ui-datepicker-append' ).remove(); // Remove appended text
- $this.removeClass( 'hasDatepicker' ).datepicker( options );
+ $this.removeClass( 'hasDatepicker' ).timepicker( options );
} );
}

1 comment on commit 69c40b6

@djevrek

Thanks, i was looking for this fix 5-6 hours ago.

Please sign in to comment.
Something went wrong with that request. Please try again.