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 🙏

© 2024 – Pkg Stats / Ryan Hefner

rpg-calendar

v0.1.0

Published

Low level library for working with RPG/Fantasy dates

Downloads

8

Readme

RPG Calendar

THIS IS CURRENTLY A WORK IN PROGRESS

I will remove this message, when this library is ready for "prime-time"

About

This is a silly little project related to a much bigger (and even more silly) project. The point of this library is to work with fantasy calendars in a way that make it easy to create UIs.

Example Calendar UI using this library: steamedcotton.github.io/rpg-calendar

Usage

import { RPGCalendar, calendars } from 'rpg-calendar';

// Create a new Calendar using the Harptos Extra Days configuration.  This will add the "special" days as extra days
// at the end of each month.  If you want the days to be separate months, then you can use
// calendars.harptos.extraMonths.
const cal = new RPGCalendar(calendars.harptos.extraDays);

// Use the calandar to parse an epoch
console.log(cal.epochToDate('500-11:57:30'));

// Helpful format for working with months (to use when creating user interfaces)
const monthToDisplay = cal.getDisplayMonth({ year: 1856, month: 4 }};

Built in Calendars

So far just one with a couple options.

Harptos

It was a little difficult to find a source of truth of details around the calendar of Harptos. As best as I can tell, these assumptions are true and they are what I used to implement the configurations in calendars.harptos:

  • There is a year 0. There are several references (like this one) to Year 0 - "The Year of the Rising Flame".
  • Year 0 was a leap year. I didn't find anything about this other than "every 4 years" and this makes it a little more consistent for the negative years (e.g. years -4, 0, 4 are all leap years).

Here are the two calendar settings for Harptos in code:

import { calendars } from 'rpg-calendar';

// Use this calendar if you want the extra "special" days to be included in the preceeding month. 
// calendars.harptos.extraDays

// Use this calendar if you want the extra "special" days to each be their own month.  This means that there 
// will be 17 months in a year.
// calendars.harptos.extraMonths

References

I used the following for references and inspiration: