@ilihub/week
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

@ilihub/week

TypeScript functions for converting day to other time units.

NPM Version NPM CodeFactor Socket Badge

Installation

# if you're using pnpm
pnpm add @ilihub/week

# or, if you're using npm
npm install @ilihub/week

# or, if you're using yarn
yarn add @ilihub/week

Usage

import { Week } from "@ilihub/week";

const week = new Week(1);

const milliseconds = week.toMillisecond();
console.log(milliseconds); // 604800000

const seconds = week.toSecond();
console.log(seconds); // 604800

const minutes = week.toMinute();
console.log(minutes); // 10080

const hours = week.toHour();
console.log(hours); // 168

const days = week.toDay();
console.log(days); // 7

const months = week.toMonth();
console.log(months); // 0.25

const years = week.toYear();
console.log(years); // 0.019230769230769232

const decades = week.toDecade();
console.log(decades); // 0.0019230769230769232

const centuries = week.toCentury();
console.log(centuries); // 0.00019230769230769232

Available Functions and Classes


Sponsors & Backers

Support the development of new open-source projects from ilihub through crowdfunding.

The core of ilihub is our crowd-funded open-source projects, licensed under the permissive MIT license. Sponsorship increases the rate of bug fixes, documentation improvements, and feature development.

Sponsors


Package Sidebar

Install

npm i @ilihub/week

Weekly Downloads

48

Version

1.0.1

License

MIT

Unpacked Size

12 kB

Total Files

5

Last publish

Collaborators

  • harshraj8843