Save
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -0,0 +1,97 @@
|
|||||||
|
;(function ($) {
|
||||||
|
$(document).ready(function () {
|
||||||
|
|
||||||
|
function get_todate(){
|
||||||
|
var today = new Date();
|
||||||
|
var dd = today.getDate();
|
||||||
|
var mm = today.getMonth()+1; //January is 0!
|
||||||
|
var yyyy = today.getFullYear();
|
||||||
|
if(dd<10) {
|
||||||
|
dd = '0'+dd
|
||||||
|
}
|
||||||
|
if(mm<10) {
|
||||||
|
mm = '0'+mm
|
||||||
|
}
|
||||||
|
today = yyyy + '-' + mm + '-' + dd;
|
||||||
|
return today;
|
||||||
|
}
|
||||||
|
|
||||||
|
function get_tomorrow(){
|
||||||
|
var tomorrow = new Date(new Date().getTime() + 24 * 60 * 60 * 1000);
|
||||||
|
var dd = tomorrow.getDate()
|
||||||
|
var mm = tomorrow.getMonth() + 1
|
||||||
|
var yyyy = tomorrow.getFullYear()
|
||||||
|
if(dd<10) {
|
||||||
|
dd = '0'+dd
|
||||||
|
}
|
||||||
|
if(mm<10) {
|
||||||
|
mm = '0'+mm
|
||||||
|
}
|
||||||
|
tomorrow = yyyy + '-' + mm + '-' + dd;
|
||||||
|
return tomorrow;
|
||||||
|
}
|
||||||
|
|
||||||
|
$('.walcf7-datetimepicker').each(function(index, element) {
|
||||||
|
var todate = get_todate();
|
||||||
|
var tomorrow = get_tomorrow();
|
||||||
|
$(this).datetimepicker({
|
||||||
|
dayOfWeekStart : 1,
|
||||||
|
yearStart: '1900',
|
||||||
|
lang:'en',
|
||||||
|
format:'Y-m-d H:i',
|
||||||
|
formatDate:'Y-m-d',
|
||||||
|
formatTime:'H:i',
|
||||||
|
defaultTime:'10:00',
|
||||||
|
validateOnBlur: false,
|
||||||
|
startDate:tomorrow,
|
||||||
|
onGenerate: function( ct, $input ){
|
||||||
|
$input.prop('readonly', true);
|
||||||
|
var $this = $(this);
|
||||||
|
$this.find('.xdsoft_date').removeClass('xdsoft_disabled');
|
||||||
|
$this.find('.xdsoft_time').removeClass('xdsoft_disabled');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
$('.walcf7-datepicker').each(function(index, element) {
|
||||||
|
var todate = get_todate();
|
||||||
|
var tomorrow = get_tomorrow();
|
||||||
|
$(this).datetimepicker({
|
||||||
|
dayOfWeekStart : 1,
|
||||||
|
yearStart: '1900',
|
||||||
|
lang:'en',
|
||||||
|
timepicker:false,
|
||||||
|
format:'Y-m-d',
|
||||||
|
formatDate:'Y-m-d',
|
||||||
|
validateOnBlur: false,
|
||||||
|
startDate:tomorrow,
|
||||||
|
onGenerate: function( ct, $input ){
|
||||||
|
$input.prop('readonly', true);
|
||||||
|
var $this = $(this);
|
||||||
|
$this.find('.xdsoft_date').removeClass('xdsoft_disabled');
|
||||||
|
$this.find('.xdsoft_time').removeClass('xdsoft_disabled');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
$('.walcf7-timepicker').each(function(index, element) {
|
||||||
|
$(this).datetimepicker({
|
||||||
|
datepicker:false,
|
||||||
|
ignoreReadonly: true,
|
||||||
|
allowInputToggle: true,
|
||||||
|
format:'H:i',
|
||||||
|
defaultTime:'10:00',
|
||||||
|
step:15,
|
||||||
|
validateOnBlur: false,
|
||||||
|
onGenerate: function( ct, $input ){
|
||||||
|
$input.prop('readonly', true);
|
||||||
|
var $this = $(this);
|
||||||
|
$this.find('.xdsoft_date').removeClass('xdsoft_disabled');
|
||||||
|
$this.find('.xdsoft_time').removeClass('xdsoft_disabled');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
}(jQuery));
|
||||||
|
|
||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,67 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Plugin Name: Date Time Picker for Contact Form 7
|
||||||
|
* Plugin URI: https://wpapplab.com/
|
||||||
|
* Description: This plugin can be used to display date and time picker into Contact Form 7 text input field by using css class. This plugin specifically designed to work with Contact Form 7. Other form plugins are not tested.
|
||||||
|
* Version: 1.1.1
|
||||||
|
* Author: Ruhul Amin
|
||||||
|
* Author URI: https://mircode.com
|
||||||
|
* Text Domain: walcf7-datetimepicker
|
||||||
|
*
|
||||||
|
* @package WAL Demo
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
define('WALCF7_DTP_NAME', __('Date Time Picker for Contact form 7', 'walcf7-datetimepicker'));
|
||||||
|
define('WALCF7_DTP_FILE', __FILE__);
|
||||||
|
define('WALCF7_DTP_BASE', plugin_basename(WALCF7_DTP_FILE));
|
||||||
|
define('WALCF7_DTP_DIR', plugin_dir_path(WALCF7_DTP_FILE));
|
||||||
|
define('WALCF7_DTP_URI', plugins_url('/', WALCF7_DTP_FILE));
|
||||||
|
|
||||||
|
|
||||||
|
// Load backend scripts
|
||||||
|
function walcf7_dtp_script_loader()
|
||||||
|
{
|
||||||
|
|
||||||
|
wp_enqueue_script(
|
||||||
|
'walcf7-datepicker-js',
|
||||||
|
WALCF7_DTP_URI . 'assets/js/jquery.datetimepicker.full.js',
|
||||||
|
array("jquery"),
|
||||||
|
false,
|
||||||
|
true
|
||||||
|
);
|
||||||
|
wp_enqueue_style(
|
||||||
|
'walcf7-datepicker-css',
|
||||||
|
WALCF7_DTP_URI . 'assets/css/jquery.datetimepicker.min.css',
|
||||||
|
false,
|
||||||
|
'1.0.0',
|
||||||
|
'all'
|
||||||
|
);
|
||||||
|
|
||||||
|
wp_enqueue_script(
|
||||||
|
'walcf7-datepicker',
|
||||||
|
WALCF7_DTP_URI . 'assets/js/datetimepicker.js',
|
||||||
|
array(
|
||||||
|
'jquery', // make sure this only loads if jQuery has loaded
|
||||||
|
),
|
||||||
|
'1.0.0',
|
||||||
|
true // Outputs this at footer
|
||||||
|
); // Custom Child Theme jQuery
|
||||||
|
}
|
||||||
|
|
||||||
|
add_action('wp_enqueue_scripts', 'walcf7_dtp_script_loader');
|
||||||
|
|
||||||
|
add_filter('plugin_row_meta', 'walcf7_plugin_row_meta', 10, 2);
|
||||||
|
|
||||||
|
function walcf7_plugin_row_meta($links, $file)
|
||||||
|
{
|
||||||
|
if (plugin_basename(__FILE__) == $file) {
|
||||||
|
$row_meta = array(
|
||||||
|
'walcf7_pro' => '<a href="' . esc_url('https://wpapplab.com/plugins/date-time-picker-for-contact-form-7-pro/') . '" target="_blank" aria-label="' . esc_attr__('Date Time Picker Pro', 'walcf7-datetimepicker') . '" style="color:red;"><b>' . esc_html__('Get Pro Version', 'walcf7-datetimepicker') . '</b></a>'
|
||||||
|
);
|
||||||
|
|
||||||
|
return array_merge($links, $row_meta);
|
||||||
|
}
|
||||||
|
return (array) $links;
|
||||||
|
}
|
||||||
@@ -0,0 +1,105 @@
|
|||||||
|
=== Plugin Name ===
|
||||||
|
Contributors: ruhul080
|
||||||
|
Donate link: https://wpapplab.com/
|
||||||
|
Tags: Contact Form 7, cf7, form, contact, date, time, picker, date picker, time picker
|
||||||
|
Requires at least: 4.0
|
||||||
|
Tested up to: 6.0.3
|
||||||
|
Stable tag: 1.1.1
|
||||||
|
Requires PHP: 5.6
|
||||||
|
License: GPLv2 or later
|
||||||
|
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
||||||
|
|
||||||
|
This plugin enables Contact Form 7 text field into a Date picker, Time picker or Date Time picker by using CSS class.
|
||||||
|
|
||||||
|
== Description ==
|
||||||
|
|
||||||
|
This plugin enables Contact Form 7 text field into a Date picker, Time picker or Date Time Picker by using CSS class. After installing the plugin you just need to add the necessary CSS class to the Contact Form 7 CSS Classes editor. If you use Multiple classes remember to separate each class with space.
|
||||||
|
|
||||||
|
**Here is the classes to use in each field:**
|
||||||
|
|
||||||
|
* Only for Date Picker: **walcf7-datepicker**
|
||||||
|
* Only for Time Picker: **walcf7-timepicker**
|
||||||
|
* For both Date and Time Picker: **walcf7-datetimepicker**
|
||||||
|
|
||||||
|
Remember: The class should be added to [text field. Example: [text* book-date class:walcf7-datepicker placeholder "Date Picker"]
|
||||||
|
|
||||||
|
**Check the demo site:** [Date Time Picker Demo](https://wpapplab.com/contact-form-7-date-time-picker/)
|
||||||
|
|
||||||
|
**[Download Pro Version at only $15](https://wpapplab.com/plugins/date-time-picker-for-contact-form-7-pro/):**
|
||||||
|
|
||||||
|
* Unlimited website usage
|
||||||
|
* 51 Language translation ([View supported Language](https://wpapplab.com/plugins/date-time-picker-for-contact-form-7-pro/#language))
|
||||||
|
* WPML - WordPress Multilingual Plugin Compatible
|
||||||
|
* Light / Dark Theme
|
||||||
|
* Disable past date selection
|
||||||
|
* Disable today if necessary
|
||||||
|
* Specify weekend and disable if necessary
|
||||||
|
* Disable specific date selection
|
||||||
|
* Specify holiday and Disable if necessary
|
||||||
|
* Maximum allowed date selection
|
||||||
|
* Minimum allowed date selection
|
||||||
|
* 24hr / 12hr time format
|
||||||
|
* Hide/Show AM/PM
|
||||||
|
* Change time step or interval
|
||||||
|
* Provide Max and Min selectable time
|
||||||
|
* Speed up website. Load script only at selected page
|
||||||
|
|
||||||
|
**[Download Pro Version from Here](https://wpapplab.com/plugins/date-time-picker-for-contact-form-7-pro/):**
|
||||||
|
|
||||||
|
**How to Video (Free):**
|
||||||
|
|
||||||
|
[youtube https://www.youtube.com/watch?v=782kHUkg4XM]
|
||||||
|
|
||||||
|
**[Pro Version Features:](https://wpapplab.com/plugins/date-time-picker-for-contact-form-7-pro/):**
|
||||||
|
|
||||||
|
[youtube https://www.youtube.com/watch?v=jQbbF7Usc44]
|
||||||
|
|
||||||
|
|
||||||
|
**Credits:**
|
||||||
|
|
||||||
|
* [jQuery](https://jquery.com/)
|
||||||
|
* [xdsoft.net](https://xdsoft.net/jqplugins/datetimepicker/)
|
||||||
|
|
||||||
|
== Frequently Asked Questions ==
|
||||||
|
|
||||||
|
= Can I disable selecting previous date? =
|
||||||
|
|
||||||
|
No you can not. It will be added in Pro version
|
||||||
|
|
||||||
|
= How many websites can I use it? =
|
||||||
|
|
||||||
|
You can use it in unlimited website.
|
||||||
|
|
||||||
|
== Screenshots ==
|
||||||
|
|
||||||
|
1. Use in Contact Form 7
|
||||||
|
2. Date Picker
|
||||||
|
3. Time Picker
|
||||||
|
4. Date Time Picker
|
||||||
|
|
||||||
|
== Changelog ==
|
||||||
|
|
||||||
|
= 1.1.0 =
|
||||||
|
* Fix all language issue
|
||||||
|
|
||||||
|
= 1.0.9 =
|
||||||
|
* Fix japanese and spanish language
|
||||||
|
* Fix German language
|
||||||
|
|
||||||
|
= 1.0.8 =
|
||||||
|
* Fix time scroll on mobile device
|
||||||
|
* Fix vietnamese language
|
||||||
|
|
||||||
|
= 1.0.7 =
|
||||||
|
* Added WPML WordPress Multilingual Plugin Compatible
|
||||||
|
* Fix error to walcf7-datetimepicker am/pm
|
||||||
|
|
||||||
|
= 1.0.3 =
|
||||||
|
* Past year selection starts from 1900
|
||||||
|
|
||||||
|
= 1.0.2 =
|
||||||
|
* Usefull link provided on plugin directory
|
||||||
|
|
||||||
|
= 1.0.1 =
|
||||||
|
* Initial Release
|
||||||
|
|
||||||
Reference in New Issue
Block a user