Description | Installation | Screenshots | Filters | Changelog | Credits | Copyright and License
Add a Date Range field to your Ninja Forms.
- Upload the plugin files to the
/wp-content/plugins/data-range-ninja-forms
directory, or install the plugin through the WordPress plugins screen directly. - Activate the plugin through the 'Plugins' screen in WordPress
- Use Ninja Forms to add the Date Range field.
Add the filters to your child theme functions.php
Override the value returned from get_locale().
E.g. if using Polylang, add:
add_filter( 'date_range_lang', function( $locale ) {
if ( function_exists( 'pll_current_language' ) ) {
$locale = pll_current_language( 'locale' );
}
return $locale;
} );
Enable dropdowns for months, years.
If maxYear
is null
then maxYear
will be equal to (new Date()).getFullYear()
.
add_filter( 'date_range_dropdowns', function( $dropdowns ) {
$dropdowns = [
'minYear' => 2020,
'maxYear' => 2030,
'months' => false,
'years' => true, // show dropdown for years.
];
return $dropdowns;
} );
Text for buttons.
add_filter( 'date_range_buttontext', function( $buttontext ) {
$buttontext = [
'apply' => 'Apply',
'cancel' => 'Cancel',
'previousMonth' => '<svg .../></svg>',
'nextMonth' => '<svg .../></svg>',
];
return $buttontext;
} );
I've created an iCalendar add-on for Ninja Forms.
- Update to latest version of Litepicker
- Lint source code using PHP CodeSniffer and Rome.
- Add date setting field
- Refactor
- Custom validation for required fields
- Add moment.js
- Refactor code, using ES2019 Class Fields.
- Refactor JavaScript to ES6.
- Fix breaking bug
- Add more settings.
- Add filters:
date_range_lang
,date_range_dropdowns
anddate_range_buttontext
. - Add
languages/date-range-ninja-forms.pot
- Replace Lightpick, no longer maintained, with Litepicker
- In Ninja Forms builder, select WP Settings date.
- Set date format in Ninja Form builder
- Initial release.
Date Range field for Ninja Forms uses Litepicker. The Litepicker has a MIT licence and is Copyright 2019 Rinat G.
Date Range field for Ninja Forms is copyright 2020 Per Soderlind
Date Range field for Ninja Forms is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version.
Date Range field for Ninja Forms is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with the Extension. If not, see http://www.gnu.org/licenses/.