0.1.7 • Published 2 years ago

jiffy-time v0.1.7

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

jiffy-time

A decorator library for JS Date

This project is currently in beta, use at your own risk.

The Jiffy library is a wrapper library providing additional functions to standard Date objects. Jiffy objects are immutable and any calls on an object will hand back a new Jiffy object. Jiffy objects can be used to replace any standard JS Date object. All standard Date functions are available with the following additions:

addYears(Number yearsToAdd) - can take any positive on negative integer value
addMonths(Number monthsToAdd) - can take any positive on negative integer value
addDays(Number daysToAdd) - can take any positive on negative integer value
addHours(Number hoursToAdd) - can take any positive on negative integer value
addMinutes(Number minutesToAdd) - can take any positive on negative integer value
addSeconds(Number secondsToAdd) - can take any positive on negative integer value
firstDayOfMonth - returns a Jiffy object for the first of the given month, time is not affected
lastDayOfMonth - returns a Jiffy object for the last day of the given month, time is not affected
clearTime - returns a Jiffy object for the same day at midnight
maxTime(boolean setMilliseconds) - returns a Jiffy object for the same day at 23:59:59, false will set milliseconds to 0, true to 999
formatDate - returns a string value of the date, formatted YYYY-MM-DD
formatTime - returns a string value of the time, formatted HH:MM:SS
monthAsString - returns a string of the full month
isSameDay(Jiffy compareTo) - returns a boolean for whether the current Jiffy and the compareTo Jiffy are on the same day
asDate - returns a standard JS Date object

Please report any bugs to jonathancameron6@protonmail.com or fix it yourself! I'll examine any pull requests.

0.1.7

2 years ago

0.1.6

2 years ago

0.1.5

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.0

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago