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: Doesn't allow null types #3469

Closed
Jupakabra opened this issue Jan 1, 2023 · 1 comment
Closed

Calendar: Doesn't allow null types #3469

Jupakabra opened this issue Jan 1, 2023 · 1 comment
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible

Comments

@Jupakabra
Copy link

Describe the bug

Currently calendar does not accept (Date | null) type as a valid CalendarValueType.
This results in typing errors, even though clearing the date sets the value to null.

Reproducer

https://primefaces.org/primevue/calendar

PrimeVue version

3.21.0

Vue version

3.x

Language

TypeScript

Build / Runtime

TypeScript

Browser(s)

Any

Steps to reproduce the behavior

type CalendarValueType = Date | Date[] | undefined;

const date: CalendarValueType = null; // Type 'null' is not assignable to type 'CalendarValueType'

Expected behavior

Typescript compiler not giving errors on valid date values.

@Jupakabra Jupakabra 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 1, 2023
@bahadirsofuoglu
Copy link
Contributor

Duplicate #3400

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible
Projects
None yet
Development

No branches or pull requests

2 participants