jquery_datepick 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +17 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +58 -0
- data/Rakefile +1 -0
- data/jquery_datepick.gemspec +20 -0
- data/lib/jquery_datepick/datepick_helper.rb +13 -0
- data/lib/jquery_datepick/form_helper.rb +61 -0
- data/lib/jquery_datepick/version.rb +3 -0
- data/lib/jquery_datepick.rb +16 -0
- data/vendor/assets/images/calendar-blue.gif +0 -0
- data/vendor/assets/images/calendar-green.gif +0 -0
- data/vendor/assets/images/calendar.gif +0 -0
- data/vendor/assets/javascripts/jquery.datepick-af.js +29 -0
- data/vendor/assets/javascripts/jquery.datepick-am.js +29 -0
- data/vendor/assets/javascripts/jquery.datepick-ar-DZ.js +28 -0
- data/vendor/assets/javascripts/jquery.datepick-ar-EG.js +29 -0
- data/vendor/assets/javascripts/jquery.datepick-ar.js +30 -0
- data/vendor/assets/javascripts/jquery.datepick-az.js +29 -0
- data/vendor/assets/javascripts/jquery.datepick-bg.js +29 -0
- data/vendor/assets/javascripts/jquery.datepick-bs.js +29 -0
- data/vendor/assets/javascripts/jquery.datepick-ca.js +29 -0
- data/vendor/assets/javascripts/jquery.datepick-cs.js +29 -0
- data/vendor/assets/javascripts/jquery.datepick-da.js +29 -0
- data/vendor/assets/javascripts/jquery.datepick-de-CH.js +29 -0
- data/vendor/assets/javascripts/jquery.datepick-de.js +29 -0
- data/vendor/assets/javascripts/jquery.datepick-el.js +29 -0
- data/vendor/assets/javascripts/jquery.datepick-en-AU.js +29 -0
- data/vendor/assets/javascripts/jquery.datepick-en-GB.js +29 -0
- data/vendor/assets/javascripts/jquery.datepick-en-NZ.js +29 -0
- data/vendor/assets/javascripts/jquery.datepick-eo.js +29 -0
- data/vendor/assets/javascripts/jquery.datepick-es-AR.js +29 -0
- data/vendor/assets/javascripts/jquery.datepick-es-PE.js +29 -0
- data/vendor/assets/javascripts/jquery.datepick-es.js +29 -0
- data/vendor/assets/javascripts/jquery.datepick-et.js +29 -0
- data/vendor/assets/javascripts/jquery.datepick-eu.js +29 -0
- data/vendor/assets/javascripts/jquery.datepick-fa.js +29 -0
- data/vendor/assets/javascripts/jquery.datepick-fi.js +29 -0
- data/vendor/assets/javascripts/jquery.datepick-fo.js +29 -0
- data/vendor/assets/javascripts/jquery.datepick-fr-CH.js +29 -0
- data/vendor/assets/javascripts/jquery.datepick-fr.js +29 -0
- data/vendor/assets/javascripts/jquery.datepick-gl.js +29 -0
- data/vendor/assets/javascripts/jquery.datepick-gu.js +29 -0
- data/vendor/assets/javascripts/jquery.datepick-he.js +29 -0
- data/vendor/assets/javascripts/jquery.datepick-hi-IN.js +27 -0
- data/vendor/assets/javascripts/jquery.datepick-hi.js +27 -0
- data/vendor/assets/javascripts/jquery.datepick-hr.js +29 -0
- data/vendor/assets/javascripts/jquery.datepick-hu.js +29 -0
- data/vendor/assets/javascripts/jquery.datepick-hy.js +29 -0
- data/vendor/assets/javascripts/jquery.datepick-id.js +29 -0
- data/vendor/assets/javascripts/jquery.datepick-is.js +29 -0
- data/vendor/assets/javascripts/jquery.datepick-it.js +29 -0
- data/vendor/assets/javascripts/jquery.datepick-ja.js +31 -0
- data/vendor/assets/javascripts/jquery.datepick-ka.js +29 -0
- data/vendor/assets/javascripts/jquery.datepick-km.js +29 -0
- data/vendor/assets/javascripts/jquery.datepick-ko.js +31 -0
- data/vendor/assets/javascripts/jquery.datepick-lt.js +29 -0
- data/vendor/assets/javascripts/jquery.datepick-lv.js +29 -0
- data/vendor/assets/javascripts/jquery.datepick-me-ME.js +29 -0
- data/vendor/assets/javascripts/jquery.datepick-me.js +29 -0
- data/vendor/assets/javascripts/jquery.datepick-mk.js +31 -0
- data/vendor/assets/javascripts/jquery.datepick-ml.js +29 -0
- data/vendor/assets/javascripts/jquery.datepick-ms.js +29 -0
- data/vendor/assets/javascripts/jquery.datepick-mt.js +29 -0
- data/vendor/assets/javascripts/jquery.datepick-nl-BE.js +29 -0
- data/vendor/assets/javascripts/jquery.datepick-nl.js +29 -0
- data/vendor/assets/javascripts/jquery.datepick-no.js +29 -0
- data/vendor/assets/javascripts/jquery.datepick-pl.js +29 -0
- data/vendor/assets/javascripts/jquery.datepick-pt-BR.js +29 -0
- data/vendor/assets/javascripts/jquery.datepick-pt.js +29 -0
- data/vendor/assets/javascripts/jquery.datepick-rm.js +29 -0
- data/vendor/assets/javascripts/jquery.datepick-ro.js +29 -0
- data/vendor/assets/javascripts/jquery.datepick-ru.js +29 -0
- data/vendor/assets/javascripts/jquery.datepick-sk.js +29 -0
- data/vendor/assets/javascripts/jquery.datepick-sl.js +30 -0
- data/vendor/assets/javascripts/jquery.datepick-sq.js +29 -0
- data/vendor/assets/javascripts/jquery.datepick-sr-SR.js +29 -0
- data/vendor/assets/javascripts/jquery.datepick-sr.js +29 -0
- data/vendor/assets/javascripts/jquery.datepick-sv.js +29 -0
- data/vendor/assets/javascripts/jquery.datepick-ta.js +29 -0
- data/vendor/assets/javascripts/jquery.datepick-th.js +29 -0
- data/vendor/assets/javascripts/jquery.datepick-tr.js +29 -0
- data/vendor/assets/javascripts/jquery.datepick-uk.js +29 -0
- data/vendor/assets/javascripts/jquery.datepick-ur.js +30 -0
- data/vendor/assets/javascripts/jquery.datepick-vi.js +29 -0
- data/vendor/assets/javascripts/jquery.datepick-zh-CN.js +31 -0
- data/vendor/assets/javascripts/jquery.datepick-zh-HK.js +31 -0
- data/vendor/assets/javascripts/jquery.datepick-zh-TW.js +31 -0
- data/vendor/assets/javascripts/jquery.datepick.ext.js +264 -0
- data/vendor/assets/javascripts/jquery.datepick.ext.min.js +7 -0
- data/vendor/assets/javascripts/jquery.datepick.js +2056 -0
- data/vendor/assets/javascripts/jquery.datepick.lang.js +2185 -0
- data/vendor/assets/javascripts/jquery.datepick.lang.min.js +3 -0
- data/vendor/assets/javascripts/jquery.datepick.min.js +7 -0
- data/vendor/assets/javascripts/jquery.datepick.validation.js +230 -0
- data/vendor/assets/javascripts/jquery.datepick.validation.min.js +8 -0
- data/vendor/assets/stylesheets/flora.datepick.css +208 -0
- data/vendor/assets/stylesheets/humanity.datepick.css +197 -0
- data/vendor/assets/stylesheets/jquery.datepick.css +216 -0
- data/vendor/assets/stylesheets/redmond.datepick.css +199 -0
- data/vendor/assets/stylesheets/smoothness.datepick.css +200 -0
- data/vendor/assets/stylesheets/ui-black-tie.datepick.css +18 -0
- data/vendor/assets/stylesheets/ui-blitzer.datepick.css +18 -0
- data/vendor/assets/stylesheets/ui-cupertino.datepick.css +18 -0
- data/vendor/assets/stylesheets/ui-dark-hive.datepick.css +18 -0
- data/vendor/assets/stylesheets/ui-dot-luv.datepick.css +18 -0
- data/vendor/assets/stylesheets/ui-eggplant.datepick.css +18 -0
- data/vendor/assets/stylesheets/ui-excite-bike.datepick.css +18 -0
- data/vendor/assets/stylesheets/ui-flick.datepick.css +18 -0
- data/vendor/assets/stylesheets/ui-hot-sneaks.datepick.css +18 -0
- data/vendor/assets/stylesheets/ui-humanity.datepick.css +18 -0
- data/vendor/assets/stylesheets/ui-le-frog.datepick.css +18 -0
- data/vendor/assets/stylesheets/ui-mint-choc.datepick.css +18 -0
- data/vendor/assets/stylesheets/ui-overcast.datepick.css +18 -0
- data/vendor/assets/stylesheets/ui-pepper-grinder.datepick.css +18 -0
- data/vendor/assets/stylesheets/ui-redmond.datepick.css +18 -0
- data/vendor/assets/stylesheets/ui-smoothness.datepick.css +18 -0
- data/vendor/assets/stylesheets/ui-south-street.datepick.css +18 -0
- data/vendor/assets/stylesheets/ui-start.datepick.css +18 -0
- data/vendor/assets/stylesheets/ui-sunny.datepick.css +18 -0
- data/vendor/assets/stylesheets/ui-swanky-purse.datepick.css +18 -0
- data/vendor/assets/stylesheets/ui-trontastic.datepick.css +18 -0
- data/vendor/assets/stylesheets/ui-ui-darkness.datepick.css +18 -0
- data/vendor/assets/stylesheets/ui-ui-lightness.datepick.css +18 -0
- data/vendor/assets/stylesheets/ui-vader.datepick.css +18 -0
- data/vendor/assets/stylesheets/ui.datepick.css +118 -0
- metadata +194 -0
@@ -0,0 +1,230 @@
|
|
1
|
+
/* http://keith-wood.name/datepick.html
|
2
|
+
Datepicker Validation extension for jQuery 4.1.0.
|
3
|
+
Requires Jörn Zaefferer's Validation plugin (http://plugins.jquery.com/project/validate).
|
4
|
+
Written by Keith Wood (kbwood{at}iinet.com.au).
|
5
|
+
Dual licensed under the GPL (http://dev.jquery.com/browser/trunk/jquery/GPL-LICENSE.txt) and
|
6
|
+
MIT (http://dev.jquery.com/browser/trunk/jquery/MIT-LICENSE.txt) licenses.
|
7
|
+
Please attribute the author if you use it. */
|
8
|
+
|
9
|
+
(function($) { // Hide the namespace
|
10
|
+
|
11
|
+
/* Add validation methods if validation plugin available. */
|
12
|
+
if ($.fn.validate) {
|
13
|
+
|
14
|
+
$.datepick.selectDateOrig = $.datepick.selectDate;
|
15
|
+
|
16
|
+
$.extend($.datepick.regional[''], {
|
17
|
+
validateDate: 'Please enter a valid date',
|
18
|
+
validateDateMin: 'Please enter a date on or after {0}',
|
19
|
+
validateDateMax: 'Please enter a date on or before {0}',
|
20
|
+
validateDateMinMax: 'Please enter a date between {0} and {1}',
|
21
|
+
validateDateCompare: 'Please enter a date {0} {1}',
|
22
|
+
validateDateToday: 'today',
|
23
|
+
validateDateOther: 'the other date',
|
24
|
+
validateDateEQ: 'equal to',
|
25
|
+
validateDateNE: 'not equal to',
|
26
|
+
validateDateLT: 'before',
|
27
|
+
validateDateGT: 'after',
|
28
|
+
validateDateLE: 'not after',
|
29
|
+
validateDateGE: 'not before'
|
30
|
+
});
|
31
|
+
|
32
|
+
$.extend($.datepick._defaults, $.datepick.regional['']);
|
33
|
+
|
34
|
+
$.extend($.datepick, {
|
35
|
+
|
36
|
+
/* Trigger a validation after updating the input field with the selected date.
|
37
|
+
@param target (element) the control to examine
|
38
|
+
@param elem (element) the selected datepicker element */
|
39
|
+
selectDate: function(target, elem) {
|
40
|
+
this.selectDateOrig(target, elem);
|
41
|
+
var inst = $.data(target, $.datepick.propertyName);
|
42
|
+
if (!inst.inline && $.fn.validate) {
|
43
|
+
var validation = $(target).parents('form').validate();
|
44
|
+
if (validation) {
|
45
|
+
validation.element('#' + target.id);
|
46
|
+
}
|
47
|
+
}
|
48
|
+
},
|
49
|
+
|
50
|
+
/* Correct error placement for validation errors - after any trigger.
|
51
|
+
@param error (jQuery) the error message
|
52
|
+
@param element (jQuery) the field in error */
|
53
|
+
errorPlacement: function(error, element) {
|
54
|
+
var inst = $.data(element[0], $.datepick.propertyName);
|
55
|
+
if (inst) {
|
56
|
+
error[inst.options.isRTL ? 'insertBefore' : 'insertAfter'](
|
57
|
+
inst.trigger.length > 0 ? inst.trigger : element);
|
58
|
+
}
|
59
|
+
else {
|
60
|
+
error.insertAfter(element);
|
61
|
+
}
|
62
|
+
},
|
63
|
+
|
64
|
+
/* Format a validation error message involving dates.
|
65
|
+
@param source (string) the error message
|
66
|
+
@param params (Date[]) the dates
|
67
|
+
@return (string) the formatted message */
|
68
|
+
errorFormat: function(source, params) {
|
69
|
+
var format = ($.datepick.curInst ?
|
70
|
+
$.datepick.curInst.options.dateFormat :
|
71
|
+
$.datepick._defaults.dateFormat);
|
72
|
+
$.each(params, function(index, value) {
|
73
|
+
source = source.replace(new RegExp('\\{' + index + '\\}', 'g'),
|
74
|
+
$.datepick.formatDate(format, value) || 'nothing');
|
75
|
+
});
|
76
|
+
return source;
|
77
|
+
}
|
78
|
+
});
|
79
|
+
|
80
|
+
var lastElement = null;
|
81
|
+
|
82
|
+
/* Validate date field. */
|
83
|
+
$.validator.addMethod('dpDate', function(value, element) {
|
84
|
+
lastElement = element;
|
85
|
+
return this.optional(element) || validateEach(value, element);
|
86
|
+
},
|
87
|
+
function(params) {
|
88
|
+
var inst = $.data(lastElement, $.datepick.propertyName);
|
89
|
+
var minDate = inst.get('minDate');
|
90
|
+
var maxDate = inst.get('maxDate');
|
91
|
+
var messages = $.datepick._defaults;
|
92
|
+
return (minDate && maxDate ?
|
93
|
+
$.datepick.errorFormat(messages.validateDateMinMax, [minDate, maxDate]) :
|
94
|
+
(minDate ? $.datepick.errorFormat(messages.validateDateMin, [minDate]) :
|
95
|
+
(maxDate ? $.datepick.errorFormat(messages.validateDateMax, [maxDate]) :
|
96
|
+
messages.validateDate)));
|
97
|
+
});
|
98
|
+
|
99
|
+
/* Apply a validation test to each date provided.
|
100
|
+
@param value (string) the current field value
|
101
|
+
@param element (element) the field control
|
102
|
+
@return (boolean) true if OK, false if failed validation */
|
103
|
+
function validateEach(value, element) {
|
104
|
+
var inst = $.data(element, $.datepick.propertyName);
|
105
|
+
var dates = (inst.options.multiSelect ? value.split(inst.options.multiSeparator) :
|
106
|
+
(inst.options.rangeSelect ? value.split(inst.options.rangeSeparator) : [value]));
|
107
|
+
var ok = (inst.options.multiSelect && dates.length <= inst.options.multiSelect) ||
|
108
|
+
(!inst.options.multiSelect && inst.options.rangeSelect && dates.length == 2) ||
|
109
|
+
(!inst.options.multiSelect && !inst.options.rangeSelect && dates.length == 1);
|
110
|
+
if (ok) {
|
111
|
+
try {
|
112
|
+
var dateFormat = inst.options.dateFormat;
|
113
|
+
var minDate = inst.get('minDate');
|
114
|
+
var maxDate = inst.get('maxDate');
|
115
|
+
var dp = $(element);
|
116
|
+
$.each(dates, function(i, v) {
|
117
|
+
dates[i] = $.datepick.parseDate(dateFormat, v);
|
118
|
+
ok = ok && (!dates[i] || (dp.datepick('isSelectable', dates[i]) &&
|
119
|
+
(!minDate || dates[i].getTime() >= minDate.getTime()) &&
|
120
|
+
(!maxDate || dates[i].getTime() <= maxDate.getTime())));
|
121
|
+
});
|
122
|
+
}
|
123
|
+
catch (e) {
|
124
|
+
ok = false;
|
125
|
+
}
|
126
|
+
}
|
127
|
+
if (ok && inst.options.rangeSelect) {
|
128
|
+
ok = (dates[0].getTime() <= dates[1].getTime());
|
129
|
+
}
|
130
|
+
return ok;
|
131
|
+
}
|
132
|
+
|
133
|
+
/* And allow as a class rule. */
|
134
|
+
$.validator.addClassRules('dpDate', {dpDate: true});
|
135
|
+
|
136
|
+
var comparisons = {equal: 'eq', same: 'eq', notEqual: 'ne', notSame: 'ne',
|
137
|
+
lessThan: 'lt', before: 'lt', greaterThan: 'gt', after: 'gt',
|
138
|
+
notLessThan: 'ge', notBefore: 'ge', notGreaterThan: 'le', notAfter: 'le'};
|
139
|
+
|
140
|
+
/* Cross-validate date fields.
|
141
|
+
params should be an array with [0] comparison type eq/ne/lt/gt/le/ge or synonyms,
|
142
|
+
[1] 'today' or date string or Date or other field selector/element/jQuery OR
|
143
|
+
an object with one attribute with name eq/ne/lt/gt/le/ge or synonyms
|
144
|
+
and value 'today' or date string or Date or other field selector/element/jQuery OR
|
145
|
+
a string with eq/ne/lt/gt/le/ge or synonyms followed by 'today' or date string or jQuery selector */
|
146
|
+
$.validator.addMethod('dpCompareDate', function(value, element, params) {
|
147
|
+
if (this.optional(element)) {
|
148
|
+
return true;
|
149
|
+
}
|
150
|
+
params = normaliseParams(params);
|
151
|
+
var thisDate = $(element).datepick('getDate');
|
152
|
+
var thatDate = extractOtherDate(element, params[1]);
|
153
|
+
if (thisDate.length == 0 || thatDate.length == 0) {
|
154
|
+
return true;
|
155
|
+
}
|
156
|
+
lastElement = element;
|
157
|
+
var finalResult = true;
|
158
|
+
for (var i = 0; i < thisDate.length; i++) {
|
159
|
+
switch (comparisons[params[0]] || params[0]) {
|
160
|
+
case 'eq': finalResult = (thisDate[i].getTime() == thatDate[0].getTime()); break;
|
161
|
+
case 'ne': finalResult = (thisDate[i].getTime() != thatDate[0].getTime()); break;
|
162
|
+
case 'lt': finalResult = (thisDate[i].getTime() < thatDate[0].getTime()); break;
|
163
|
+
case 'gt': finalResult = (thisDate[i].getTime() > thatDate[0].getTime()); break;
|
164
|
+
case 'le': finalResult = (thisDate[i].getTime() <= thatDate[0].getTime()); break;
|
165
|
+
case 'ge': finalResult = (thisDate[i].getTime() >= thatDate[0].getTime()); break;
|
166
|
+
default: finalResult = true;
|
167
|
+
}
|
168
|
+
if (!finalResult) {
|
169
|
+
break;
|
170
|
+
}
|
171
|
+
}
|
172
|
+
return finalResult;
|
173
|
+
},
|
174
|
+
function(params) {
|
175
|
+
var messages = $.datepick._defaults;
|
176
|
+
var inst = $.data(lastElement, $.datepick.propertyName);
|
177
|
+
params = normaliseParams(params);
|
178
|
+
var thatDate = extractOtherDate(lastElement, params[1], true);
|
179
|
+
thatDate = (params[1] == 'today' ? messages.validateDateToday : (thatDate.length ?
|
180
|
+
$.datepick.formatDate(inst.options.dateFormat, thatDate[0], inst.getConfig()) :
|
181
|
+
messages.validateDateOther));
|
182
|
+
return messages.validateDateCompare.replace(/\{0\}/,
|
183
|
+
messages['validateDate' + (comparisons[params[0]] || params[0]).toUpperCase()]).
|
184
|
+
replace(/\{1\}/, thatDate);
|
185
|
+
});
|
186
|
+
|
187
|
+
/* Normalise the comparison parameters to an array.
|
188
|
+
@param params (array or object or string) the original parameters
|
189
|
+
@return (array) the normalised parameters */
|
190
|
+
function normaliseParams(params) {
|
191
|
+
if (typeof params == 'string') {
|
192
|
+
params = params.split(' ');
|
193
|
+
}
|
194
|
+
else if (!$.isArray(params)) {
|
195
|
+
var opts = [];
|
196
|
+
for (var name in params) {
|
197
|
+
opts[0] = name;
|
198
|
+
opts[1] = params[name];
|
199
|
+
}
|
200
|
+
params = opts;
|
201
|
+
}
|
202
|
+
return params;
|
203
|
+
}
|
204
|
+
|
205
|
+
/* Determine the comparison date.
|
206
|
+
@param element (element) the current datepicker element
|
207
|
+
@param source (string or Date or jQuery or element) the source of the other date
|
208
|
+
@param noOther (boolean) true to not get the date from another field
|
209
|
+
@return (Date[1]) the date for comparison */
|
210
|
+
function extractOtherDate(element, source, noOther) {
|
211
|
+
if (source.constructor == Date) {
|
212
|
+
return [source];
|
213
|
+
}
|
214
|
+
var inst = $.data(element, $.datepick.propertyName);
|
215
|
+
var thatDate = null;
|
216
|
+
try {
|
217
|
+
if (typeof source == 'string' && source != 'today') {
|
218
|
+
thatDate = $.datepick.parseDate(inst.options.dateFormat, source, inst.getConfig());
|
219
|
+
}
|
220
|
+
}
|
221
|
+
catch (e) {
|
222
|
+
// Ignore
|
223
|
+
}
|
224
|
+
thatDate = (thatDate ? [thatDate] : (source == 'today' ?
|
225
|
+
[$.datepick.today()] : (noOther ? [] : $(source).datepick('getDate'))));
|
226
|
+
return thatDate;
|
227
|
+
}
|
228
|
+
}
|
229
|
+
|
230
|
+
})(jQuery);
|
@@ -0,0 +1,8 @@
|
|
1
|
+
/* http://keith-wood.name/datepick.html
|
2
|
+
Datepicker Validation extension for jQuery 4.1.0.
|
3
|
+
Requires J�rn Zaefferer's Validation plugin (http://plugins.jquery.com/project/validate).
|
4
|
+
Written by Keith Wood (kbwood{at}iinet.com.au).
|
5
|
+
Dual licensed under the GPL (http://dev.jquery.com/browser/trunk/jquery/GPL-LICENSE.txt) and
|
6
|
+
MIT (http://dev.jquery.com/browser/trunk/jquery/MIT-LICENSE.txt) licenses.
|
7
|
+
Please attribute the author if you use it. */
|
8
|
+
(function($){if($.fn.validate){$.datepick.selectDateOrig=$.datepick.selectDate;$.extend($.datepick.regional[''],{validateDate:'Please enter a valid date',validateDateMin:'Please enter a date on or after {0}',validateDateMax:'Please enter a date on or before {0}',validateDateMinMax:'Please enter a date between {0} and {1}',validateDateCompare:'Please enter a date {0} {1}',validateDateToday:'today',validateDateOther:'the other date',validateDateEQ:'equal to',validateDateNE:'not equal to',validateDateLT:'before',validateDateGT:'after',validateDateLE:'not after',validateDateGE:'not before'});$.extend($.datepick._defaults,$.datepick.regional['']);$.extend($.datepick,{selectDate:function(a,b){this.selectDateOrig(a,b);var c=$.data(a,$.datepick.propertyName);if(!c.inline&&$.fn.validate){var d=$(a).parents('form').validate();if(d){d.element('#'+a.id)}}},errorPlacement:function(a,b){var c=$.data(b[0],$.datepick.propertyName);if(c){a[c.options.isRTL?'insertBefore':'insertAfter'](c.trigger.length>0?c.trigger:b)}else{a.insertAfter(b)}},errorFormat:function(c,d){var e=($.datepick.curInst?$.datepick.curInst.options.dateFormat:$.datepick._defaults.dateFormat);$.each(d,function(a,b){c=c.replace(new RegExp('\\{'+a+'\\}','g'),$.datepick.formatDate(e,b)||'nothing')});return c}});var l=null;$.validator.addMethod('dpDate',function(a,b){l=b;return this.optional(b)||validateEach(a,b)},function(a){var b=$.data(l,$.datepick.propertyName);var c=b.get('minDate');var d=b.get('maxDate');var e=$.datepick._defaults;return(c&&d?$.datepick.errorFormat(e.validateDateMinMax,[c,d]):(c?$.datepick.errorFormat(e.validateDateMin,[c]):(d?$.datepick.errorFormat(e.validateDateMax,[d]):e.validateDate)))});function validateEach(a,b){var c=$.data(b,$.datepick.propertyName);var d=(c.options.multiSelect?a.split(c.options.multiSeparator):(c.options.rangeSelect?a.split(c.options.rangeSeparator):[a]));var f=(c.options.multiSelect&&d.length<=c.options.multiSelect)||(!c.options.multiSelect&&c.options.rangeSelect&&d.length==2)||(!c.options.multiSelect&&!c.options.rangeSelect&&d.length==1);if(f){try{var g=c.options.dateFormat;var h=c.get('minDate');var j=c.get('maxDate');var k=$(b);$.each(d,function(i,v){d[i]=$.datepick.parseDate(g,v);f=f&&(!d[i]||(k.datepick('isSelectable',d[i])&&(!h||d[i].getTime()>=h.getTime())&&(!j||d[i].getTime()<=j.getTime())))})}catch(e){f=false}}if(f&&c.options.rangeSelect){f=(d[0].getTime()<=d[1].getTime())}return f}$.validator.addClassRules('dpDate',{dpDate:true});var m={equal:'eq',same:'eq',notEqual:'ne',notSame:'ne',lessThan:'lt',before:'lt',greaterThan:'gt',after:'gt',notLessThan:'ge',notBefore:'ge',notGreaterThan:'le',notAfter:'le'};$.validator.addMethod('dpCompareDate',function(a,b,c){if(this.optional(b)){return true}c=normaliseParams(c);var d=$(b).datepick('getDate');var e=extractOtherDate(b,c[1]);if(d.length==0||e.length==0){return true}l=b;var f=true;for(var i=0;i<d.length;i++){switch(m[c[0]]||c[0]){case'eq':f=(d[i].getTime()==e[0].getTime());break;case'ne':f=(d[i].getTime()!=e[0].getTime());break;case'lt':f=(d[i].getTime()<e[0].getTime());break;case'gt':f=(d[i].getTime()>e[0].getTime());break;case'le':f=(d[i].getTime()<=e[0].getTime());break;case'ge':f=(d[i].getTime()>=e[0].getTime());break;default:f=true}if(!f){break}}return f},function(a){var b=$.datepick._defaults;var c=$.data(l,$.datepick.propertyName);a=normaliseParams(a);var d=extractOtherDate(l,a[1],true);d=(a[1]=='today'?b.validateDateToday:(d.length?$.datepick.formatDate(c.options.dateFormat,d[0],c.getConfig()):b.validateDateOther));return b.validateDateCompare.replace(/\{0\}/,b['validateDate'+(m[a[0]]||a[0]).toUpperCase()]).replace(/\{1\}/,d)});function normaliseParams(a){if(typeof a=='string'){a=a.split(' ')}else if(!$.isArray(a)){var b=[];for(var c in a){b[0]=c;b[1]=a[c]}a=b}return a}function extractOtherDate(a,b,c){if(b.constructor==Date){return[b]}var d=$.data(a,$.datepick.propertyName);var f=null;try{if(typeof b=='string'&&b!='today'){f=$.datepick.parseDate(d.options.dateFormat,b,d.getConfig())}}catch(e){}f=(f?[f]:(b=='today'?[$.datepick.today()]:(c?[]:$(b).datepick('getDate'))));return f}}})(jQuery);
|
@@ -0,0 +1,208 @@
|
|
1
|
+
/* Flora style sheet for jQuery Datepicker v4.1.0. */
|
2
|
+
.datepick {
|
3
|
+
background-color: #e0f4d7;
|
4
|
+
color: #000;
|
5
|
+
border: 1px solid #f90;
|
6
|
+
border-radius: 0.25em;
|
7
|
+
-moz-border-radius: 0.25em;
|
8
|
+
-webkit-border-radius: 0.25em;
|
9
|
+
font-family: Arial,Helvetica,Sans-serif;
|
10
|
+
font-size: 90%;
|
11
|
+
}
|
12
|
+
.datepick-rtl {
|
13
|
+
direction: rtl;
|
14
|
+
}
|
15
|
+
.datepick-popup {
|
16
|
+
z-index: 1000;
|
17
|
+
}
|
18
|
+
.datepick-disable {
|
19
|
+
position: absolute;
|
20
|
+
z-index: 100;
|
21
|
+
background-color: white;
|
22
|
+
opacity: 0.5;
|
23
|
+
filter: alpha(opacity=50);
|
24
|
+
}
|
25
|
+
.datepick a {
|
26
|
+
color: #000;
|
27
|
+
text-decoration: none;
|
28
|
+
}
|
29
|
+
.datepick a.datepick-disabled {
|
30
|
+
color: #888;
|
31
|
+
cursor: auto;
|
32
|
+
}
|
33
|
+
.datepick button {
|
34
|
+
margin: 0.25em;
|
35
|
+
padding: 0.125em 0em;
|
36
|
+
background-color: #fc8;
|
37
|
+
border: none;
|
38
|
+
border-radius: 0.25em;
|
39
|
+
-moz-border-radius: 0.25em;
|
40
|
+
-webkit-border-radius: 0.25em;
|
41
|
+
font-weight: bold;
|
42
|
+
}
|
43
|
+
.datepick-nav, .datepick-ctrl {
|
44
|
+
float: left;
|
45
|
+
width: 100%;
|
46
|
+
background-color: #e0f4d7;
|
47
|
+
color: #fff;
|
48
|
+
font-size: 90%;
|
49
|
+
font-weight: bold;
|
50
|
+
}
|
51
|
+
.datepick-ctrl {
|
52
|
+
background-color: #f90;
|
53
|
+
}
|
54
|
+
.datepick-cmd {
|
55
|
+
width: 30%;
|
56
|
+
}
|
57
|
+
.datepick-cmd:hover {
|
58
|
+
background-color: #b1db87;
|
59
|
+
}
|
60
|
+
.datepick-ctrl .datepick-cmd:hover {
|
61
|
+
background-color: #fa4;
|
62
|
+
}
|
63
|
+
.datepick-cmd-prevJump, .datepick-cmd-nextJump {
|
64
|
+
width: 8%;
|
65
|
+
}
|
66
|
+
a.datepick-cmd {
|
67
|
+
height: 1.5em;
|
68
|
+
}
|
69
|
+
button.datepick-cmd {
|
70
|
+
text-align: center;
|
71
|
+
}
|
72
|
+
.datepick-cmd-prev, .datepick-cmd-prevJump, .datepick-cmd-clear {
|
73
|
+
float: left;
|
74
|
+
padding-left: 2%;
|
75
|
+
}
|
76
|
+
.datepick-cmd-current, .datepick-cmd-today {
|
77
|
+
float: left;
|
78
|
+
width: 35%;
|
79
|
+
text-align: center;
|
80
|
+
}
|
81
|
+
.datepick-cmd-next, .datepick-cmd-nextJump, .datepick-cmd-close {
|
82
|
+
float: right;
|
83
|
+
padding-right: 2%;
|
84
|
+
text-align: right;
|
85
|
+
}
|
86
|
+
.datepick-rtl .datepick-cmd-prev, .datepick-rtl .datepick-cmd-prevJump,
|
87
|
+
.datepick-rtl .datepick-cmd-clear {
|
88
|
+
float: right;
|
89
|
+
padding-left: 0%;
|
90
|
+
padding-right: 2%;
|
91
|
+
text-align: right;
|
92
|
+
}
|
93
|
+
.datepick-rtl .datepick-cmd-current, .datepick-rtl .datepick-cmd-today {
|
94
|
+
float: right;
|
95
|
+
}
|
96
|
+
.datepick-rtl .datepick-cmd-next, .datepick-rtl .datepick-cmd-nextJump,
|
97
|
+
.datepick-rtl .datepick-cmd-close {
|
98
|
+
float: left;
|
99
|
+
padding-left: 2%;
|
100
|
+
padding-right: 0%;
|
101
|
+
text-align: left;
|
102
|
+
}
|
103
|
+
.datepick-month-nav {
|
104
|
+
float: left;
|
105
|
+
background-color: #b1db87;
|
106
|
+
text-align: center;
|
107
|
+
}
|
108
|
+
.datepick-month-nav div {
|
109
|
+
float: left;
|
110
|
+
width: 12.5%;
|
111
|
+
margin: 1%;
|
112
|
+
padding: 1%;
|
113
|
+
}
|
114
|
+
.datepick-month-nav span {
|
115
|
+
color: #888;
|
116
|
+
}
|
117
|
+
.datepick-month-row {
|
118
|
+
clear: left;
|
119
|
+
}
|
120
|
+
.datepick-month {
|
121
|
+
float: left;
|
122
|
+
width: 15em;
|
123
|
+
border: 1px solid #83c948;
|
124
|
+
text-align: center;
|
125
|
+
}
|
126
|
+
.datepick-month-header, .datepick-month-header select, .datepick-month-header input {
|
127
|
+
height: 1.5em;
|
128
|
+
background-color: #83c948;
|
129
|
+
color: #fff;
|
130
|
+
font-weight: bold;
|
131
|
+
}
|
132
|
+
.datepick-month-header select, .datepick-month-header input {
|
133
|
+
height: 1.4em;
|
134
|
+
border: none;
|
135
|
+
}
|
136
|
+
.datepick-month-header input {
|
137
|
+
position: absolute;
|
138
|
+
display: none;
|
139
|
+
}
|
140
|
+
.datepick-month table {
|
141
|
+
width: 100%;
|
142
|
+
border-collapse: collapse;
|
143
|
+
}
|
144
|
+
.datepick-month thead {
|
145
|
+
border-bottom: 1px solid #aaa;
|
146
|
+
}
|
147
|
+
.datepick-month th, .datepick-month td {
|
148
|
+
margin: 0em;
|
149
|
+
padding: 0em;
|
150
|
+
font-weight: normal;
|
151
|
+
text-align: center;
|
152
|
+
}
|
153
|
+
.datepick-month th {
|
154
|
+
border: 1px solid #b1db87;
|
155
|
+
}
|
156
|
+
.datepick-month th, .datepick-month th a {
|
157
|
+
background-color: #b1db87;
|
158
|
+
color: #000;
|
159
|
+
border: 1px solid #b1db87;
|
160
|
+
}
|
161
|
+
.datepick-month td {
|
162
|
+
background-color: #fff;
|
163
|
+
color: #666;
|
164
|
+
border: 1px solid #b1db87;
|
165
|
+
}
|
166
|
+
.datepick-month td.datepick-week * {
|
167
|
+
background-color: #b1db87;
|
168
|
+
color: #666;
|
169
|
+
border: none;
|
170
|
+
}
|
171
|
+
.datepick-month a {
|
172
|
+
display: block;
|
173
|
+
width: 100%;
|
174
|
+
padding: 0.125em 0em;
|
175
|
+
text-decoration: none;
|
176
|
+
}
|
177
|
+
.datepick-month span {
|
178
|
+
display: block;
|
179
|
+
width: 100%;
|
180
|
+
padding: 0.125em 0em;
|
181
|
+
}
|
182
|
+
.datepick-month td span {
|
183
|
+
color: #888;
|
184
|
+
}
|
185
|
+
.datepick-month td .datepick-other-month {
|
186
|
+
background-color: #e0f4d7;
|
187
|
+
}
|
188
|
+
.datepick-month td .datepick-weekend {
|
189
|
+
background-color: #e0f4d7;
|
190
|
+
}
|
191
|
+
.datepick-month td .datepick-today {
|
192
|
+
background-color: #b1db87;
|
193
|
+
}
|
194
|
+
.datepick-month td .datepick-highlight {
|
195
|
+
background-color: #fc8;
|
196
|
+
}
|
197
|
+
.datepick-month td .datepick-selected {
|
198
|
+
background-color: #f90;
|
199
|
+
color: #fff;
|
200
|
+
}
|
201
|
+
.datepick-status {
|
202
|
+
clear: both;
|
203
|
+
background-color: #b1db87;
|
204
|
+
text-align: center;
|
205
|
+
}
|
206
|
+
.datepick-clear-fix {
|
207
|
+
clear: both;
|
208
|
+
}
|
@@ -0,0 +1,197 @@
|
|
1
|
+
/* Humanity style sheet for jQuery Datepicker v4.1.0. */
|
2
|
+
.datepick {
|
3
|
+
background-color: #f4f0ec;
|
4
|
+
color: #1e1b1c;
|
5
|
+
border: 1px solid #cb842e;
|
6
|
+
border-radius: 0.25em;
|
7
|
+
-moz-border-radius: 0.25em;
|
8
|
+
-webkit-border-radius: 0.25em;
|
9
|
+
font-family: Arial,Helvetica,Sans-serif;
|
10
|
+
font-size: 90%;
|
11
|
+
}
|
12
|
+
.datepick-rtl {
|
13
|
+
direction: rtl;
|
14
|
+
}
|
15
|
+
.datepick-popup {
|
16
|
+
z-index: 1000;
|
17
|
+
}
|
18
|
+
.datepick-disable {
|
19
|
+
position: absolute;
|
20
|
+
z-index: 100;
|
21
|
+
background-color: white;
|
22
|
+
opacity: 0.5;
|
23
|
+
filter: alpha(opacity=50);
|
24
|
+
}
|
25
|
+
.datepick a {
|
26
|
+
color: #1e1b1c;
|
27
|
+
text-decoration: none;
|
28
|
+
}
|
29
|
+
.datepick a.datepick-disabled {
|
30
|
+
color: #888;
|
31
|
+
cursor: auto;
|
32
|
+
}
|
33
|
+
.datepick button {
|
34
|
+
margin: 0.25em;
|
35
|
+
padding: 0.125em 0em;
|
36
|
+
background-color: #ede4d4;
|
37
|
+
border: none;
|
38
|
+
border-radius: 0.25em;
|
39
|
+
-moz-border-radius: 0.25em;
|
40
|
+
-webkit-border-radius: 0.25em;
|
41
|
+
font-weight: bold;
|
42
|
+
}
|
43
|
+
.datepick-nav, .datepick-ctrl {
|
44
|
+
float: left;
|
45
|
+
width: 100%;
|
46
|
+
background-color: #ede4d4;
|
47
|
+
font-size: 90%;
|
48
|
+
font-weight: bold;
|
49
|
+
}
|
50
|
+
.datepick-ctrl {
|
51
|
+
background-color: #cb842e;
|
52
|
+
}
|
53
|
+
.datepick-cmd {
|
54
|
+
width: 30%;
|
55
|
+
}
|
56
|
+
.datepick-cmd:hover {
|
57
|
+
background-color: #f4f0ec;
|
58
|
+
}
|
59
|
+
.datepick-cmd-prevJump, .datepick-cmd-nextJump {
|
60
|
+
width: 8%;
|
61
|
+
}
|
62
|
+
a.datepick-cmd {
|
63
|
+
height: 1.5em;
|
64
|
+
}
|
65
|
+
button.datepick-cmd {
|
66
|
+
text-align: center;
|
67
|
+
}
|
68
|
+
.datepick-cmd-prev, .datepick-cmd-prevJump, .datepick-cmd-clear {
|
69
|
+
float: left;
|
70
|
+
padding-left: 2%;
|
71
|
+
}
|
72
|
+
.datepick-cmd-current, .datepick-cmd-today {
|
73
|
+
float: left;
|
74
|
+
width: 35%;
|
75
|
+
text-align: center;
|
76
|
+
}
|
77
|
+
.datepick-cmd-next, .datepick-cmd-nextJump, .datepick-cmd-close {
|
78
|
+
float: right;
|
79
|
+
padding-right: 2%;
|
80
|
+
text-align: right;
|
81
|
+
}
|
82
|
+
.datepick-rtl .datepick-cmd-prev, .datepick-rtl .datepick-cmd-prevJump,
|
83
|
+
.datepick-rtl .datepick-cmd-clear {
|
84
|
+
float: right;
|
85
|
+
padding-left: 0%;
|
86
|
+
padding-right: 2%;
|
87
|
+
text-align: right;
|
88
|
+
}
|
89
|
+
.datepick-rtl .datepick-cmd-current, .datepick-rtl .datepick-cmd-today {
|
90
|
+
float: right;
|
91
|
+
}
|
92
|
+
.datepick-rtl .datepick-cmd-next, .datepick-rtl .datepick-cmd-nextJump,
|
93
|
+
.datepick-rtl .datepick-cmd-close {
|
94
|
+
float: left;
|
95
|
+
padding-left: 2%;
|
96
|
+
padding-right: 0%;
|
97
|
+
text-align: left;
|
98
|
+
}
|
99
|
+
.datepick-month-nav {
|
100
|
+
float: left;
|
101
|
+
text-align: center;
|
102
|
+
}
|
103
|
+
.datepick-month-nav div {
|
104
|
+
float: left;
|
105
|
+
width: 12.5%;
|
106
|
+
margin: 1%;
|
107
|
+
padding: 1%;
|
108
|
+
}
|
109
|
+
.datepick-month-nav span {
|
110
|
+
color: #888;
|
111
|
+
}
|
112
|
+
.datepick-month-row {
|
113
|
+
clear: left;
|
114
|
+
}
|
115
|
+
.datepick-month {
|
116
|
+
float: left;
|
117
|
+
width: 17em;
|
118
|
+
border: 1px solid #e0cfc2;
|
119
|
+
text-align: center;
|
120
|
+
}
|
121
|
+
.datepick-month-header, .datepick-month-header select, .datepick-month-header input {
|
122
|
+
height: 1.5em;
|
123
|
+
background-color: #cb842e;
|
124
|
+
color: #fff;
|
125
|
+
font-weight: bold;
|
126
|
+
}
|
127
|
+
.datepick-month-header select, .datepick-month-header input {
|
128
|
+
height: 1.4em;
|
129
|
+
border: none;
|
130
|
+
}
|
131
|
+
.datepick-month-header input {
|
132
|
+
position: absolute;
|
133
|
+
display: none;
|
134
|
+
}
|
135
|
+
.datepick-month table {
|
136
|
+
width: 100%;
|
137
|
+
border: 2px solid transparent;
|
138
|
+
border-collapse: collapse;
|
139
|
+
}
|
140
|
+
.datepick-month th, .datepick-month td {
|
141
|
+
margin: 0em;
|
142
|
+
padding: 0.125em;
|
143
|
+
font-weight: normal;
|
144
|
+
text-align: center;
|
145
|
+
}
|
146
|
+
.datepick-month td.datepick-week,
|
147
|
+
.datepick-month td.datepick-week * {
|
148
|
+
background-color: #cb842e;
|
149
|
+
color: #fff;
|
150
|
+
border: 1px solid #cb842e;
|
151
|
+
}
|
152
|
+
.datepick-month a {
|
153
|
+
display: block;
|
154
|
+
width: 100%;
|
155
|
+
padding: 0.125em 0em;
|
156
|
+
background-color: #ede4d4;
|
157
|
+
color: #000;
|
158
|
+
border: 1px solid #cdc3b7;
|
159
|
+
text-decoration: none;
|
160
|
+
}
|
161
|
+
.datepick-month a, .datepick-month span {
|
162
|
+
display: block;
|
163
|
+
margin-top: 0.25em;
|
164
|
+
}
|
165
|
+
.datepick-month a {
|
166
|
+
background-color: #ede4d4;
|
167
|
+
color: #444;
|
168
|
+
border: 1px solid #cdc3b7;
|
169
|
+
text-decoration: none;
|
170
|
+
}
|
171
|
+
.datepick-month td span {
|
172
|
+
color: #888;
|
173
|
+
}
|
174
|
+
.datepick-month td .datepick-other-month {
|
175
|
+
background-color: #f4f0ec;
|
176
|
+
}
|
177
|
+
.datepick-month td .datepick-today {
|
178
|
+
background-color: #f5f5b5;
|
179
|
+
border: 1px solid #d9bb73;
|
180
|
+
}
|
181
|
+
.datepick-month td .datepick-highlight {
|
182
|
+
background-color: #f5f0e5;
|
183
|
+
color: #1e1b1c;
|
184
|
+
border: 1px solid #f5ad66;
|
185
|
+
}
|
186
|
+
.datepick-month td .datepick-selected {
|
187
|
+
background-color: #cb842e;
|
188
|
+
color: #fff;
|
189
|
+
border: 1px solid #cb842e;
|
190
|
+
}
|
191
|
+
.datepick-status {
|
192
|
+
clear: both;
|
193
|
+
text-align: center;
|
194
|
+
}
|
195
|
+
.datepick-clear-fix {
|
196
|
+
clear: both;
|
197
|
+
}
|