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

Patterns of DateTime.fromString and DateTime.format are not aligned #2855

Closed
3 tasks done
solomax opened this issue Sep 1, 2023 · 3 comments
Closed
3 tasks done

Patterns of DateTime.fromString and DateTime.format are not aligned #2855

solomax opened this issue Sep 1, 2023 · 3 comments

Comments

@solomax
Copy link

solomax commented Sep 1, 2023

Prerequisites

Describe the issue

DateTime.fromString can handle single y in the pattern https://github.com/Eonasdan/tempus-dominus/blob/master/src/js/datetime.ts#L767

While DateTime.format can't: https://github.com/Eonasdan/tempus-dominus/blob/master/src/js/datetime.ts#L921

So in case localization.format with single y is used (for ex. dd.MM.y, HH:mm:ss)
The date can be parsed correctly BUT being set into input as 27.09.undefined, 14:47:41 on select

StackBlitz fork

https://codepen.io/solomax/pen/bGOeYKg

What operating system(s) are you seeing the problem on?

Linux

What browser(s) are you seeing the problem on?

Chrome, Firefox

What version of are you using? You can find this information from the sample StackBlitz.

6.7.11, 6.7.13

What your browser's locale? You can find this information from the sample StackBlitz.

en-US

@solomax solomax added State: Triage Tickets that need to be triaged. Type: Bug labels Sep 1, 2023
@stackblitz
Copy link

stackblitz bot commented Sep 1, 2023

Fix this issue in StackBlitz Codeflow Start a new pull request in StackBlitz Codeflow.

@solomax
Copy link
Author

solomax commented Sep 1, 2023

I believe the fix is trivial :)

single y should be handled exactly as yyyy :)))

@Eonasdan Eonasdan moved this from 🆕 New to 🏗 In progress in Tempus Dominus Sep 28, 2023
@Eonasdan Eonasdan added Area: TypeScript and removed State: Triage Tickets that need to be triaged. labels Sep 28, 2023
Eonasdan added a commit that referenced this issue Sep 28, 2023
Eonasdan added a commit that referenced this issue Oct 6, 2023
Fixed #2850
Fixed #2855
@Eonasdan
Copy link
Owner

Eonasdan commented Oct 6, 2023

New release should fix this.

@Eonasdan Eonasdan moved this from 🏗 In progress to 🚀 Released in Tempus Dominus Oct 6, 2023
@Eonasdan Eonasdan moved this from 🚀 Released to ✅ Done in Tempus Dominus Oct 16, 2023
Eonasdan added a commit that referenced this issue Nov 6, 2023
* 6.7.11

* 6.7.11

* fixes #2828

* fixes #2828

* fixes #2811
fixes #2846
fixes #2845

* stupid git

* #2850 fixes max date

* #2850 fixes max date

* #2855 fixes format strings

* Reverted #2811
Fixed #2850
Fixed #2855

* merge latest v6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

2 participants