Skip to main content

A set of functions to make working with dates easier. Stop re writing date utils

Works with
It is unknown whether this package works with Bun
It is unknown whether this package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
It is unknown whether this package works with Browsers
JSR Score
100%
Published
a month ago (0.1.2)

Boxothings Dates

This is a package full of helper functions around the Date Object.

Examples

Example 1

import { daysSince } from "jsr:@boxothings/dates";

const date = new Date("2020-01-01T00:00:00Z");
daysSince(date);
  • daysBetween which returns the difference in days between two dates.

Example 2

import { daysBetween } from "jsr:@boxothings/dates";

const date1st = new Date("2020-01-01T00:00:00Z");
const date3rd = new Date("2020-01-03T00:00:00Z");
daysBetween(date1st, date3rd);
//returns 2
Built and signed on
GitHub Actions
View transparency log

Add Package

deno add @boxothings/dates

Import symbol

import * as mod from "@boxothings/dates";

Add Package

npx jsr add @boxothings/dates

Import symbol

import * as mod from "@boxothings/dates";

Add Package

yarn dlx jsr add @boxothings/dates

Import symbol

import * as mod from "@boxothings/dates";

Add Package

pnpm dlx jsr add @boxothings/dates

Import symbol

import * as mod from "@boxothings/dates";

Add Package

bunx jsr add @boxothings/dates

Import symbol

import * as mod from "@boxothings/dates";