Skip to content
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

feat(MdDatepicker): add dateformat #1430

Closed
wants to merge 1 commit into from

Conversation

Samuell1
Copy link
Member

Resolves #1422

@VdustR
Copy link
Member

VdustR commented Jan 24, 2018

There are some problems with this:

  • This pattern is not satisfied with other date formats like 'DD-MM-YYYY':

    <md-input :type="type" ref="input" v-model="modelDate" @focus.native="onFocus" pattern="[0-9]{4}-[0-9]{2}-[0-9]{2}" />

  • parse will occur error with 'DD-MM-YYYY' format. It will got Invalid Date and occur infinite loop:

    const parsedDate = parse(value)

  • Even <input type="date" /> shown as DD/MM/YYYY or else with some locale, but the value is still YYYY-MM-DD. It's better to control the date with one format and make it shown with custom format. For example: I always got 2018-01-24 from back-end API and only shown as 24/01/2018, I still want to communicate with back-end with format 2018-01-24. It's only show different strings for each end users depended on their locale.

@Samuell1 Samuell1 closed this Jan 24, 2018
@Samuell1 Samuell1 deleted the feat/MdDatepicker/add-dateformat branch January 24, 2018 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants