@andrew_dominican/date-lib

1.0.1 • Public • Published

Date Library

npm NPM npm package minimized gzipped size (select exports) GitHub issues

Table of Contents

constructor

Constructor that initializes the date object.

Parameters

  • args ...any Arguments to be passed to the native Date object.

year

Gets the full year of the date.

Returns [number][16] The full year.

yr

Gets the last two digits of the year.

Returns [string][17] The short form of the year.

month

Gets the full name of the month.

Returns [string][17] The full month name.

mon

Gets the abbreviated form of the month.

Returns [string][17] The short form of the month.

day

Gets the day of the week.

Returns [string][17] The name of the day.

dy

Gets the abbreviated form of the day of the week.

Returns [string][17] The short form of the day name.

date

Gets the day of the month.

Returns [number][16] The date.

hours

Gets the hour of the day.

Returns [number][16] The hour.

mins

Gets the minutes of the hour.

Returns [number][16] The minutes.

secs

Gets the seconds of the minute.

Returns [number][16] The seconds.

format

Formats the date object.

Parameters

  • mask [string][17] The mask to format the date. (optional, default "Y M D")

Returns [string][17] The formatted date.

when

Describes how long ago or in the future the date is.

Returns [string][17] A string representation of the time difference.

Readme

Keywords

none

Package Sidebar

Install

npm i @andrew_dominican/date-lib

Weekly Downloads

17

Version

1.0.1

License

ISC

Unpacked Size

10.2 kB

Total Files

4

Last publish

Collaborators

  • andrew_dominican