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 🙏

© 2025 – Pkg Stats / Ryan Hefner

faerun-date

v0.1.16

Published

Convert real-world dates into the Forgotten Realms (Faerûn) calendar format

Readme

📅 faerun-date

Release npm version GitHub Package

Convert real-world dates into the Forgotten Realms (Faerûn) calendar format.
Inspired by Dungeons & Dragons and the Harptos calendar.

faerun-date is a JavaScript library that transforms standard dates into the calendar system of Faerûn.
It includes months, 10-day weeks (tendays), seasonal cycles, and Faerûnian holidays like Greengrass and Midsummer.

⚠️ Note: This is a simplified model of the Harptos calendar. All months are fixed at 30 days, holidays are added to the count, and leap years are every 4 years (Shieldmeet). Day names are placeholders, not canonical.


✨ Features

  • 📅 Converts real-world dates to Faerûn calendar dates
  • 🗓️ Supports Faerûn-specific months and festivals
  • 🌱 Seasonal calculation (Spring, Summer, Autumn, Winter)
  • 📆 Week number support (Faerûn “tendays”)
  • 🕊️ Leap years with Shieldmeet (every 4 years, simplified)

📦 Installation

npm install faerun-date
# or
bun add faerun-date

🧙 Usage

import FaerunDate from 'faerun-date';

const date = new Date(1492, 4, 5); // 5 Mirtul 1492 (months are 0-based)
const faeDate = new FaerunDate(date, { faerunYear: 1492 });

console.log(faeDate.toLocaleString());
// Example: "Far, 05 Mirtul 1492 DR – Season: Spring – Week 19"

console.log(faeDate.getWeekOfYear());
// 19

📚 API

new FaerunDate(date, options?)

Creates a new Faerûn date from a real-world Date.
Options: { faerunYear?: number }


toLocaleString()

Returns a human-readable string:

Far, 05 Mirtul 1492 DR – Season: Spring – Week 19

getWeekday()

Returns the name of the current day in the 10-day week cycle:
Sul, Far, Tar, Sar, Rai, Zor, Kyth, Hamar, Ith, Alt.

Note: These labels are not canon; they represent tendays.


getMonth()

Returns the Faerûnian month name.


getSeason()

Returns the season:
Winter, Spring, Summer, or Autumn.


getFaerunYear()

Returns the current year in Dale Reckoning (DR), if provided via options.
Otherwise returns null.


getFestival()

Returns the name of the festival (Greengrass, Midwinter, etc.)
if the date matches one, otherwise null.


getWeekOfYear()

Returns the week (tenday) number of the year.


getFaerunDateString()

Returns a calendar-style string:

  • [Festival] Greengrass if the date is a festival
  • 05 Mirtul otherwise

static isLeapYear(year)

Returns true if divisible by 4.


static parse(dateString, options?)

Constructs a FaerunDate from a date string.


static toString(faerunDate)

Shortcut to .toLocaleString().


🧰 CLI Tool: Compare Weeks

This package includes a CLI tool to compare Gregorian weeks with Faerûn tendays.

npx faerun-compare-weeks --year 1489 --weeks 10

Example output:

Gregorian Week → Faerûn Tenday Correspondence for year 1489
Week 01 → Tenday 01 (Mon Jan 01 1489)
Week 02 → Tenday 02 (Mon Jan 08 1489)
...

Options

  • --year <YYYY> – Starting Gregorian year (default: current)
  • --weeks <N> – Number of weeks to display (default: 20)

Note: Gregorian weeks in the CLI are calculated with a simplified formula (new Date(year, 0, (week-1)*7+1)); not ISO‑8601.


⚠️ Limitations

  • All months are fixed at 30 days (simplification).
  • Leap years are every 4 years (Shieldmeet).
  • Day names are placeholders, not canon.
  • Faerûn year (DR) must be passed manually in options.
  • Some lore-specific details of Harptos are not modeled.

📜 License

Released under the MIT License.
© 2025 Cantilux