Skip to content
This repository has been archived by the owner on Dec 17, 2018. It is now read-only.

Commit

Permalink
Merge pull request #506 from Scrent/patch-3
Browse files Browse the repository at this point in the history
Uses custom date and time formats or the default one if none is provided. props @Scrent.
  • Loading branch information
jtsternberg committed Apr 7, 2014
2 parents e03cd69 + dcd33d4 commit 0bfb651
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions helpers/cmb_Meta_Box_types.php
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ public function wysiwyg( $args = array() ) {

public function text_date_timestamp() {
$meta_value = $this->field->escaped_value();
$value = ! empty( $meta_value ) ? date( 'm\/d\/Y', $meta_value ) : '';
$value = ! empty( $meta_value ) ? date( $this->field->args( 'date_format' ), $meta_value ) : '';
return $this->input( array( 'class' => 'cmb_text_small cmb_datepicker', 'value' => $value ) );
}

Expand All @@ -465,14 +465,14 @@ public function text_datetime_timestamp( $meta_value = '' ) {
'class' => 'cmb_text_small cmb_datepicker',
'name' => $this->_name( '[date]' ),
'id' => $this->_id( '_date' ),
'value' => ! empty( $meta_value ) ? date( 'm\/d\/Y', $meta_value ) : '',
'value' => ! empty( $meta_value ) ? date( $this->field->args( 'date_format' ), $meta_value ) : '',
'desc' => '',
) ),
$this->input( array(
'class' => 'cmb_timepicker text_time',
'name' => $this->_name( '[time]' ),
'id' => $this->_id( '_time' ),
'value' => ! empty( $meta_value ) ? date( 'h:i A', $meta_value ) : '',
'value' => ! empty( $meta_value ) ? date( $this->field->args( 'time_format' ), $meta_value ) : '',
'desc' => $desc,
) )
);
Expand Down

0 comments on commit 0bfb651

Please sign in to comment.