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

Calendar: component emit different format on load then after change #14484

Closed
Sp94dev opened this issue Jan 4, 2024 · 1 comment · Fixed by #14497
Closed

Calendar: component emit different format on load then after change #14484

Sp94dev opened this issue Jan 4, 2024 · 1 comment · Fixed by #14497
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@Sp94dev
Copy link

Sp94dev commented Jan 4, 2024

Describe the bug

When we change dataType and dateFormat on the p-calendar element it does not reflect this value on the initial load.

Environment

"primeng": "17.3.1",
"@angular-devkit/build-angular": "^17.0.5",
"@angular/animations": "^17.0.5",
"@angular/cdk": "^17.0.2",
"@angular/cli": "^17.0.5",
"@angular/common": "^17.0.5",
"@angular/compiler": "^17.0.5",
"@angular/compiler-cli": "^17.0.5",
"@angular/core": "^17.0.5",
"@angular/forms": "^17.0.5",
"@angular/platform-browser": "^17.0.5",
"@angular/platform-browser-dynamic": "^17.0.5",
"@angular/platform-server": "^17.0.5",
"@angular/router": "^17.0.5",
"chart.js": "3.3.2",
"primeflex": "^3.3.1",
"primeicons": "^6.0.1",
"quill": "1.3.7",
"rxjs": "~7.8.1",
"tslib": "^2.5.0",
"zone.js": "~0.14.0"

Reproducer

https://stackblitz.com/edit/gucrzb?file=src%2Fapp%2Fdemo%2Fcalendar-basic-demo.html,src%2Fapp%2Fdemo%2Fcalendar-basic-demo.ts

Angular version

17.0.5

PrimeNG version

17.3.1

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

20.10.0

Browser(s)

All

Steps to reproduce the behavior

  1. Initialize the calendar with any date
  2. add dateFormat="dd/mm/yy" and dataType="string" in template
  3. display the value of the control
  4. The initial load value is in DateTime format
  5. after the date format is changed to desired

Expected behavior

Apply format and type on initial load

@Sp94dev Sp94dev 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 4, 2024
@Sp94dev Sp94dev changed the title Calendar component emit different format on load then after change Calendar: component emit different format on load then after change Jan 4, 2024
@mehmetcetin01140 mehmetcetin01140 added Type: Bug Issue contains a bug related to a specific component. Something about the component is not working 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 5, 2024
HeavyRainLQ added a commit to HeavyRainLQ/primeng that referenced this issue Jan 6, 2024
@cetincakiroglu cetincakiroglu added this to the 17.3.2 milestone Jan 8, 2024
cetincakiroglu added a commit that referenced this issue Jan 10, 2024
fix #14484 Calendar: the initial load now respect the dateFormat
@jayee
Copy link

jayee commented Jan 23, 2024

This change emits model change initially, when nothing is changed in the model. The form is also set to dirty.

The code in my case
<p-calendar [inputId]="name" [name]="name" [keepInvalid]="true" [dataType]="'string'" [disabled]="disabled" [maxDate]="maxDate" [(ngModel)]="datum" (ngModelChange)="changed()"> </p-calendar>

cetincakiroglu added a commit that referenced this issue Feb 7, 2024
Revert "fix #14484 Calendar: the initial load now respect the dateFormat"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants