react-day-picker-gregorian-only
v0.1.0
Published
Customizable Date Picker for React
Readme
react-day-picker-gregorian-only
Fork of react-day-picker with non-Gregorian calendar plugins removed.
This fork removes the calendar plugins (Hijri, Persian/Jalali, Buddhist, Ethiopic, Hebrew) that were added to the upstream package, keeping only Gregorian calendar support. The motivation is to reduce bundle size for projects that do not need these calendars.
Discussion: A proposal to make calendar plugins opt-in (or separable) is open at gpbl/react-day-picker#2910. If the upstream adopts this approach, this fork may no longer be necessary.
DayPicker is a React component for creating date pickers, calendars, and date inputs for web applications.
Installation
npm install react-day-picker-gregorian-onlyExample
import { DayPicker } from "react-day-picker-gregorian-only";
import "react-day-picker-gregorian-only/style.css";
function MyDatePicker() {
const [selected, setSelected] = useState<Date>();
return (
<DayPicker
mode="single"
selected={selected}
onSelect={setSelected}
footer={
selected ? `Selected: ${selected.toLocaleDateString()}` : "Pick a day."
}
/>
);
}Features
- 🛠 Extensive set of props for customizing the calendar.
- 🎨 Minimal design that can be easily styled with CSS or any CSS framework.
- 📅 Supports selections of single days, multiple days, ranges of days, or custom selections.
- 🌍 Can be localized into any language and time zones.
- 🦮 Complies with WCAG 2.1 AA requirements for accessibility.
- ⚙️ Customizable components to extend the rendered elements.
- 🔤 Easy integration with input fields.
DayPicker is written in TypeScript and compiled to CommonJS and ESM. It relies on date-fns for date manipulation and formatting.
Compatibility
DayPicker is compatible with React 16.8 and later.
Upstream
This package is a fork of gpbl/react-day-picker. See the original documentation for full guides and API reference.
License
MIT
