Skip to content

Commit

Permalink
fix: fecha.parse invalid return false (#309)
Browse files Browse the repository at this point in the history
  • Loading branch information
mengxiong10 committed May 15, 2019
1 parent 6f28ddd commit 96812ab
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export function formatDate (date, format) {

export function parseDate (value, format) {
try {
return fecha.parse(value, format)
return fecha.parse(value, format) || null
} catch (e) {
return null
}
Expand Down

0 comments on commit 96812ab

Please sign in to comment.