Skip to content

Year is stored as "Y" instead of the actual year #7

@zedejose

Description

@zedejose

Not sure if I'm doing something wrong but when defining the field as:

$cmb->add_field( array(
'name'       => __( 'Test Date Range', 'cmb2' ),
'desc'       => __( 'field description (optional)', 'cmb2' ),
'id'         => $this->field_prefix . 'date_range',
'type'       => 'date_range',
) );

This is what gets saved to the database:

a:2:{s:5:"start";s:6:"9/28/Y";s:3:"end";s:7:"10/31/Y";}

i.e. the year is saved as "Y" instead of the actual year

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions