Completed
Last Updated: 13 Sep 2024 12:16 by ADMIN
Release 2024 Q3 (Aug)
Created by: Aleksey
Comments: 1
Category: DateRangePicker
Type: Bug Report
0

Hi,

There might be an issue with the DateRangePicker - when dates are removed manually from inputs (e.g., select, then delete) and something like month/day/year is displayed, incorrect dates are returned when I use API.

var range = daterangepicker.range()

The issue can be reproduced in the DateRangePicker demo page. Steps to reproduce:

  1. Open the page the jQuery DateRangePicker API page.
  2. Click SET VALUE to assign some predefined values. Correct values are displayed in the widget.
  3. Click GET VALUE and correct values are displayed in the popup (alert).
  4. Clear inputs manually in the widget (clear the Start date first, then End date), so both inputs display month/day/year now.
  5. Click GET VALUE again. Now, values are incorrect. Start is null and End displays the previously selected date, not null as expected.
    (If you clear End date first, then End Date would be null, and Start Date would be the previous value.)
    See the attached screenshot.

Is it a bug or I do something wrong? I am using 2024.1.3016. Is it fixed in the latest version? If not - any timeframe when it could be fixed? 

As of now I am using workaround - if an input value contains a letter, the then I assume date = null. Otherwise, I keep the value from range object. Is there a better way to work around the issue?

Thank you.

Regards, 

Aleksey Gasnikov

 

1 2