6 Replies Latest reply on May 9, 2018 9:25 AM by Jorg Vloet

    Datepicker with time not highlighting the selected date when opening and using the timepicker

    Jorg Vloet

      When I use the datepicker with time it is not selecting the proper date when opening the datepicker. So when I change the time en click on the close button the date also is changed to today.

       

      In the screenshot you can see what I ment, today's date is 20-04-2018, the date in the input is 25-04-2018, only when opening the datepicker the today date is selected, and not the date from the input.

      Snag_3c0e225.png

       

      I have also found the problem in widget.timepicker.js, but no idea where te report the bug and solution

       

      On line 120 and 121 is the following code

      // need to change the dateFormat around this call because the parse method chokes on time format characters
      
      settings.dateFormat = settings.dateFormat.replace(time_regexp, "");
      

       

      the problem is that the settings.dateFormat needs to be trimmed, because in my case there is a space between the date and time

      DD-MM-YYYY HH24:MI

       

      This is the solution

       

      // need to change the dateFormat around this call because the parse method chokes on time format characters
      settings.dateFormat = settings.dateFormat.replace(time_regexp, "").trim();
      

       

      And now when opening the datepicker....

       

      Snag_3c7d215.png