react-amharic-datepicker
v1.0.1
Published
An Ethiopian/Amharic Datepicker React component wrapper around jQuery Calendars.
Readme
react-amharic-datepicker
A lightweight, reusable React datepicker component tailored specifically for the Ethiopian/Amharic calendar. It wraps the robust Keith Wood jQuery calendar engine into a modern React lifecycle component that works seamlessly in both JavaScript (JSX) and TypeScript (TSX) ecosystems.
Compatible with modern bundlers like Vite, Webpack, and frameworks like Next.js or CoreUI Admin Templates.
Features
- 📅 Full Ethiopian Calendar Support out of the box.
- 🗣️ Amharic Localization automatically pre-configured.
- 🛠️ Dual JS/TS Support with fully bundled TypeScript types (
.d.ts). - 🎨 Style-Agnostic—easily passes custom class names (e.g., Bootstrap/CoreUI
form-control) straight to the component. - 🔄 Backward Compatible—includes automated internal polyfills to run flawlessly on modern jQuery versions (v3.0+).
Installation
Install the package along with its peer dependencies:
npm install react-amharic-datepicker jquery
---
## Usage
### Basic Example (JSX / TSX)
```tsx
import React, { useState } from 'react';
import { AmharicDatePicker } from 'react-amharic-datepicker';
function App() {
const [selectedDate, setSelectedDate] = useState('');
return (
<div style={{ padding: '20px' }}>
<label>ቀን ይምረጡ (Select Date): </label>
<AmharicDatePicker onChange="{(date)" value="{selectedDate}"> setSelectedDate(date)}
dateFormat="dd-mm-yyyy"
className="form-control" // Inherits Bootstrap/CoreUI styling seamlessly
/>
<p>የተመረጠው ቀን: {selectedDate || 'አልተመረጠም'}</p>
</div>
);
}
export default App;