From d43f99e4105460f86db802ae8938c88beb21e1f9 Mon Sep 17 00:00:00 2001 From: Denis Russkikh Date: Tue, 10 May 2022 01:00:14 +0500 Subject: [PATCH 1/2] Updating selected datetime range when start date is changed --- daterangepicker.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/daterangepicker.js b/daterangepicker.js index 5f7d304b..101f6236 100644 --- a/daterangepicker.js +++ b/daterangepicker.js @@ -475,6 +475,8 @@ this.startDate.minute(Math.floor(this.startDate.minute() / this.timePickerIncrement) * this.timePickerIncrement); } + this.container.find('.drp-selected').html(this.startDate.format(this.locale.format) + this.locale.separator + this.endDate.format(this.locale.format)); + if (!this.isShowing) this.updateElement(); From 675df796b865f4ebcbdaab3c27fc050b57fc2fa5 Mon Sep 17 00:00:00 2001 From: Denis Russkikh Date: Tue, 10 May 2022 01:00:14 +0500 Subject: [PATCH 2/2] Updating selected datetime range when start date is changed --- daterangepicker.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/daterangepicker.js b/daterangepicker.js index 5f7d304b..aca58b8a 100644 --- a/daterangepicker.js +++ b/daterangepicker.js @@ -475,6 +475,8 @@ this.startDate.minute(Math.floor(this.startDate.minute() / this.timePickerIncrement) * this.timePickerIncrement); } + this.container.find('.drp-selected').html(this.startDate.format(this.locale.format) + this.locale.separator + this.endDate.format(this.locale.format)); + if (!this.isShowing) this.updateElement(); @@ -505,7 +507,8 @@ this.previousRightTime = this.endDate.clone(); - this.container.find('.drp-selected').html(this.startDate.format(this.locale.format) + this.locale.separator + this.endDate.format(this.locale.format)); + this.container.find('.drp-selected').html(this.startDate.format(this.locale.format) + this.locale.separator + + this.container.find('.drp-selected').html().split(this.locale.separator)[1]); if (!this.isShowing) this.updateElement();