date_extentions
TypeScript icon, indicating that this package has built-in type declarations

1.0.21 • Public • Published

Date utils

Easy Date formatting and date creation utilities to streamline working with dates.



to Format dates import the formats enum

import { Formats } from "date_extentions/lib/FormatesEnum";

` format to any of the available formats

let newDate = new Date();
newDate.toFormat(Formats['YYYY-MM-DD HH:MM']))

to create dates from formatted strings:


import { ExtendDate } from 'date_extentions/lib/ExtendDate'
import { Formats } from 'date_extentions/lib/FormatsEnum';

...
const dateString = '2022-07-29';
const newDate = ExtendDate.dateFrom( dateString, Formats['YYYY-MM-DD']);

avilable formats:

  • YYYY-MM-DD

  • MM/DD/YY

  • YY/MM/DD

  • DD/MM/YY

  • YYYY-MMDDTHH:MM:SS

  • YYYYMMDDHHMMSS

  • YYYY-MM-DD HH:MM

  • YYYYMMDD

  • More formats will be added with time

Readme

Keywords

Package Sidebar

Install

npm i date_extentions

Weekly Downloads

52

Version

1.0.21

License

ISC

Unpacked Size

19 kB

Total Files

12

Last publish

Collaborators

  • yzeek