Commit 1c7ea2790ce7340bb7b5a18dd6c5226a513b815b
Committed by
GitHub
Merge pull request #4473 from SergioCrisostomo/fix-4443
don't use parseDate if we already have date objects
Showing
1 changed file
with
4 additions
and
1 deletions
Show diff stats
src/components/date-picker/util.js
... | ... | @@ -174,7 +174,10 @@ const RANGE_PARSER = function(text, format) { |
174 | 174 | const range1 = array[0]; |
175 | 175 | const range2 = array[1]; |
176 | 176 | |
177 | - return [parseDate(range1, format), parseDate(range2, format)]; | |
177 | + return [ | |
178 | + range1 instanceof Date ? range1 : parseDate(range1, format), | |
179 | + range2 instanceof Date ? range2 : parseDate(range2, format), | |
180 | + ]; | |
178 | 181 | } |
179 | 182 | return []; |
180 | 183 | }; | ... | ... |