An Ethiopian Calendar localizer for react big calendar.
npm install eth-react-big-calendar-localizerEthiopian calendar localizer for react-big-calendar — a drop-in localizer that makes the calendar display and handle Ethiopian dates while remaining fully compatible with events and all built-in views.
- Drop-in localizer for react-big-calendar.
- Full support for events (start/end) and all views: day, week, work_week, month, agenda.
- Works as an alternative to momentLocalizer or other localizers.
Install from npm:
``bash`
npm install eth-react-big-calendar-localizeror
pnpm add eth-react-big-calendar-localizeror
yarn add eth-react-big-calendar-localizer
Below is a minimal example showing how to swap between the Gregorian (momentLocalizer) and the Ethiopian localizer in a React app.
`jsx
import { useState } from 'react'
import { ethLocalizer } from 'eth-react-big-calendar-localizer'
import { Calendar, momentLocalizer } from 'react-big-calendar'
import type { View } from 'react-big-calendar'
import 'react-big-calendar/lib/css/react-big-calendar.css'
import moment from 'moment'
const localizer = momentLocalizer(moment)
const today = new Date()
function App() {
const [calendar, setCalendar] = useState<'gregorian' | 'ethiopian'>('gregorian');
const [date, setDate] = useState(today);
const [view, setView] = useState
const [events, setEvents] = useState([
{
title: 'Meeting',
start: today,
end: new Date(today.getTime() + 60 60 1000),
},
{
title: 'Lunch',
start: new Date(today.getTime() + 120 60 1000),
end: new Date(today.getTime() + 180 60 1000),
}
])
return (
events={events}
startAccessor="start"
endAccessor="end"
style={{ height: '80vh' }}
date={date}
view={view}
onNavigate={(newDate) => setDate(newDate)}
onView={(newView) => setView(newView)}
/>
export default App
`
- Pass ethLocalizer to the localizer prop of react-big-calendar to enable Ethiopian date rendering and navigation.start
- Events (with and end as JS Date objects) are fully supported — the localizer handles display and view calculations.day
- All standard calendar views are supported: , week, work_week, month, and agenda.
Contributions, issues, and feature requests are welcome. See the repository on GitHub for source, development instructions, and to open issues or pull requests:
https://github.com/dawit-kebebe/eth-react-big-calendar-localizer
See the LICENSE` file in this repository.
---
If you need help integrating this localizer into your app or want a feature added (for example, timezone support or custom format hooks), please open an issue on the GitHub repo.
Last but not least do not forget to 🌟 star the repo. ✌️ peace!!