Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added a check to see if the date about to be parsed is a Date #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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