@shanecaf/duration-js
v0.1.9
Published
Fork of duration-js
Readme
Duration.js
A library for handling durations that uses the Temporal proposal polyfill.
This is a fork of Duration.js by icholy based on the golang_compatible branch.
Example
import { Duration, DiscordTimestamp } from '@shanecaf/duration-js';
const duration = new Duration('1w 2d');
console.log(duration.endDate()); // Outputs a Date object.
//Discord Timestamps:
console.log(duration.toDiscordTimestamp(DiscordTimestamp.LongDateTime)); //Outputs <t:[date_in_epoch_sec]:F> for Discord.Tests
Since this is a work in progress, there are no tests yet.
