@ce1pers/date-helpers
TypeScript icon, indicating that this package has built-in type declarations

1.2.0 • Public • Published

@ce1pers/date-helpers

Simple helpers related to date or time.

Installation

npm

npm i @ce1pers/date-helpers

yarn

yarn add @ce1pers/date-helpers

Links

Usage

// Import Library.
import { getPassedTime, convertDateToEight, convertEightToDate, makeCalendar } from "@ce1pers/date-helpers";

// Set datetime.
const date = new Date("2022-11-19T21:30:00");

// Get passed time.
const passedTime = getPassedTime(date);
console.log(passedTime);

// Convert to eight digit time.
const eight = convertDateToEight(date);
console.log(eight);

// Convert to date.
const convertedDate = convertEightToDate(eight);
console.log(convertedDate);

// Make current month calendar.
const currentMonthCalendar = makeCalendar(date.getFullYear(), date.getMonth() + 1);
console.log(currentMonthCalendar);

Package Sidebar

Install

npm i @ce1pers/date-helpers

Weekly Downloads

3

Version

1.2.0

License

MIT

Unpacked Size

46.7 kB

Total Files

27

Last publish

Collaborators

  • __coma__