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

1.0.1 • Public • Published

@ilihub/month

TypeScript functions for converting month to other time units.

NPM Version NPM CodeFactor Socket Badge

Installation

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

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

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

Usage

import { Month } from "@ilihub/month";

const month = new Month(1);

const milliseconds = month.toMillisecond();
console.log(milliseconds); // 2629800000

const seconds = month.toSecond();
console.log(seconds); // 2629800

const minutes = month.toMinute();
console.log(minutes); // 43830

const hours = month.toHour();
console.log(hours); // 720

const days = month.toDay();
console.log(days); // 30

const weeks = month.toWeek();
console.log(weeks); // 4

const years = month.toYear();
console.log(years); // 0.08333333333333333

const decades = month.toDecade();
console.log(decades); // 0.008333333333333333

const centuries = month.toCentury();
console.log(centuries); // 0.0008333333333333333

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/month

Weekly Downloads

212

Version

1.0.1

License

MIT

Unpacked Size

12.2 kB

Total Files

5

Last publish

Collaborators

  • harshraj8843