mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-06-05 15:09:37 +09:00
Date Field Complete
This commit is contained in:
+27
-6
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user