-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 : enabledDates is not evaluated with disabledDays #5863
Labels
Type: Bug
Issue contains a defect related to a specific component.
Milestone
Comments
sdwillbrand
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 31, 2024
melloware
added
the
Type: Bug
Issue contains a defect related to a specific component.
label
Jan 31, 2024
melloware
removed
the
Status: Needs Triage
Issue will be reviewed by Core Team and a relevant label will be added as soon as possible
label
Jan 31, 2024
I can't get to your Sandbox. Can you just paste your whole js file here in comment so I can see. |
import React, { useState } from "react";
import { createRoot } from "react-dom/client";
import { Button } from "primereact/button";
import { Calendar } from "primereact/calendar";
import "primereact/resources/themes/lara-light-indigo/theme.css"; //theme
import "primereact/resources/primereact.min.css"; //core css
import "primeicons/primeicons.css"; // icons
import "primeflex/primeflex.css"; // flex
import "./styles.css"; // application css
const disabledDates = [];
for (let i = 0; i < 400; i++) {
disabledDates.push(new Date(new Date("2022-12-25").getTime() + 86400000 * i));
}
const App = () => {
const [date, setDate] = useState(null);
return (
<div className="App">
<Calendar
value={date}
onChange={(e) => setDate(e.value)}
disabledDates={disabledDates}
disabledDays={[0, 1, 2, 3]}
enabledDates={[new Date("2024-02-19")]}
/>
</div>
);
};
const container = document.getElementById("root");
const root = createRoot(container);
root.render(<App />); |
Thanks! |
melloware
added a commit
to melloware/primereact
that referenced
this issue
Jan 31, 2024
Exactly!!! Thank you! |
melloware
added a commit
to melloware/primereact
that referenced
this issue
Jan 31, 2024
melloware
added a commit
to melloware/primereact
that referenced
this issue
Jan 31, 2024
melloware
added a commit
that referenced
this issue
Jan 31, 2024
sdwillbrand
pushed a commit
to sdwillbrand/primereact
that referenced
this issue
Feb 1, 2024
github-actions
bot
added
the
Status: Needs Triage
Issue will be reviewed by Core Team and a relevant label will be added as soon as possible
label
Feb 1, 2024
sdwillbrand
pushed a commit
to sdwillbrand/primereact
that referenced
this issue
Feb 1, 2024
melloware
added a commit
that referenced
this issue
Feb 1, 2024
* Fix #5863: Calendar enabledDates fixed * Fix #5863: format * Update Calendar.js --------- Co-authored-by: Melloware <[email protected]>
melloware
removed
the
Status: Needs Triage
Issue will be reviewed by Core Team and a relevant label will be added as soon as possible
label
Feb 5, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
When using
disabledDays
passingenabledDates
is not working.Reproducer
https://codesandbox.io/p/sandbox/primereact-test-forked-cjy7lg?file=%2Fsrc%2Findex.js
PrimeReact version
latest
React version
18.x
Language
TypeScript
Build / Runtime
Create React App (CRA)
Browser(s)
No response
Steps to reproduce the behavior
No response
Expected behavior
No response
The text was updated successfully, but these errors were encountered: