GitHub - WebDevStudios/CMB2-Date-Range-Field
Use the field type of date_range when initializing your CMB2 Field.
$prefix = '_yourprefix_'; $cmb_demo = new_cmb2_box( array( 'id' => $prefix . 'metabox', 'title' => __( 'Test Metabox', 'cmb2' ), 'object_types' => array( 'post', ), // Post type 'context' => 'normal', 'priority' => 'high', 'show_names' => true, ) ); $cmb_demo->add_field( array( 'name' => __( 'Test Date Range', 'cmb2' ), 'desc' => __( 'field description (optional)', 'cmb2' ), 'id' => $prefix . 'date_range', 'type' => 'date_range', ) );