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

hst-ethiopian-datepicker

v1.0.2

Published

HST Ethiopian Date Picker is a React component library that delivers synchronized Ethiopian and Gregorian calendar experiences on top of Material UI. It includes a polished date picker, a read-only viewer, and a localization layer that helps teams support

Downloads

17

Readme

HST Ethiopian Date Picker

HST Ethiopian Date Picker is a React component library that delivers synchronized Ethiopian and Gregorian calendar experiences on top of Material UI. It includes a polished date picker, a read-only viewer, and a localization layer that helps teams support Amharic, Afan Oromo, or fully custom month labels while preserving a familiar UX for international users.

Key Features

  • Dual-calendar popover displaying Ethiopian and Gregorian months side by side
  • Controlled and uncontrolled usage patterns with first-class TypeScript support
  • Optional locale switcher within the text field or viewer component
  • Built-in conversion utilities for moving between Ethiopian and Gregorian dates
  • Fine-grained configuration for disabling past/future dates and setting min/max bounds
  • Tested with React 18 and 19, Material UI v6, and the latest @mui/x-date-pickers

Installation

npm install hst-ethiopian-datepicker
# or
yarn add hst-ethiopian-datepicker

Peer dependencies: react, react-dom, @mui/material, @mui/icons-material, @mui/x-date-pickers, @emotion/react, and @emotion/styled. Ensure they are already present in your host application.

Quick Start

import { useState } from "react";
import HstDatePicker, {
	HstLocalizationProvider,
	HstDateViewer,
} from "hst-ethiopian-datepicker";

export default function Example() {
	const [date, setDate] = useState<Date | null>(new Date());

	return (
		<HstLocalizationProvider locale="AMH">
			<HstDatePicker
				label="Document Date"
				value={date}
				onChange={(selected) => setDate(selected)}
			/>

			{date && (
				<HstDateViewer
					mt={2}
					date={date}
					showTime
					fontWeight={600}
				/>
			)}
		</HstLocalizationProvider>
	);
}

Core Components

HstDatePicker

Material UI TextField with an Ethiopian and Gregorian calendar popover.

| Prop | Type | Notes | | --- | --- | --- | | value | Date \| null | Controlled Gregorian value. | | defaultValue | Date | Optional uncontrolled initial value. | | onChange | (date: Date) => void | Fired when the user selects a day. | | disablePast | boolean | Prevents selection of days before today. | | disableFuture | boolean | Prevents selection of days after today. | | minDate / maxDate | Date | Hard bounds applied to both calendars. | | ...TextFieldProps | from MUI | Pass label, helperText, size, etc. |

HstDateViewer

Read-only component for displaying localized Ethiopian or Gregorian dates.

| Prop | Type | Notes | | --- | --- | --- | | date | Date | Required Gregorian source date. | | initialDateType | "EN" \| "AMH" \| "AO" \| "CUSTOM" | Defaults to provider locale. | | disableSwitcher | boolean | Locks the viewer to a single locale. | | showTime | boolean | Adds 12-hour time to the output. | | ...TypographyProps | from MUI | Style the output text. |

Localization Provider

Wrap your app (or specific sections) in HstLocalizationProvider to define locale defaults and toggle features:

<HstLocalizationProvider
	locale="AO"
	getLocalMonthName={(monthNumber) => customMonthMap[monthNumber]}
	disableEt={false}
	disableGregorian={false}
	disableSwitcher={false}
>
	{children}
</HstLocalizationProvider>
  • locale: "AMH", "AO", "CUSTOM", or "EN".
  • getLocalMonthName: required when using CUSTOM to supply localized names (1-indexed months).
  • disableEt / disableGregorian: hide either side of the calendar UI.
  • disableSwitcher: lock inputs and viewers to the default locale.

Calendar Modes

Choose the calendar experience you expose to users by mixing the provider flags:

// Dual-calendar (default)
<HstLocalizationProvider locale="AMH">
	<HstDatePicker ... />
</HstLocalizationProvider>

// English-only (Gregorian)
<HstLocalizationProvider locale="EN" disableEt disableSwitcher>
	<HstDatePicker ... />
</HstLocalizationProvider>

// Amharic-only (Ethiopian)
<HstLocalizationProvider locale="AMH" disableGregorian disableSwitcher>
	<HstDatePicker ... />
</HstLocalizationProvider>

Omit disableSwitcher if you still want the input toggle icon visible while only one calendar is available.

Conversion Utilities

The library re-exports the EthiopianDate namespace as EthiopianDateUtil for direct consumption:

  • toEth(date: Date) converts Gregorian dates to { Day, Month, Year }.
  • toGreg(etDate) returns a native Date from Ethiopian parts.
  • formatEtDate(etDate, locale, getLocalMonth?, time?) returns localized strings.
  • Additional helpers: ethiopianMonthLength, compareDates, addDays, addYears, fullEthiopianYearDifference, and more.

Local Development

Clone the repository and build the package locally:

npm install
npm run build

An embedded Next.js playground under testdate lets you experiment while developing:

cd testdate
npm install
npm run dev

Visit http://localhost:3000 to interact with the components in a live app context.

Publishing Workflow

The project uses tsup to emit ESM, CJS, and type declaration bundles. Run npm run build prior to npm publish to ensure the dist/ folder contains up-to-date artifacts.

License

ISC