Skip to content

Commit

Permalink
fix: time format for store opening closing widget (#584)
Browse files Browse the repository at this point in the history
* fix: time format for store opening closing widget

* refactor: time format placeholder
  • Loading branch information
saimonh3 authored and sabbir1991 committed Mar 20, 2019
1 parent 473a2ac commit d88d1f5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions templates/settings/store-form.php
Original file line number Diff line number Diff line change
Expand Up @@ -264,10 +264,10 @@
</select>
</label>
<label for="opening-time" class="time" style="visibility: <?php echo isset( $all_times[$day]['open'] ) && $all_times[$day]['open'] == 'open' ? 'visible' : 'hidden' ?>" >
<input type="text" class="dokan-form-control" name="<?php echo esc_attr( strtolower( $day ) ); ?>_opening_time" id="<?php echo esc_attr( $day ) ?>-opening-time" placeholder="<?php esc_attr_e( '10:00 AM' ); ?>" value="<?php echo isset( $all_times[$day]['opening_time'] ) ? esc_attr( $all_times[$day]['opening_time'] ) : '' ?>" >
<input type="text" class="dokan-form-control" name="<?php echo esc_attr( strtolower( $day ) ); ?>_opening_time" id="<?php echo esc_attr( $day ) ?>-opening-time" placeholder="<?php echo date_i18n( get_option( 'time_format', 'g:i a' ), current_time( 'timestamp' ) ); ?>" value="<?php echo isset( $all_times[$day]['opening_time'] ) ? esc_attr( $all_times[$day]['opening_time'] ) : '' ?>" >
</label>
<label for="closing-time" class="time" style="visibility: <?php echo isset( $all_times[$day]['open'] ) && $all_times[$day]['open'] == 'open' ? 'visible' : 'hidden' ?>" >
<input type="text" class="dokan-form-control" name="<?php echo esc_attr( $day ) ?>_closing_time" id="<?php echo esc_attr( $day ) ?>-closing-time" placeholder="<?php esc_attr_e( '2:00 PM' ); ?>" value="<?php echo isset( $all_times[$day]['closing_time'] ) ? esc_attr( $all_times[$day]['closing_time'] ) : '' ?>">
<input type="text" class="dokan-form-control" name="<?php echo esc_attr( $day ) ?>_closing_time" id="<?php echo esc_attr( $day ) ?>-closing-time" placeholder="<?php echo date_i18n( get_option( 'time_format', 'g:i a' ), current_time( 'timestamp' ) ); ?>" value="<?php echo isset( $all_times[$day]['closing_time'] ) ? esc_attr( $all_times[$day]['closing_time'] ) : '' ?>">
</label>
</div>
<?php endforeach; ?>
Expand Down Expand Up @@ -386,7 +386,8 @@
} );
$( '.time .dokan-form-control' ).timepicker({
scrollDefault: 'now',
timeFormat: 'g:i A',
timeFormat: '<?php echo get_option( 'time_format' ); ?>',
step: <?php echo 'h' === strtolower( get_option( 'time_format' ) ) ? '60' : '30'; ?>
});
// dokan store open close scripts end //

Expand Down

0 comments on commit d88d1f5

Please sign in to comment.