Catalog npm
PACKAGE EXPLORERView in registry

@0xdolan/tsroj

npm

The definitive TypeScript library for the Kurdish solar calendar.

calendardatedatetimekurdishrojsolar
Versions collected4
Direct dependencies5From release 1.0.6
Last observed20 Oct, 23:05 UTC

README

Current package documentation
tsroj logo

tsroj — Kurdish Solar Calendar

tsroj is a TypeScript library for the Kurdish solar calendar. Convert and format dates across Kurdish solar, Gregorian, Persian (Jalali), and Tabular Islamic systems using only native JavaScript (Date, Math) — zero runtime dependencies.

npm version License: GPL-3.0

Install

npm i @0xdolan/tsroj
pnpm add @0xdolan/tsroj
yarn add @0xdolan/tsroj

Quick start

import { KurdishDate, KurdishDateTime } from "@0xdolan/tsroj";

// From Gregorian
const kd = KurdishDate.fromGregorian(new Date(2026, 5, 26));
console.log(kd.year, kd.month, kd.day); // 2726, 4, 5

// Native Kurdish date
const native = new KurdishDate(2726, 4, 5);

// Conversions
console.log(native.toGregorian()); // [2026, 6, 26]
console.log(native.toPersian());   // [1405, 4, 5]
console.log(native.toIslamic());   // [1448, 1, 10]

// Date + time
const now = KurdishDateTime.now();
console.log(now.strftime("%I:%M %p", { locale: "ckb" }));

Locales & calendars

Supported locale codes: en, ckb (Sorani), kmr (Kurmanji), fa, ar, tr.

Dialect aliases (sdh, lki, zza, ku, …) resolve to the nearest loaded bundle (ckb or kmr).

CalendarMonth names from
Kurdish solarUser locale bundle
GregorianUser locale bundle
PersianCanonical fa bundle
IslamicCanonical ar bundle

Locale data lives under src/locales/<code>/common.json with i18next-style variant groups (names, short, min).

Formatting (strftime)

const kd = new KurdishDate(2726, 4, 5);

// Sorani month names (month 4 = پووشپەڕ)
kd.strftime("%B", { locale: "ckb" }); // پووشپەڕ

// Month / weekday variants (index or exact name)
kd.strftime("%B %b", { locale: "ckb", monthVariant: 1 });
kd.strftime("%A %a %E", { locale: "kmr", weekdayVariant: 1 });

// Locale digits
kd.strftime("%Y", { locale: "ckb", useLocaleDigits: true }); // ٢٧٢٦

// Manual overrides (highest priority)
kd.strftime("%B %A", {
  locale: "ckb",
  month: "CustomMonth",
  weekday: "CustomDay",
});

Sorani ezafe (ی) — ckb only

Enabled by default; disable per option:

OptionWhenExample
ezafeAfterDayDay + month name in pattern5ی پووشپەڕ
ezafeOnMonthDay + month name + year in pattern5ی پووشپەڕی 2726
kd.strftime("%d %B %Y", { locale: "ckb" });
// 5ی پووشپەڕی 2726

kd.strftime("%d %B %Y", {
  locale: "ckb",
  ezafeAfterDay: false,
  ezafeOnMonth: false,
});
// 5 پووشپەڕ 2726

Leading zero — ckb, fa, ar

leadingZero defaults to false for these locales (%d, %m, and time tokens omit padding). Set leadingZero: true to pad.

kd.strftime("%d/%m", { locale: "ckb" }); // 5/4
kd.strftime("%d/%m", { locale: "en" });  // 05/04

strftime tokens

%A %a %E (weekday min) %B %b %Y %y %m %-m %d %-d %w %-w %H %I %M %S %p

FormatCalendarOptions

OptionDescription
localeLocale code
calendarkurdish · gregorian · persian · islamic
monthVariantMonth variant index or exact name
weekdayVariantWeekday variant index or exact name
useLocaleDigitsUse locale digit glyphs
leadingZeroPad numeric tokens (default off for ckb/fa/ar)
ezafeAfterDaySorani ی after day (default on for ckb)
ezafeOnMonthSorani ی on month when year present (default on for ckb)
month, weekday, …Manual label overrides
overridesNested override object

Interactive demo

npm run build          # build library (updates dist types for demo)
cd demo && npm install && npm run dev

Open http://localhost:5173/tsroj/ — live clock, four calendar systems, searchable timezone picker, locale variants, Sorani grammar toggles, and copyable examples.

Deployed at https://0xdolan.github.io/tsroj/.

tsroj interactive demo — click to open live site

To embed on your own site (after deploy), use:
<iframe src="https://0xdolan.github.io/tsroj/" title="tsroj demo" width="100%" height="820" loading="lazy"></iframe>

Development

npm run test    # Vitest
npm run lint    # TypeScript + Biome
npm run build   # tsup → dist/

Branch flow: feature/* → develop → main.

Security

Static locale JSON only — no eval(), no prototype pollution vectors. See SECURITY.md.

License

GPL-3.0

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 4

Collected releases
VersionPublishedDirect dependenciesOpen version
1.0.6Registry latest26 Jun 20265
1.0.32 Apr 20265
1.0.11 Apr 20265
1.0.01 Apr 20265

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

PENDING
0xdolan/tsroj

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 23:05 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:feaac0f770c3380a5873f37b47f57d727f52e826ace8d5c212632a8eeb4a14b9