You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Uncaught RangeError: Invalid time value error appears when trying to set a pattern after previously dropping a pattern.
How to reproduce:
On EnhancedDateRangePickerView, test createPatternDatePicker demo or createPatternAndLocaleDatePicker demo.
1 - Select a range.
2 - Set pattern by clicking on "Set pattern from text field" button.
3 - Drop pattern by clicking "Drop Pattern" button.
4- Try to set the pattern again by clicking (again) "Set pattern from text field" button.
Error seems to be on enhancedDateRangePickerConnector.js, on formatDateBasedOnPattern function:
const formatDateBasedOnPattern = function (date, pattern, language) {
let rawDate = new Date(date.year, date.month, date.day);
return DateFns.format(rawDate, pattern, { locale: DateFns.locales[language] });
};
After dropping the pattern, the date parameter has date = {day: NaN, month: NaN, year: NaN} as value, so rawDate returns Invalid Date and the call of DateFns.format breaks.
The text was updated successfully, but these errors were encountered:
Uncaught RangeError: Invalid time value error appears when trying to set a pattern after previously dropping a pattern.
How to reproduce:
On
EnhancedDateRangePickerView
, testcreatePatternDatePicker
demo orcreatePatternAndLocaleDatePicker
demo.1 - Select a range.
2 - Set pattern by clicking on "Set pattern from text field" button.
3 - Drop pattern by clicking "Drop Pattern" button.
4- Try to set the pattern again by clicking (again) "Set pattern from text field" button.
Error seems to be on
enhancedDateRangePickerConnector.js
, onformatDateBasedOnPattern
function:After dropping the pattern, the date parameter has
date = {day: NaN, month: NaN, year: NaN}
as value, sorawDate
returns Invalid Date and the call ofDateFns.format
breaks.The text was updated successfully, but these errors were encountered: