npm package: @surafiel/ethiopian-date-picker
Description: Complete Ethiopian calendar date picker component with Amharic support
Author: Your Name
Latest version: 1.0.0

# Ethiopian Date Picker (የኢትዮጵያ ቀን መምረጫ)

A modern, lightweight, and accurate Ethiopian Date Picker component with full Amharic support. Built with ease of use and design in mind.

![Ethiopian Date Picker Preview](https://via.placeholder.com/800x400?text=Ethiopian+Date+Picker+Preview)

## Features

- 📅 **Full Ethiopian Calendar Support:** Accurate conversion logic between Gregorian and Ethiopian calendars.
- 🇪🇹 **Amharic Localization:** Native support for Amharic month names and weekdays.
- 🎨 **Beautiful UI:** Modern, clean, and responsive design with smooth animations.
- 🛠 **Zero Dependencies:** Built with vanilla JavaScript and CSS (developed with Vite).
- 📦 **Dual Build:** Supports both ESM (`import`) and UMD (`<script>`) usage.
- 🌗 **Dark Mode Ready:** Styles are easily customizable.

## Installation

You can install the package via npm (if published):

```bash
npm install @surafiel/ethiopian-date-picker
```

**Or install directly from GitHub (Recommended if not on npm):**

```bash
npm install github:surafielbeyene41/EthiopianDateConverter
```

Or download the latest release from the [GitHub repository](https://github.com/surafielbeyene41/EthiopianDateConverter).

## Usage

### 1. Using ES Modules (React, Vue, etc.)

Import the styles and the component in your JavaScript/TypeScript file:

```javascript
import { EthiopianDatePicker, EthiopianDateConverter } from 'ethiopian-date-picker';
import 'ethiopian-date-picker/dist/style.css'; // Don't forget the CSS!

// Initialize the picker
const picker = new EthiopianDatePicker('my-container-id', {
    placeholder: 'ቀን ይምረጡ', // "Select Date"
    onChange: (selectedDate) => {
        console.log('Selected Date:', selectedDate);
        // Output: { year: 2016, month: 1, day: 10 }
        
        // Convert to Gregorian if needed
        const greg = EthiopianDateConverter.toGregorian(
            selectedDate.year, 
            selectedDate.month, 
            selectedDate.day
        );
        console.log('Gregorian:', greg);
    }
});
```

### 2. Using in Browser (Script Tag)

Include the script and CSS in your HTML file:

```html
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Ethiopian Date Picker</title>
    <link rel="stylesheet" href="./dist/style.css">
</head>
<body>
    
    <div id="calendar-container"></div>

    <script src="./dist/ethiopian-date-picker.umd.cjs"></script>
    <script>
        // The library exposes 'EthiopianDatePicker' globally
        const picker = new EthiopianLib.EthiopianDatePicker('calendar-container', {
            onChange: function(date) {
                console.log(date);
            }
        });
    </script>
</body>
</html>
```

## API Reference

### `EthiopianDatePicker`

The main class for the UI component.

**Constructor:** `new EthiopianDatePicker(containerId, options)`

| Parameter | Type | Description |
|-----------|------|-------------|
| `containerId` | `string` | The ID of the HTML element to render the picker into. |
| `options` | `Object` | Configuration object (see below). |

**Options:**

| Option | Type | Default | Description |
|--------|------|---------|-------------|
| `placeholder` | `string` | `'ማስገቢያ ቀን ይምረጡ'` | Placeholder text for the input field. |
| `onChange` | `function` | `() => {}` | Callback function triggered when a date is selected. Receives `{ year, month, day }`. |

### `EthiopianDateConverter`

Utility class for date conversions.

**Methods:**

- **`toEthiopian(gregorianDate)`**
    - `gregorianDate`: `Date` object or date string.
    - Returns: `{ year, month, day }` (Ethiopian)

- **`toGregorian(ethiopianYear, ethiopianMonth, ethiopianDay)`**
    - Returns: `{ year, month, day }` (Gregorian)

- **`formatEthiopianDate(ethiopianDate, format)`**
    - `ethiopianDate`: `{ year, month, day }`
    - `format`: `'full'` (e.g., "10 መስከረም 2016") or `'short'` (e.g., "10/1/2016")

## Development

1. Clone the repository:
   ```bash
   git clone https://github.com/surafielbeyene41/EthiopianDateConverter.git
   ```

2. Install dependencies:
   ```bash
   npm install
   ```

3. Start the development server:
   ```bash
   npm run dev
   ```

4. Build for production:
   ```bash
   npm run build
   ```

## License

This project is licensed under the MIT License.