Skip to content

Commit

Permalink
fix: fecha.format need a date
Browse files Browse the repository at this point in the history
  • Loading branch information
mengxiong10 committed Jul 4, 2018
1 parent 07fdcf7 commit 1e54efc
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -272,8 +272,12 @@ export default {
this.displayPopup()
},
stringify (date, format) {
format = format || this.format
return fecha.format(date, format)
try {
format = format || this.format
return fecha.format(new Date(date), format)
} catch (e) {
return ''
}
},
parseDate (value, format) {
try {
Expand Down

0 comments on commit 1e54efc

Please sign in to comment.