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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user