Logo Lanfrica

mikiyasET/amharic-datepicker

Domaine:

natural language processing

Type de record:

software
Créateur:
mik
Hôte:
# Amharic Date Picker A modern, highly customizable React component for picking Amharic (Ethiopian) dates. Built with zero external calendar dependencies to keep it lightweight, fast, and bug-free. > **Looking for the backend/logic-only package?** Use `amharic-datepicker-utils` — the same calendar conversion logic with no React dependency. This package (`amharic-datepicker`) depends on it automatically and re-exports all its functions. ## Features - **Standalone Logic:** Uses custom internal logic for the Ethiopian calendar (including leap years and Pagume logic). - **Beautiful UI:** Styled with Vanilla CSS featuring clean typography, smooth transitions, and responsive design. - **Conversion Utilities:** Provides helper functions to easily convert between Gregorian and Ethiopian dates. - **TypeScript Ready:** Full TypeScript definitions included. ## Installation ```bash # npm npm install amharic-datepicker # yarn yarn add amharic-datepicker # pnpm pnpm add amharic-datepicker # bun bun add amharic-datepicker ``` ## Usage ### 1. React Component ```tsx import React, { useState } from 'react'; import { AmharicDatePicker, toEthiopian } from 'amharic-datepicker'; function App() { const [date, setDate] = useState(() => { const now = new Date(); // Default to today's Ethiopian date return toEthiopian(now.getFullYear(), now.getMonth() + 1, now.getDate()); }); return ( Select Date Selected: {date.year}/{date.month}/{date.day} ); } export default App; ``` ### Component Props | Prop | Type | Default | Description | |------|------|---------|-------------| | `value` | `EthDateValue` | current date | The currently selected date/time | | `onChange` | `(date: EthDateValue) => void` | | Callback when date or time is selected/saved | | `placeholder` | `string` | `"ቀን ይምረጡ / Select Date"` | Placeholder text for the input field | | `showTime` | `boolean` | `false` | Whether to show the time picker | | `theme` | `'light' \| 'dark'` | `'light'` | Toggle between light …

Languages