Post Closed as "off-topic" by Mark Kaplun, Pieter Goosen, Mayeenul Islam, shea, cybmeta
4 added 76 characters in body
source | link

I want to chage date format to d-m-y means day-month-year format . I have added

'date_format' => __( 'd-m-Y', 'cmb2' )

But not working. now it's month-day-year formated . Actually i want to change date format like month-day-year to day-month-year.

mata field

Here is code:

add_filter( 'cmb_meta_boxes', 'cmb_sample_metaboxes' );
function cmb_sample_metaboxes( array $meta_boxes ) {

    $prefix = '_single_';

    $meta_boxes[] = array(
        'id'         => 'coupons_metabox',
        'title'      => 'Coupon details',
        'pages'      => array( 'coupons', ), // Post type
        'context'    => 'normal',
        'priority'   => 'high',
        'show_names' => true, // Show field names on the left
        'fields' => array(
            array( // Text Input
                'name' => 'The date the coupon expires', // <label>
                'desc'  => 'The expiration date of the coupon. Leave if empty if the coupon doesn\'t have an expiration date.', // description
                'id'    => $prefix . 'date', // field id and name
                'type'  => 'text_date_timestamp', // type of field,
                ),
        )
    );

    // Add other metaboxes as needed

    return $meta_boxes;
   }

add_action( 'init', 'cmb_initialize_cmb_meta_boxes', 9999 );
/**
 * Initialize the metabox class.
 */
function cmb_initialize_cmb_meta_boxes() {

    if ( ! class_exists( 'cmb_Meta_Box' ) )
        require_once 'init.php';

}

I want to chage date format to d-m-y means day-month-year format . I have added

'date_format' => __( 'd-m-Y', 'cmb2' )

But not working. now it's month-day-year formated .

mata field

Here is code:

add_filter( 'cmb_meta_boxes', 'cmb_sample_metaboxes' );
function cmb_sample_metaboxes( array $meta_boxes ) {

    $prefix = '_single_';

    $meta_boxes[] = array(
        'id'         => 'coupons_metabox',
        'title'      => 'Coupon details',
        'pages'      => array( 'coupons', ), // Post type
        'context'    => 'normal',
        'priority'   => 'high',
        'show_names' => true, // Show field names on the left
        'fields' => array(
            array( // Text Input
                'name' => 'The date the coupon expires', // <label>
                'desc'  => 'The expiration date of the coupon. Leave if empty if the coupon doesn\'t have an expiration date.', // description
                'id'    => $prefix . 'date', // field id and name
                'type'  => 'text_date_timestamp', // type of field,
                ),
        )
    );

    // Add other metaboxes as needed

    return $meta_boxes;
   }

add_action( 'init', 'cmb_initialize_cmb_meta_boxes', 9999 );
/**
 * Initialize the metabox class.
 */
function cmb_initialize_cmb_meta_boxes() {

    if ( ! class_exists( 'cmb_Meta_Box' ) )
        require_once 'init.php';

}

I want to chage date format to d-m-y means day-month-year format . I have added

'date_format' => __( 'd-m-Y', 'cmb2' )

But not working. now it's month-day-year formated . Actually i want to change date format like month-day-year to day-month-year.

mata field

Here is code:

add_filter( 'cmb_meta_boxes', 'cmb_sample_metaboxes' );
function cmb_sample_metaboxes( array $meta_boxes ) {

    $prefix = '_single_';

    $meta_boxes[] = array(
        'id'         => 'coupons_metabox',
        'title'      => 'Coupon details',
        'pages'      => array( 'coupons', ), // Post type
        'context'    => 'normal',
        'priority'   => 'high',
        'show_names' => true, // Show field names on the left
        'fields' => array(
            array( // Text Input
                'name' => 'The date the coupon expires', // <label>
                'desc'  => 'The expiration date of the coupon. Leave if empty if the coupon doesn\'t have an expiration date.', // description
                'id'    => $prefix . 'date', // field id and name
                'type'  => 'text_date_timestamp', // type of field,
                ),
        )
    );

    // Add other metaboxes as needed

    return $meta_boxes;
   }

add_action( 'init', 'cmb_initialize_cmb_meta_boxes', 9999 );
/**
 * Initialize the metabox class.
 */
function cmb_initialize_cmb_meta_boxes() {

    if ( ! class_exists( 'cmb_Meta_Box' ) )
        require_once 'init.php';

}
3 added 64 characters in body
source | link

I want to chage date format to d/-m/-y means day-month-year format . I have added

'date_format' => __( 'd-m-Y', 'cmb2' )

But not working. now it's month-day-year formated .

mata field

Here is code:

add_filter( 'cmb_meta_boxes', 'cmb_sample_metaboxes' );
function cmb_sample_metaboxes( array $meta_boxes ) {

    $prefix = '_single_';

    $meta_boxes[] = array(
        'id'         => 'coupons_metabox',
        'title'      => 'Coupon details',
        'pages'      => array( 'coupons', ), // Post type
        'context'    => 'normal',
        'priority'   => 'high',
        'show_names' => true, // Show field names on the left
        'fields' => array(
            array( // Text Input
                'name' => 'The date the coupon expires', // <label>
                'desc'  => 'The expiration date of the coupon. Leave if empty if the coupon doesn\'t have an expiration date.', // description
                'id'    => $prefix . 'date', // field id and name
                'type'  => 'text_date_timestamp', // type of field,
                ),
        )
    );

    // Add other metaboxes as needed

    return $meta_boxes;
   }

add_action( 'init', 'cmb_initialize_cmb_meta_boxes', 9999 );
/**
 * Initialize the metabox class.
 */
function cmb_initialize_cmb_meta_boxes() {

    if ( ! class_exists( 'cmb_Meta_Box' ) )
        require_once 'init.php';

}

I want to chage date format to d/m/y . I have added

'date_format' => __( 'd-m-Y', 'cmb2' )

But not working.

mata field

Here is code:

add_filter( 'cmb_meta_boxes', 'cmb_sample_metaboxes' );
function cmb_sample_metaboxes( array $meta_boxes ) {

    $prefix = '_single_';

    $meta_boxes[] = array(
        'id'         => 'coupons_metabox',
        'title'      => 'Coupon details',
        'pages'      => array( 'coupons', ), // Post type
        'context'    => 'normal',
        'priority'   => 'high',
        'show_names' => true, // Show field names on the left
        'fields' => array(
            array( // Text Input
                'name' => 'The date the coupon expires', // <label>
                'desc'  => 'The expiration date of the coupon. Leave if empty if the coupon doesn\'t have an expiration date.', // description
                'id'    => $prefix . 'date', // field id and name
                'type'  => 'text_date_timestamp', // type of field,
                ),
        )
    );

    // Add other metaboxes as needed

    return $meta_boxes;
   }

add_action( 'init', 'cmb_initialize_cmb_meta_boxes', 9999 );
/**
 * Initialize the metabox class.
 */
function cmb_initialize_cmb_meta_boxes() {

    if ( ! class_exists( 'cmb_Meta_Box' ) )
        require_once 'init.php';

}

I want to chage date format to d-m-y means day-month-year format . I have added

'date_format' => __( 'd-m-Y', 'cmb2' )

But not working. now it's month-day-year formated .

mata field

Here is code:

add_filter( 'cmb_meta_boxes', 'cmb_sample_metaboxes' );
function cmb_sample_metaboxes( array $meta_boxes ) {

    $prefix = '_single_';

    $meta_boxes[] = array(
        'id'         => 'coupons_metabox',
        'title'      => 'Coupon details',
        'pages'      => array( 'coupons', ), // Post type
        'context'    => 'normal',
        'priority'   => 'high',
        'show_names' => true, // Show field names on the left
        'fields' => array(
            array( // Text Input
                'name' => 'The date the coupon expires', // <label>
                'desc'  => 'The expiration date of the coupon. Leave if empty if the coupon doesn\'t have an expiration date.', // description
                'id'    => $prefix . 'date', // field id and name
                'type'  => 'text_date_timestamp', // type of field,
                ),
        )
    );

    // Add other metaboxes as needed

    return $meta_boxes;
   }

add_action( 'init', 'cmb_initialize_cmb_meta_boxes', 9999 );
/**
 * Initialize the metabox class.
 */
function cmb_initialize_cmb_meta_boxes() {

    if ( ! class_exists( 'cmb_Meta_Box' ) )
        require_once 'init.php';

}
2 added 1 character in body
source | link

I want to chage date format to d/m/yd/m/y . I have added

'date_format' => __( 'd-m-Y', 'cmb2' )

But nownot working  .

mata field

Here is code:

add_filter( 'cmb_meta_boxes', 'cmb_sample_metaboxes' );
function cmb_sample_metaboxes( array $meta_boxes ) {

    $prefix = '_single_';

    $meta_boxes[] = array(
        'id'         => 'coupons_metabox',
        'title'      => 'Coupon details',
        'pages'      => array( 'coupons', ), // Post type
        'context'    => 'normal',
        'priority'   => 'high',
        'show_names' => true, // Show field names on the left
        'fields' => array(
            array( // Text Input
                'name' => 'The date the coupon expires', // <label>
                'desc'  => 'The expiration date of the coupon. Leave if empty if the coupon doesn\'t have an expiration date.', // description
                'id'    => $prefix . 'date', // field id and name
                'type'  => 'text_date_timestamp', // type of field,
                ),
        )
    );

    // Add other metaboxes as needed

    return $meta_boxes;
   }

add_action( 'init', 'cmb_initialize_cmb_meta_boxes', 9999 );
/**
 * Initialize the metabox class.
 */
function cmb_initialize_cmb_meta_boxes() {

    if ( ! class_exists( 'cmb_Meta_Box' ) )
        require_once 'init.php';

}

I want to chage date format to d/m/y . I have added

'date_format' => __( 'd-m-Y', 'cmb2' )

But now working  .

mata field

Here is code:

add_filter( 'cmb_meta_boxes', 'cmb_sample_metaboxes' );
function cmb_sample_metaboxes( array $meta_boxes ) {

    $prefix = '_single_';

    $meta_boxes[] = array(
        'id'         => 'coupons_metabox',
        'title'      => 'Coupon details',
        'pages'      => array( 'coupons', ), // Post type
        'context'    => 'normal',
        'priority'   => 'high',
        'show_names' => true, // Show field names on the left
        'fields' => array(
            array( // Text Input
                'name' => 'The date the coupon expires', // <label>
                'desc'  => 'The expiration date of the coupon. Leave if empty if the coupon doesn\'t have an expiration date.', // description
                'id'    => $prefix . 'date', // field id and name
                'type'  => 'text_date_timestamp', // type of field,
                ),
        )
    );

    // Add other metaboxes as needed

    return $meta_boxes;
   }

add_action( 'init', 'cmb_initialize_cmb_meta_boxes', 9999 );
/**
 * Initialize the metabox class.
 */
function cmb_initialize_cmb_meta_boxes() {

    if ( ! class_exists( 'cmb_Meta_Box' ) )
        require_once 'init.php';

}

I want to chage date format to d/m/y . I have added

'date_format' => __( 'd-m-Y', 'cmb2' )

But not working.

mata field

Here is code:

add_filter( 'cmb_meta_boxes', 'cmb_sample_metaboxes' );
function cmb_sample_metaboxes( array $meta_boxes ) {

    $prefix = '_single_';

    $meta_boxes[] = array(
        'id'         => 'coupons_metabox',
        'title'      => 'Coupon details',
        'pages'      => array( 'coupons', ), // Post type
        'context'    => 'normal',
        'priority'   => 'high',
        'show_names' => true, // Show field names on the left
        'fields' => array(
            array( // Text Input
                'name' => 'The date the coupon expires', // <label>
                'desc'  => 'The expiration date of the coupon. Leave if empty if the coupon doesn\'t have an expiration date.', // description
                'id'    => $prefix . 'date', // field id and name
                'type'  => 'text_date_timestamp', // type of field,
                ),
        )
    );

    // Add other metaboxes as needed

    return $meta_boxes;
   }

add_action( 'init', 'cmb_initialize_cmb_meta_boxes', 9999 );
/**
 * Initialize the metabox class.
 */
function cmb_initialize_cmb_meta_boxes() {

    if ( ! class_exists( 'cmb_Meta_Box' ) )
        require_once 'init.php';

}
1
source | link