2
0
mirror of https://github.com/tenrok/vue2-datepicker.git synced 2026-06-12 09:42:25 +03:00

add customFormatter prop

This commit is contained in:
mxie
2018-04-21 17:34:32 +08:00
parent 2cf26f518f
commit b8c642d51c
+6
View File
@@ -76,6 +76,9 @@ export default {
type: String,
default: 'yyyy-MM-dd'
},
customFormatter: {
type: Function
},
range: {
type: Boolean,
default: false
@@ -334,6 +337,9 @@ export default {
return str
},
stringify (date) {
if (typeof this.customFormatter === 'function') {
return this.customFormatter(new Date(date))
}
return this.formatDate(new Date(date), this.format)
},
isValidDate (date) {