Skip to main content

Yet another (type-safe) date time library

This package works with Cloudflare Workers, Node.js, Bun, BrowsersIt is unknown whether this package works with Deno
This package works with Cloudflare Workers
This package works with Node.js
It is unknown whether this package works with Deno
This package works with Bun
This package works with Browsers
JSR Score
70%
Published
3 months ago (6.0.1)

holyTime

Holy Time

License: MIT NPM version JSR version

Yet another (type-safe) date time library.

Installation

$ npm install holy-time

OR

$ yarn add holy-time

Resources

Examples

import HolyTime from 'holy-time'

HolyTime
  .in(4, 'days')
  .add(2, 'weeks')
  .subtract(4, 'minutes')
  .isWeekend()

HolyTime
  .between(
    HolyTime.add(HolyTime.startOf('day'), 2, 'hours'), 
    HolyTime.now()
  )
  .in('hours')

HolyTime.max(1666224000000, HolyTime.next('year'))

new HolyTime('2022-10-20')
  .isAfter(
    HolyTime.subtract(
      HolyTime.in(4, 'days'), 
      8, 'weeks'
    )
  )

HolyTime
  .duration(2, 'hours')
  .add(30, 'minutes')
  .in('seconds')

Add Package

deno add jsr:@badosz/holy-time

Import symbol

import * as holy_time from "@badosz/holy-time";

---- OR ----

Import directly with a jsr specifier

import * as holy_time from "jsr:@badosz/holy-time";

Add Package

npx jsr add @badosz/holy-time

Import symbol

import * as holy_time from "@badosz/holy-time";

Add Package

yarn dlx jsr add @badosz/holy-time

Import symbol

import * as holy_time from "@badosz/holy-time";

Add Package

pnpm dlx jsr add @badosz/holy-time

Import symbol

import * as holy_time from "@badosz/holy-time";

Add Package

bunx jsr add @badosz/holy-time

Import symbol

import * as holy_time from "@badosz/holy-time";