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 events are stopped working in version 10.6.4 #6530

Closed
yachtsman-dev opened this issue May 1, 2024 · 6 comments
Closed

Calendar events are stopped working in version 10.6.4 #6530

yachtsman-dev opened this issue May 1, 2024 · 6 comments
Labels
Status: Needs Reproducer Issue needs a runnable reproducer

Comments

@yachtsman-dev
Copy link

yachtsman-dev commented May 1, 2024

When we have calendar with Year option it's breaking entire application. see attached error screenshot
Screenshot 2024-05-01 at 4 24 54 PM
calendar error

Reproducer

No response

PrimeReact version

10.6.4

React version

18.x

Language

ES6

Build / Runtime

Next.js

Browser(s)

No response

Steps to reproduce the behavior

No response

Expected behavior

No response

@yachtsman-dev yachtsman-dev added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label May 1, 2024
@melloware melloware added Status: Needs Reproducer Issue needs a runnable reproducer and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels May 1, 2024
Copy link

github-actions bot commented May 1, 2024

Please fork the Stackblitz project and create a case demonstrating your bug report. This issue will be closed if no activities in 20 days.

@Rekl0w
Copy link
Contributor

Rekl0w commented May 1, 2024

Can you provide a stackblitz link please ?

@yachtsman-dev
Copy link
Author

Can you provide a stackblitz link please ?

Hi i think its an issue while we are using it with React hook form. normally when i tried its working fine. i will try to generate demo for you. it will take sometime because now i have to fix this issue on production by reverting old version.

@melloware
Copy link
Member

melloware commented May 1, 2024

OK I used React Hook Form and Calendar and mine is working OK.

<Controller
	name="year"
	control={form.control}
	rules={{ required: 'Year is required.', min: 1960, max: 2050 }}
	render={({ field, fieldState }) => (
		<>
			<label htmlFor={field.name} className={classNames({ 'p-error': errors.year })}>
				Year*
			</label>
			<Calendar
				dateFormat="yy"
				inputClassName={classNames({ 'p-invalid': fieldState.error })}
				inputId={field.name}
				inputRef={field.ref}
				onBlur={field.onBlur}
				onChange={(e) => field.onChange(e.value?.getFullYear())}
				value={new Date(field.value, 1, 1)}
				view="year"
			/>
			{getFormErrorMessage(fieldState, field.name, 2050, 1960)}
		</>
	)}
/>

@yachtsman-dev
Copy link
Author

OK I used React Hook Form and Calendar and mine is working OK.

<Controller
	name="year"
	control={form.control}
	rules={{ required: 'Year is required.', min: 1960, max: 2050 }}
	render={({ field, fieldState }) => (
		<>
			<label htmlFor={field.name} className={classNames({ 'p-error': errors.year })}>
				Year*
			</label>
			<Calendar
				dateFormat="yy"
				inputClassName={classNames({ 'p-invalid': fieldState.error })}
				inputId={field.name}
				inputRef={field.ref}
				onBlur={field.onBlur}
				onChange={(e) => field.onChange(e.value?.getFullYear())}
				value={new Date(field.value, 1, 1)}
				view="year"
			/>
			{getFormErrorMessage(fieldState, field.name, 2050, 1960)}
		</>
	)}
/>

https://stackblitz.com/edit/vitejs-vite-4foz9q
i have also tried here but its working fine, don't know why my nextjs app isn't working.

@melloware
Copy link
Member

can you try 10.6.5 another Calendar fix was just made.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale May 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Needs Reproducer Issue needs a runnable reproducer
Projects
None yet
Development

No branches or pull requests

3 participants