Skip to content

DatePicker now breaks formatting when given an ISO string #7397

Open
@gkolotelo

Description

@gkolotelo

Describe the bug

Commit 1536d12 fixed issue #7010 however now it breaks the formatting when DatePicker is given an ISO string.

Pull Request Link

#7398

Reproducer

https://stackblitz.com/edit/primevue-4-vite-issue-template-ftdl6m5c?file=src%2FApp.vue

Environment

  • Windows 11

Vue version

3.4.31

PrimeVue version

4.3.1

Browser(s)

Edge 135.0.3168.2

Steps to reproduce the behavior

  1. Input an ISO string to DatePicker
  2. You can see the date is not being formatted to the specified dateFormat

Expected behavior

  1. Input an ISO string to DatePicker
  2. Format the date according to dateFormat as in PrimeVue 4.2.5 (before commit 1536d12), similarly as it would occur if the input was a Date object.

Considering PrimeVue documentation specifies Date | null as input to DatePicker, the fix to issue #7010, although allowing more flexibility to DatePicker, ends up breaking an, IMHO, much more expected behavior of properly parsing an ISO string.

Metadata

Metadata

Labels

Type: BugIssue contains a bug related to a specific component. Something about the component is not working

Type

No type

Projects

Status

Review

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions