Skip to content

Commit

Permalink
feat(MdDatepicker): add dateformat (#1436)
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuell1 authored and marcosmoura committed Jan 24, 2018
1 parent 70b3aa2 commit 74aee23
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/MdDatepicker/MdDatepicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,10 @@
dateToHTMLString (date) {
if (date) {
let formattedDate = null
const dateFormat = this.$material.locale.dateFormat || 'YYYY-MM-DD'
try {
formattedDate = format(date, 'YYYY-MM-DD')
formattedDate = format(date, dateFormat)
} catch (error) {
Vue.util.warn(`The datepicker value is not a valid date. Given value: ${date}.`, this)
}
Expand Down

0 comments on commit 74aee23

Please sign in to comment.