npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

react-ethiopian-calendar

v1.0.17

Published

A React component library for Ethiopian calendar date selection with support for both single date and date range picking.

Readme

React Ethiopian Calendar

A React component library for Ethiopian calendar date selection with support for both single date and date range picking.

Features

  • Single Date Picker: Select individual dates in Ethiopian calendar format
  • Date Range Picker: Select date ranges with visual highlighting
  • Dual Calendar Support: Both Ethiopian (ET) and Gregorian (GC) calendar types
  • Language Support: Amharic and English language options
  • Controlled Component: Full control over value and onChange behavior
  • Form Integration: Works seamlessly with form libraries like Formik
  • Customizable Styling: Flexible styling options and CSS customization
  • Accessibility: Keyboard navigation and screen reader support

Installation

npm install react-ethiopian-calendar

Basic Usage

Single Date Picker

import { EtCalendar } from 'react-ethiopian-calendar';
import 'react-ethiopian-calendar/src/style/index.css';

function MyComponent() {
  const [selectedDate, setSelectedDate] = useState(null);

  return (
    <EtCalendar
      value={selectedDate}
      onChange={setSelectedDate}
      calendarType={true} // true for Ethiopian, false for Gregorian
      lang="am" // "am" for Amharic, "en" for English
    />
  );
}

Date Range Picker

import { EtCalendar } from 'react-ethiopian-calendar';
import 'react-ethiopian-calendar/src/style/index.css';

function MyComponent() {
  const [selectedRange, setSelectedRange] = useState({
    startDate: null,
    endDate: null
  });

  return (
    <EtCalendar
      value={selectedRange}
      onChange={setSelectedRange}
      dateRange={true} // Enable date range mode
      calendarType={true}
      lang="am"
    />
  );
}

Props

Common Props

| Prop | Type | Default | Description | |------|------|---------|-------------| | value | Date \| dayjs \| { startDate, endDate } | null | Selected date(s) | | onChange | function | - | Callback when date selection changes | | calendarType | boolean | true | true for Ethiopian, false for Gregorian | | lang | string | "am" | Language: "am" (Amharic) or "en" (English) | | disabled | boolean | false | Disable the component | | minDate | Date | - | Minimum selectable date | | maxDate | Date | - | Maximum selectable date | | disableFuture | boolean | false | Prevent selecting future dates | | fullWidth | boolean | false | Make component full width | | borderRadius | string | - | Custom border radius | | placeholder | boolean | false | Show placeholder text | | label | string | "Date" | Label for the input | | inputStyle | object | - | Custom styles for the input | | onBlur | function | - | Callback when input loses focus |

Date Range Specific Props

| Prop | Type | Default | Description | |------|------|---------|-------------| | dateRange | boolean | false | Enable date range selection mode |

Date Range Picker Behavior

When dateRange={true} is set:

  1. First Click: Sets the start date
  2. Second Click: Sets the end date and closes the calendar
  3. Visual Feedback:
    • Start and end dates are highlighted with blue background
    • Dates within the range are highlighted with light blue background
    • Hover effects on range dates
  4. Auto-adjustment: If end date is selected before start date, they are automatically swapped
  5. Reset: Clicking a new date after both dates are selected starts a new range

Form Integration

With Formik

import { useFormik } from 'formik';
import { EtCalendar } from 'react-ethiopian-calendar';

function MyForm() {
  const formik = useFormik({
    initialValues: {
      singleDate: null,
      dateRange: { startDate: null, endDate: null }
    },
    onSubmit: (values) => {
      console.log(values);
    }
  });

  return (
    <form onSubmit={formik.handleSubmit}>
      {/* Single Date */}
      <EtCalendar
        value={formik.values.singleDate}
        onChange={(date) => formik.setFieldValue('singleDate', date)}
        onBlur={formik.handleBlur}
        name="singleDate"
        label="Select Date"
      />

      {/* Date Range */}
      <EtCalendar
        value={formik.values.dateRange}
        onChange={(range) => formik.setFieldValue('dateRange', range)}
        onBlur={formik.handleBlur}
        name="dateRange"
        label="Select Date Range"
        dateRange={true}
      />

      <button type="submit">Submit</button>
    </form>
  );
}

Styling

The component comes with default styles that can be customized via CSS. Key CSS classes:

  • .dateInRange - Dates within the selected range
  • .rangeStart - Start date of the range
  • .rangeEnd - End date of the range
  • .selectedDate - Selected single date
  • .currentMonth - Dates in the current month
  • .grayText - Disabled or out-of-range dates

Custom Styling

/* Custom range styling */
.dateInRange {
  background-color: rgba(255, 0, 0, 0.1);
  color: #ff0000;
}

.rangeStart,
.rangeEnd {
  background-color: #ff0000;
  color: white;
}

Examples

See the example/ directory for complete working examples including:

  • Basic single date picker
  • Date range picker
  • Form integration with validation
  • Custom styling examples

Browser Support

  • Chrome (latest)
  • Firefox (latest)
  • Safari (latest)
  • Edge (latest)

Dependencies

  • React 16.8+
  • dayjs
  • ethiopian-date
  • react-element-popper

License

MIT

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.