https://github.com/webdevstudios/cmb2-date-range-field
https://github.com/webdevstudios/cmb2-date-range-field
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/webdevstudios/cmb2-date-range-field
- Owner: WebDevStudios
- Created: 2015-05-26T13:42:50.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2021-04-29T08:42:15.000Z (almost 5 years ago)
- Last Synced: 2025-03-27T13:45:19.542Z (about 1 year ago)
- Language: JavaScript
- Size: 70.3 KB
- Stars: 20
- Watchers: 56
- Forks: 9
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# WDS CMB2 Date Range Field #
- **Contributors:** WebDevStudios
- **Donate link:** http://webdevstudios.com
- **Tags:**
- **Requires at least:** 3.6.0
- **Tested up to:** 4.7.0
- **Stable tag:** 0.1.2
- **License:** GPLv2
- **License URI:** http://www.gnu.org/licenses/gpl-2.0.html
## Description ##
Adds a date range field to CMB2

## Installation ##
### Manual Installation ###
1. Upload the entire `/wds-cmb2-date-range-field` directory to the `/wp-content/plugins/` directory.
2. Activate WDS CMB2 Date Range Field through the 'Plugins' menu in WordPress.
## Frequently Asked Questions ##
### How do I use the field? ###
Use the field type of `date_range` when initializing your CMB2 Field.
```php
$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',
) );
```
## Screenshots ##
## Changelog ##
### 0.1.2 ###
* Fix year being stored as "Y" instead of the actual year. Fixes [#7](https://github.com/WebDevStudios/CMB2-Date-Range-Field/issues/7)
* Make it work without JS. Also, add spinner until daterange picker loads.
* Update styling to work with CMB2's new picker styles.
### 0.1.1 ###
* The included jQuery UI css was causing major conflicts. This now leans heavily on CMB2 datepicker UI styling.
* Updated to use CMB2 APIs so that expected functionality will not break.
* Moved all JS to separate file and handle initiating datepicker with data attributes on the field inputs.
### 0.1.0 ###
* First release