Skip to content

Commit

Permalink
Fix #872 date formatter to datepicker
Browse files Browse the repository at this point in the history
  • Loading branch information
jtommy committed Jun 25, 2018
1 parent 0928a91 commit a06eed4
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/components/datepicker/Datepicker.vue
Expand Up @@ -239,10 +239,11 @@
if (typeof config.defaultDateFormatter === 'function') {
return config.defaultDateFormatter(date)
} else {
const dateUTC = new Date(Date.UTC(
date.getFullYear(), date.getMonth(), date.getDate()
))
return dateUTC.toLocaleDateString()
const yyyyMMdd = date.getFullYear() +
'/' + (date.getMonth() + 1) +
'/' + date.getDate()
const d = new Date(yyyyMMdd)
return d.toLocaleDateString()
}
}
},
Expand Down

0 comments on commit a06eed4

Please sign in to comment.