-
-
Notifications
You must be signed in to change notification settings - Fork 403
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: Allow to define our own stringify function #229
Comments
try this. import DatePicker form 'vue2-datepicker'
DatePicker.methods.stringify = function(date) {} |
@mengxiong10 Thats' what I do for now, but this is really hackish. A nice prop would be better for that I think :) |
Closed
v2.9.0. <date-picker v-model="value" lang="en" :format="myFormat"></date-picker> data () {
return {
myFormat: {
stringify: (date) => {
return date ? moment(date).format('LL') : null
},
parse: (value) => {
return value ? moment(value, 'LL').toDate() : null
}
}
}
} |
You're awesome!! :D |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello and thanks for your awesome component!
Could it be possible to define our own
stringify
function?Just to change the display but not the data itself. Recent 2.8.0 added a
value2date
function, but it's also used in thehandleValueChange
function and therefore preventing us to use it since it is also completely changing the selected value.Thanks a lot
Cheers
The text was updated successfully, but these errors were encountered: