primeng
primeng copied to clipboard
p-calendar: ngModel with a Date of type like 2024-01-02T17:34:02 won't be displayed (dateFormat="dd-M-yy")
Describe the bug
I have the following p-calendar:
<p-calendar [(ngModel)]="data" [disabled]="true" [showButtonBar]="true" [touchUI]="true" [showTime]="true" [showSeconds]="true" [style]="{'width': '100%'}" appendTo="body" inputId="dateCreated" dateFormat="dd-M-yy"/>
The "data" is declared as a date and from a MSSQL database, it is being assigned a datetime2 value like 2024-01-02T17:34:02
With this, p-calendar won't display anything. It will however display the date if this is done:
data = new Date("2024-01-02T17:34:02");
Is this an expected behaviour?
Environment
Development
Reproducer
No response
Angular version
17
PrimeNG version
17.3.0
Build / Runtime
Angular CLI App
Language
TypeScript
Node version (for AoT issues node --version)
v20.10.0
Browser(s)
No response
Steps to reproduce the behavior
No response
Expected behavior
No response