Skip to content

onesy-me/date

Repository files navigation



onesy logo

onesy Date

Time and date utils library


MIT license     Production ready     min 2.4kb gzipped     100% test cov     Tree shakable     Browser and Nodejs

Very simple code     Modern code     Junior friendly     Typescript     Made with πŸ’›


Sizes

OnesyDate 2.4kb gzipped
OnesyDate with all the methods 5.6kb gzipped
OnesyDate with all the methods and all the timezones 22kb gzipped

Getting started

Add

yarn add @onesy/date

Use

  import { OnesyDate, format } from '@onesy/date';

  // Make a new OnesyDate instance
  // with an optional initial value
  const onesyDate = new OnesyDate('2014-04-14T14:04:14.147');

  // Value
  onesyDate.value;

  // a Date instance, Mon Apr 14 2014 14:04:14 GMT+0200 (Central European Summer Time)

  // Format
  // with various ways to add regular text and variables
  format(onesyDate, `MM-DD-YYYY 'πŸ™‚' HH:mm:ss.SSS`);

  // '04-14-2014 πŸ™‚ 14:04:14.147'

Dev

Install

yarn

Test

yarn test

Prod

Build

yarn build