From 430665be27675b730756b3eb4f363b853d423fe3 Mon Sep 17 00:00:00 2001 From: VE10-Sanjeev Date: Tue, 19 Dec 2023 19:40:43 +0530 Subject: [PATCH] JS File For Date format : ps --- public/assets/js/pages/form-pickers.init.js | 13 +++++++------ .../bootstrap-daterangepicker/daterangepicker.js | 14 +++++++------- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/public/assets/js/pages/form-pickers.init.js b/public/assets/js/pages/form-pickers.init.js index 1013353a..9f58af98 100644 --- a/public/assets/js/pages/form-pickers.init.js +++ b/public/assets/js/pages/form-pickers.init.js @@ -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 }, diff --git a/public/assets/libs/bootstrap-daterangepicker/daterangepicker.js b/public/assets/libs/bootstrap-daterangepicker/daterangepicker.js index 4048310c..62aac4a8 100644 --- a/public/assets/libs/bootstrap-daterangepicker/daterangepicker.js +++ b/public/assets/libs/bootstrap-daterangepicker/daterangepicker.js @@ -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) {