Skip to content

Conversation

rdebourbon
Copy link

Added a check to see if the date about to be parsed by Globalize is already a Date, and if so return the current date without parsing (which would likely return null when trying to parse a UTC date with a format pattern of dd/MM/yyyy).

This fixes an issue where if a date is set programatically by either the DatePickerRange or a call to setUTCDate(s) the new value is ignored and the DatePicker resets to the current date.

---------- To Replicate Issue -----------

  1. Setup Globalize with locale like en-GB
  2. Add bootstrap-datepicker.js to scripts
  3. Add bootstrap-datepicker-globalize.js
  4. Add a DatePickerRange to a page.
  5. Try use datepicker - selected dates are ignored and today's date is always selected.

…lready a Date, and if so return the current date without parsing (which would likely return null when trying to parse a UTC date with a format pattern of dd/MM/yyyy).

This fixes an issue where if a date is set programatically by either the DatePickerRange or a call to setUTCDate(s) the new value is ignored and the DatePicker resets to the current date.
@Bodil-X
Copy link

Bodil-X commented Mar 4, 2014

@rdebourbon you are right!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants