Date Field Complete

This commit is contained in:
ultimatemember
2014-12-31 20:04:10 +02:00
parent 59431d3703
commit 1f2e7b54dd
12 changed files with 151 additions and 19 deletions
+27 -6
View File
@@ -80,12 +80,33 @@ jQuery(document).ready(function() {
});
/* datepicker */
jQuery('.um-datepicker').pickadate({
min: [1900,1,1],
max: true,
selectYears: 100,
formatSubmit: 'yyyy/mm/dd',
hiddenSuffix: '__true'
jQuery('.um-datepicker').each(function(){
elem = jQuery(this);
if ( elem.attr('data-years_x') == 'past' ) {var max = true;}
if ( elem.attr('data-years_x') == 'equal' ) {var max = false;}
if ( elem.attr('data-years_x') == 'future' ) {var min = true;var max = '';}
if ( elem.attr('data-disabled_weekdays') != '' ) {
var disable = JSON.parse( elem.attr('data-disabled_weekdays') );
} else {
var disable = false;
}
if ( elem.attr('data-range') == 'date_range' ) {
var min = new Date( elem.attr('data-date_min') );
var max = new Date( elem.attr('data-date_max') );
}
elem.pickadate({
selectYears: elem.attr('data-years'),
min: min,
max: max,
disable: disable,
format: elem.attr('data-format'),
formatSubmit: 'yyyy/mm/dd',
hiddenName: true,
});
});
/* timepicker */