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

fix:(module: date-picker): dd.MM.yyyy date format #1782

Closed
wants to merge 1 commit into from

Conversation

danielszenasi
Copy link
Contributor

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

[x] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Documentation content changes
[ ] Application (the showcase website) / infrastructure changes
[ ] Other... Please describe:

What is the current behavior?

I want to use the date-picker with the following format [nzFormat]="'dd.MM.yyyy'", when I type the picker`s input, the state does not change, because the javascript date creates Wed Mar 07 2018 00:00:00 GMT+0100 (Central European Standard Time) from this string: "03.07.2018", so the day and mounth is not the correct order for the Date object.

Issue Number: N/A

What is the new behavior?

[nzFormat]="'dd.MM.yyyy'" works

Does this PR introduce a breaking change?

[ ] Yes
[x] No

Other information

@codecov
Copy link

codecov bot commented Jul 3, 2018

Codecov Report

Merging #1782 into master will decrease coverage by 1.27%.
The diff coverage is 50%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1782      +/-   ##
==========================================
- Coverage   97.34%   96.07%   -1.28%     
==========================================
  Files         552      466      -86     
  Lines       11587    11174     -413     
  Branches      827     1462     +635     
==========================================
- Hits        11279    10735     -544     
+ Misses        195      126      -69     
- Partials      113      313     +200
Impacted Files Coverage Δ
...te-picker/lib/calendar/calendar-input.component.ts 90.9% <50%> (-5.87%) ⬇️
components/core/util/logger/logger.service.ts 52.17% <0%> (-18.42%) ⬇️
components/date-picker/week-picker.component.ts 75% <0%> (-17.31%) ⬇️
components/card/demo/loading.ts 83.33% <0%> (-16.67%) ⬇️
...ponents/core/services/update-host-class.service.ts 88.88% <0%> (-11.12%) ⬇️
components/core/util/getMentions.ts 50% <0%> (-10%) ⬇️
components/i18n/nz-i18n.service.ts 75.86% <0%> (-8.76%) ⬇️
components/select/nz-option-container.component.ts 91.82% <0%> (-8.18%) ⬇️
components/message/nz-message.component.ts 89.58% <0%> (-8.04%) ⬇️
...ts/time-picker/nz-time-value-accessor.directive.ts 92.59% <0%> (-7.41%) ⬇️
... and 434 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3e0e319...69f9a9d. Read the comment docs.

@vthinkxie vthinkxie requested a review from wilsoncook July 22, 2018 03:54
@vthinkxie
Copy link
Member

Hi @danielszenasi thanks for you pr!
I think there maybe some methods to support more format types including dd/MM/yyyy.

@wilsoncook please check this.

@wilsoncook
Copy link
Member

Hi @danielszenasi , thanks for your efforts.
BTW: We need to finger out a more flexible way to support initialize a date with any format (May needs to implement our own logics as we've removed momentjs).

@danielszenasi
Copy link
Contributor Author

Thanks for your response, i will try to provide a better solution later.

@TheAifam5
Copy link

TheAifam5 commented Mar 23, 2019

I would prefer a interface with date time formatter with two functions:
parseDate
formatDate

So everyone can use what the framework of own choice.

@orlandokj
Copy link

@wilsoncook there is a reason for removing momentjs? I'm thinking about to fix this bug, and the faster way is to use momentjs.

@irishwill2008
Copy link

I am having similar issue, I am trying to implement: <nz-date-picker nzFormat="dd/MM/yyyy"></nz-date-picker> however when i type in "07/07/2019" it does not recognise. Similar to the dd.MM.yyyy issue.

Did anyone find an easy work around or?

@vthinkxie
Copy link
Member

Since there is no reply for a long time, this issue will be closed. Please contact us if you have any questions, thank you for your PR

@vthinkxie vthinkxie closed this Jun 14, 2019
@TheAifam5
Copy link

@irishwill2008 you mean something like that issue: #3491

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.

6 participants