Skip to content

Conversation

@leb2
Copy link
Collaborator

@leb2 leb2 commented Jan 12, 2023

Test with :

npm run playground

This PR fixes issues where if you type into the datetime text box, it would sometimes cause the date string to update

For example, if you were typing into this text box. and your cursor was at the end, and you delete the "M", it would automatically re-populate the M because just the "a" is a validate date, and it would get normalized back to "AM".

There are other issues where if you type into the middle of the text box, and the date changes from being an invalid date to a valid date, it would sometimes move your cursor to the very end.

To fix this, I made a new variable which keeps track of what the user types, and which will get refreshed if the date changes from the outside.

Screen Shot 2023-01-12 at 3 00 10 PM

@leb2 leb2 requested a review from yagmin January 12, 2023 22:57
Copy link

@yagmin yagmin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Working well, nice improvement.

I noticed the 2nd example displays seconds for editing in the GUI but seconds aren't shown in the formatted string. I believe this is only caused to the formatting settings for that example.

@leb2 leb2 merged commit dd1a39a into master Jan 13, 2023
This was referenced Jul 16, 2025
Merged
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.

3 participants