-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Closed
Labels
Description
- I have searched the issues of this repository and believe that this is not a duplicate.
What problem does this feature solve?
I'm trying to implement lunar calendar with datepicker, but obviously moment does not support the formatting of lunar calendar dates. It would be great to accept a function to render custom date strings in the input, instead of relying on moment.format().
Example: 2020-05-13 turns into 庚子年(鼠)四月廿一
Please suggest other possible solutions if this proposal is not considered. However, seeing that we could customize date cells with the dateRender option I think it makes sense to also allow more flexibility for the date string format in input.
What does the proposed API look like?
<template>
<a-date-picker
v-model="value"
:format="customFormat"
>
</a-date-picker>
</template>
<script>
export default {
data() {
return {
value: null,
}
},
methods: {
customFormat(value) {
return getLunarDateString(value); // custom implementation to get lunar calendar date
}
}
};
</script>