Skip to content

Commit 74aee23

Browse files
Samuell1marcosmoura
authored andcommitted
feat(MdDatepicker): add dateformat (#1436)
1 parent 70b3aa2 commit 74aee23

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/components/MdDatepicker/MdDatepicker.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,10 @@
9696
dateToHTMLString (date) {
9797
if (date) {
9898
let formattedDate = null
99+
const dateFormat = this.$material.locale.dateFormat || 'YYYY-MM-DD'
99100
100101
try {
101-
formattedDate = format(date, 'YYYY-MM-DD')
102+
formattedDate = format(date, dateFormat)
102103
} catch (error) {
103104
Vue.util.warn(`The datepicker value is not a valid date. Given value: ${date}.`, this)
104105
}

0 commit comments

Comments
 (0)