JS File For Date format : ps

This commit is contained in:
VE10-Sanjeev 2023-12-19 19:40:43 +05:30
parent 591071ec5d
commit 430665be27
2 changed files with 14 additions and 13 deletions

View File

@ -57,13 +57,14 @@ File: Form pickers init js
//Date range picker
$('.input-daterange-datepicker').daterangepicker({
format: 'DD/MM/YYYY',
buttonClasses: ['btn', 'btn-sm'],
applyClass: 'btn-secondary',
cancelClass: 'btn-primary'
});
$('.input-daterange-timepicker').daterangepicker({
timePicker: true,
format: 'MM/DD/YYYY h:mm A',
format: 'DD/MM/YYYY h:mm A',
timePickerIncrement: 30,
timePicker12Hour: true,
timePickerSeconds: false,
@ -72,9 +73,9 @@ File: Form pickers init js
cancelClass: 'btn-primary'
});
$('.input-limit-datepicker').daterangepicker({
format: 'MM/DD/YYYY',
minDate: '06/01/2020',
maxDate: '06/30/2020',
format: 'DD/MM/YYYY',
minDate: '01/06/2020',
maxDate: '30/06/2020',
buttonClasses: ['btn', 'btn-sm'],
applyClass: 'btn-secondary',
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').daterangepicker({
format: 'MM/DD/YYYY',
format: 'DD/MM/YYYY',
startDate: moment().subtract(29, 'days'),
endDate: moment(),
minDate: '01/01/2020',
maxDate: '12/31/2020',
maxDate: '31/12/2020',
dateLimit: {
days: 60
},

View File

@ -664,11 +664,11 @@
calendar[row][col] = curDate.clone().hour(hour).minute(minute).second(second);
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();
}
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();
}
@ -808,11 +808,11 @@
classes.push('off', 'disabled');
//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');
//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');
//highlight dates in-between the selected dates
@ -1370,7 +1370,7 @@
var i = 0;
for (var range in this.ranges) {
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
if (this.startDate.format(format) == this.ranges[range][0].format(format) && this.endDate.format(format) == this.ranges[range][1].format(format)) {
customRange = false;
@ -1379,7 +1379,7 @@
}
} else {
//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;
this.chosenLabel = this.container.find('.ranges li:eq(' + i + ')').addClass('active').attr('data-range-key');
break;
@ -1479,7 +1479,7 @@
this.setStartDate(start);
if (this.singleDatePicker) {
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());
}
} else if (this.endDate) {