ElemeFE / ElemeFE/element

[Feature Request] DatePicker: the 'format' attribute should accept function argument

Open
#11,353 6 comments 4 reactions 0 assignees View on GitHub
component: date-picker stale type: feature request
Dominant language
Vue
Stars
54k
Forks
14.4k
PR merge metrics
No merged PRs in 30d

Description

### Existing Component
Yes

### Component Name
DatePicker

### Description
Currently the 'format' attribute (format of the displayed value in the input box) accepts a string argument containing [date formats](http://element.eleme.io/#/en-US/component/date-picker#date-formats):

Those formats only produce numeric date output (01/05/18), and does not allow for month names (01/May/18) or even timezone (01/May/18 PST). I'm assuming you chose this path to avoid i18n issues (although you do offer "AM/PM" output)

Perhaps if the format attribute also accepted a function argument (passing in the Date object) then I could return my own formatted string and not be limited to the date formats that you support.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.