JS File For Date format : ps
This commit is contained in:
parent
591071ec5d
commit
430665be27
@ -57,13 +57,14 @@ File: Form pickers init js
|
|||||||
|
|
||||||
//Date range picker
|
//Date range picker
|
||||||
$('.input-daterange-datepicker').daterangepicker({
|
$('.input-daterange-datepicker').daterangepicker({
|
||||||
|
format: 'DD/MM/YYYY',
|
||||||
buttonClasses: ['btn', 'btn-sm'],
|
buttonClasses: ['btn', 'btn-sm'],
|
||||||
applyClass: 'btn-secondary',
|
applyClass: 'btn-secondary',
|
||||||
cancelClass: 'btn-primary'
|
cancelClass: 'btn-primary'
|
||||||
});
|
});
|
||||||
$('.input-daterange-timepicker').daterangepicker({
|
$('.input-daterange-timepicker').daterangepicker({
|
||||||
timePicker: true,
|
timePicker: true,
|
||||||
format: 'MM/DD/YYYY h:mm A',
|
format: 'DD/MM/YYYY h:mm A',
|
||||||
timePickerIncrement: 30,
|
timePickerIncrement: 30,
|
||||||
timePicker12Hour: true,
|
timePicker12Hour: true,
|
||||||
timePickerSeconds: false,
|
timePickerSeconds: false,
|
||||||
@ -72,9 +73,9 @@ File: Form pickers init js
|
|||||||
cancelClass: 'btn-primary'
|
cancelClass: 'btn-primary'
|
||||||
});
|
});
|
||||||
$('.input-limit-datepicker').daterangepicker({
|
$('.input-limit-datepicker').daterangepicker({
|
||||||
format: 'MM/DD/YYYY',
|
format: 'DD/MM/YYYY',
|
||||||
minDate: '06/01/2020',
|
minDate: '01/06/2020',
|
||||||
maxDate: '06/30/2020',
|
maxDate: '30/06/2020',
|
||||||
buttonClasses: ['btn', 'btn-sm'],
|
buttonClasses: ['btn', 'btn-sm'],
|
||||||
applyClass: 'btn-secondary',
|
applyClass: 'btn-secondary',
|
||||||
cancelClass: 'btn-primary',
|
cancelClass: 'btn-primary',
|
||||||
@ -86,11 +87,11 @@ File: Form pickers init js
|
|||||||
$('#reportrange span').html(moment().subtract(29, 'days').format('MMMM D, YYYY') + ' - ' + moment().format('MMMM D, YYYY'));
|
$('#reportrange span').html(moment().subtract(29, 'days').format('MMMM D, YYYY') + ' - ' + moment().format('MMMM D, YYYY'));
|
||||||
|
|
||||||
$('#reportrange').daterangepicker({
|
$('#reportrange').daterangepicker({
|
||||||
format: 'MM/DD/YYYY',
|
format: 'DD/MM/YYYY',
|
||||||
startDate: moment().subtract(29, 'days'),
|
startDate: moment().subtract(29, 'days'),
|
||||||
endDate: moment(),
|
endDate: moment(),
|
||||||
minDate: '01/01/2020',
|
minDate: '01/01/2020',
|
||||||
maxDate: '12/31/2020',
|
maxDate: '31/12/2020',
|
||||||
dateLimit: {
|
dateLimit: {
|
||||||
days: 60
|
days: 60
|
||||||
},
|
},
|
||||||
|
|||||||
@ -664,11 +664,11 @@
|
|||||||
calendar[row][col] = curDate.clone().hour(hour).minute(minute).second(second);
|
calendar[row][col] = curDate.clone().hour(hour).minute(minute).second(second);
|
||||||
curDate.hour(12);
|
curDate.hour(12);
|
||||||
|
|
||||||
if (this.minDate && calendar[row][col].format('YYYY-MM-DD') == this.minDate.format('YYYY-MM-DD') && calendar[row][col].isBefore(this.minDate) && side == 'left') {
|
if (this.minDate && calendar[row][col].format('DD/MM/YYYY') == this.minDate.format('DD/MM/YYYY') && calendar[row][col].isBefore(this.minDate) && side == 'left') {
|
||||||
calendar[row][col] = this.minDate.clone();
|
calendar[row][col] = this.minDate.clone();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.maxDate && calendar[row][col].format('YYYY-MM-DD') == this.maxDate.format('YYYY-MM-DD') && calendar[row][col].isAfter(this.maxDate) && side == 'right') {
|
if (this.maxDate && calendar[row][col].format('DD/MM/YYYY') == this.maxDate.format('DD/MM/YYYY') && calendar[row][col].isAfter(this.maxDate) && side == 'right') {
|
||||||
calendar[row][col] = this.maxDate.clone();
|
calendar[row][col] = this.maxDate.clone();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -808,11 +808,11 @@
|
|||||||
classes.push('off', 'disabled');
|
classes.push('off', 'disabled');
|
||||||
|
|
||||||
//highlight the currently selected start date
|
//highlight the currently selected start date
|
||||||
if (calendar[row][col].format('YYYY-MM-DD') == this.startDate.format('YYYY-MM-DD'))
|
if (calendar[row][col].format('DD/MM/YYYY') == this.startDate.format('DD/MM/YYYY'))
|
||||||
classes.push('active', 'start-date');
|
classes.push('active', 'start-date');
|
||||||
|
|
||||||
//highlight the currently selected end date
|
//highlight the currently selected end date
|
||||||
if (this.endDate != null && calendar[row][col].format('YYYY-MM-DD') == this.endDate.format('YYYY-MM-DD'))
|
if (this.endDate != null && calendar[row][col].format('DD/MM/YYYY') == this.endDate.format('DD/MM/YYYY'))
|
||||||
classes.push('active', 'end-date');
|
classes.push('active', 'end-date');
|
||||||
|
|
||||||
//highlight dates in-between the selected dates
|
//highlight dates in-between the selected dates
|
||||||
@ -1370,7 +1370,7 @@
|
|||||||
var i = 0;
|
var i = 0;
|
||||||
for (var range in this.ranges) {
|
for (var range in this.ranges) {
|
||||||
if (this.timePicker) {
|
if (this.timePicker) {
|
||||||
var format = this.timePickerSeconds ? "YYYY-MM-DD HH:mm:ss" : "YYYY-MM-DD HH:mm";
|
var format = this.timePickerSeconds ? "DD/MM/YYYY HH:mm:ss" : "DD/MM/YYYY HH:mm";
|
||||||
//ignore times when comparing dates if time picker seconds is not enabled
|
//ignore times when comparing dates if time picker seconds is not enabled
|
||||||
if (this.startDate.format(format) == this.ranges[range][0].format(format) && this.endDate.format(format) == this.ranges[range][1].format(format)) {
|
if (this.startDate.format(format) == this.ranges[range][0].format(format) && this.endDate.format(format) == this.ranges[range][1].format(format)) {
|
||||||
customRange = false;
|
customRange = false;
|
||||||
@ -1379,7 +1379,7 @@
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
//ignore times when comparing dates if time picker is not enabled
|
//ignore times when comparing dates if time picker is not enabled
|
||||||
if (this.startDate.format('YYYY-MM-DD') == this.ranges[range][0].format('YYYY-MM-DD') && this.endDate.format('YYYY-MM-DD') == this.ranges[range][1].format('YYYY-MM-DD')) {
|
if (this.startDate.format('DD/MM/YYYY') == this.ranges[range][0].format('DD/MM/YYYY') && this.endDate.format('DD/MM/YYYY') == this.ranges[range][1].format('DD/MM/YYYY')) {
|
||||||
customRange = false;
|
customRange = false;
|
||||||
this.chosenLabel = this.container.find('.ranges li:eq(' + i + ')').addClass('active').attr('data-range-key');
|
this.chosenLabel = this.container.find('.ranges li:eq(' + i + ')').addClass('active').attr('data-range-key');
|
||||||
break;
|
break;
|
||||||
@ -1479,7 +1479,7 @@
|
|||||||
this.setStartDate(start);
|
this.setStartDate(start);
|
||||||
if (this.singleDatePicker) {
|
if (this.singleDatePicker) {
|
||||||
this.endDate = this.startDate.clone();
|
this.endDate = this.startDate.clone();
|
||||||
} else if (this.endDate && this.endDate.format('YYYY-MM-DD') == start.format('YYYY-MM-DD') && this.endDate.isBefore(start)) {
|
} else if (this.endDate && this.endDate.format('DD/MM/YYYY') == start.format('DD/MM/YYYY') && this.endDate.isBefore(start)) {
|
||||||
this.setEndDate(start.clone());
|
this.setEndDate(start.clone());
|
||||||
}
|
}
|
||||||
} else if (this.endDate) {
|
} else if (this.endDate) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user