Skip to main content
Home

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
8 months ago (6.0.1)
class default

Constructors

new
default(initialDate?: TimeResolvable)

Properties

private
date: Date

Methods

add(
amount: number,
unit?: HumanUnit,
): this
clone(): HolyTime
endOf(
timeZone?: TimeZone,
): HolyTime
format(
format: string,
timeZone?: TimeZone,
): string
get<T extends "object" | GetUnit>(
unit: T,
timeZone?: TimeZone,
): T extends "object" ? Record<GetUnit, number> : number
next(
timeZone?: TimeZone,
): HolyTime
set(
unit: GetUnit,
value: number,
): this
startOf(
timeZone?: TimeZone,
): HolyTime
subtract(
amount: number,
unit?: HumanUnit,
): this

Static Properties

Static Methods

add(
amount: number,
unit?: HumanUnit,
): HolyTime
private
adjustToTimeZone(
date: Date,
timeZone?: TimeZone,
): Date
endOf(
timeZone?: TimeZone,
): HolyTime
format(
format: string | ((time: HolyTime) => string),
timeZone?: TimeZone,
): string
private
formatTimeZoneOffset(
offset: number,
long: boolean,
): string
private
formatWithLeadingZeros(
number: number,
length: number,
): string
private
getUnit(unit: HumanUnit): ValueOf<HolyTime.Units>
in(
amount: number,
unit?: HumanUnit,
): HolyTime
max(...times: TimeResolvable[]): HolyTime
min(...times: TimeResolvable[]): HolyTime
next(
timeZone?: TimeZone,
): HolyTime
now(): HolyTime
private
resolve(time: TimeResolvable): Date
startOf(
timeZone?: TimeZone,
): HolyTime
subtract(
amount: number,
unit?: HumanUnit,
): HolyTime

New Ticket: Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@badosz/holy-time

Import symbol

import module from "@badosz/holy-time";
or

Import directly with a jsr specifier

import module from "jsr:@badosz/holy-time";

Add Package

pnpm i jsr:@badosz/holy-time
or (using pnpm 10.8 or older)
pnpm dlx jsr add @badosz/holy-time

Import symbol

import module from "@badosz/holy-time";

Add Package

yarn add jsr:@badosz/holy-time
or (using Yarn 4.8 or older)
yarn dlx jsr add @badosz/holy-time

Import symbol

import module from "@badosz/holy-time";

Add Package

vlt install jsr:@badosz/holy-time

Import symbol

import module from "@badosz/holy-time";

Add Package

npx jsr add @badosz/holy-time

Import symbol

import module from "@badosz/holy-time";

Add Package

bunx jsr add @badosz/holy-time

Import symbol

import module from "@badosz/holy-time";