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

DatePicker -- undesirable behavior when manually editing a date #7113

Open
4 tasks
tht-work opened this issue Jan 18, 2025 · 3 comments
Open
4 tasks

DatePicker -- undesirable behavior when manually editing a date #7113

tht-work opened this issue Jan 18, 2025 · 3 comments
Labels
Status: Discussion Issue or pull request needs to be discussed by Core Team

Comments

@tht-work
Copy link

Describe the bug

I am not sure if this is a bug. I am not sharing code for this potential issue -- the potential issue can be reproduced on the PrimeVue website DatePicker component page for v4, if you have a date selected like this for example,

Image

If you want to change the month via typing in the field so you delete 01 (January) and you want to change it to 12 (December) (or any double digit month) the component puts a leading zero so when you try to type 12, the component shows 021 for the month section. Was this intentional or is this a bug?

Pull Request Link

No response

Reason for not contributing a PR

  • Lack of time
  • Unsure how to implement the fix/feature
  • Difficulty understanding the codebase
  • Other

Other Reason

No response

Reproducer

N/A

Environment

N/A

Vue version

3

PrimeVue version

4

Node version

No response

Browser(s)

No response

Steps to reproduce the behavior

See description

Expected behavior

Typing in the the month section of the date field does not add a leading 0

@tht-work tht-work added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Jan 18, 2025
@borsTiHD
Copy link

borsTiHD commented Jan 20, 2025

Hi, that sounds like the same behaviour as mentioned here: #6361

Another examples:
I select a date via the picker (e.g. "01/01/2025").
Then I click into the text field to change the day to the 15th.
If I place the cursor before the day and type directly, the result is "01/1501/2025", and it resets back to "01/01/2025".
If I place the cursor in the middle or at the end of the date, similar issues occur.
If I now select the "01" and replace it with "15", I get "01/051/2025", which again resets to "01/01/2025".

@tugcekucukoglu tugcekucukoglu added Status: Discussion Issue or pull request needs to be discussed by Core Team and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Jan 21, 2025
@Tarabass
Copy link

I'm running into the same problem.

@tht-work
Copy link
Author

Looks like this is a bug. Can a PrimeVue contributor confirm? @tugcekucukoglu

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Discussion Issue or pull request needs to be discussed by Core Team
Projects
None yet
Development

No branches or pull requests

4 participants