1.0.5 • Published 6 years ago

@guseyn/cutie-date v1.0.5

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

cutie-date

NPM Version Build Status codecov

Cutie extension for work with Date object in JavaScript. It's based on the Async Tree Pattern.

Examples

You can find examples of using this library in the test directory.

Install

npm install @cuties/date

Run test

npm test

Run build

npm run build

Usage

const {
  // Needed async objects here from the table below
} = require('@cuties/date');

For more information about parameters in the async objects visit MDN docs for Date global object.

Async ObjectAsync/sync callParameters(default value/description)Representation result
Datenew Date(...params)...paramsdate
DateAsStringdate.toStringdatestring
DateJSONdate.toJSONdatejson
DateStringdate.toDateStringdatestring
DateValuedate.valueOfdateprimitive value
DateWithDayOfMonthdate.setDatedate, daydate
DateWithFullYeardate.setFullYeardate, yeardate
DateWithHoursdate.setHoursdate, hoursdate
DateWithMillisecondsdate.setMillisecondsdate, millisecondsdate
DateWithMinutesdate.setMinutesdate, minutesdate
DateWithMonthdate.setMonthdate, monthdate
DateWithSecondsdate.setSecondsdate, secondsdate
DateWithTimedate.setTimedate, timedate
DateWithUTCDayOfMonthdate.setUTCDatedate, daydate
DateWithUTCFullYeardate.setUTCFullYeardate, yeardate
DateWithUTCHoursdate.setUTCHoursdate, hoursdate
DateWithUTCMillisecondsdate.setUTCMillisecondsdate, millisecondsdate
DateWithUTCMinutesdate.setUTCMinutesdate, minutesdate
DateWithUTCMonthdate.setUTCMonthdate, monthdate
DateWithUTCSecondsdate.setUTCSecondsdate, secondsdate
DateWithUTCTimedate.setUTCTimedate, timedate
DateWithYeardate.setYeardate, yeardate
DayOfMonthdate.getDatedatenumber
DayOfWeekdate.getDaydatenumber
FullYeardate.getFullYeardatenumber
GMTStringdate.toGMTStringdatestring
Hoursdate.getHoursdatenumber
ISOStringdate.toISOStringdatestring
LocaleDateStringdate.toLocaleDateStringdate, ...argsstring
LocaleTimeStringdate.toLocaleTimeStringdate, ...argsstring
Millisecondsdate.getMillisecondsdatenumber
Minutesdate.getMinutesdatenumber
Monthdate.getMonthdatenumber
NowDate.nowdate
ParsedDateDate.parsedatenumber(ms)
Secondsdate.getSecondsdatenumber
Timedate.getTimedatenumber(ms)
TimeStringdate.toTimeStringdatestring
TimezoneOffsetdate.getTimezoneOffsetdatenumber
UTCDate.UTC...paramsnumber(ms)
UTCDayOfMonthdate.getUTCDatedatenumber
UTCDayOfWeekdate.getUTCDaydatenumber
UTCFullYeardate.getUTCFullYeardatenumber
UTCHoursdate.getUTCHoursdatenumber
UTCMillisecondsdate.getUTCMillisecondsdatenumber
UTCMinutesdate.getUTCMinutesdatenumber
UTCMonthdate.getUTCMonthdatenumber
UTCSecondsdate.getUTCSecondsdatenumber
UTCStringdate.toUTCStringdatestring
Yeardate.getYeardatenumber