1.1.0 • Published 2 years ago

@zach-shearer/dates-library v1.1.0

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

Dates Library

This utility library makes it easy to work with dates.

Installation

npm install @zach-shearer/dates-library

Class Atributes

D.year // 2022
D.yr // 22
D.month // September
D.mon // Sep
D.day // Thursday
D.dy // Thu
D.date // 1
D.hours // 8
D.mins // 7
D.secs // 32

Class Functionality

format()

const d = new D('9/1/2022')

d.format('M D, Y') // September 1, 2022
d.format('m d, y') // Sep 01, 22
LetterReturnExample
YFull year2022
yShort year22
MFull MonthSeptember
mShort MonthSep
DDay of month2
dDay of month padded02
HHour of day7
hHour of day padded07
IMinute of day2
iMinute of day padded02
SSecond of day5
sSecond of day padded05

when()

const middleOfSeptember = new D('9/15/2022')
const beginningOfJuly = new D('7/1/2022')

middleOfSeptember.when() // 14 day(s) from now
beginningOfJuly.when() // 2 month(s) ago
1.1.0

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago