From 74aee2349f75dc5fd9262a002b3f5bff18330b1d Mon Sep 17 00:00:00 2001 From: Samuell Date: Wed, 24 Jan 2018 20:00:32 +0100 Subject: [PATCH] feat(MdDatepicker): add dateformat (#1436) --- src/components/MdDatepicker/MdDatepicker.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/MdDatepicker/MdDatepicker.vue b/src/components/MdDatepicker/MdDatepicker.vue index 31c068c3d..13df91381 100644 --- a/src/components/MdDatepicker/MdDatepicker.vue +++ b/src/components/MdDatepicker/MdDatepicker.vue @@ -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) }