@the-/date
Date utility for the-framework
Installation
$ npm install @the-/date --save
Usage
'use strict'
const theDate = require('@the-/date')
async function tryExample() {
console.log(theDate().addHours(3).toDate()) // 3 hours later
const date = theDate('2016/10/10', { lang: 'ja' })
console.log(date.format('lll')) // -> "2016年10月10日 00:00"
}
tryExample().catch((err) => console.error(err))
API Guide
- AddMixed
- #add(amount,unit)
- #addDay(day)
- #addDays(days)
- #addHour(hour)
- #addHours(hours)
- #addMillisecond(millisecond)
- #addMilliseconds(milliseconds)
- #addMinute(minute)
- #addMinutes(minutes)
- #addMonth(month)
- #addMonths(months)
- #addQuarter(quarter)
- #addQuarters(quarters)
- #addSecond(second)
- #addSeconds(seconds)
- #addWeek(week)
- #addWeeks(weeks)
- #addYear(year)
- #addYears(years)
- EndOfMixed
- GetMixed
- module:@the-/date
- module:@the-/date.mixins
- module:@the-/date.mixins.addMix
- module:@the-/date.mixins.endOf
- module:@the-/date.mixins.getMix
- module:@the-/date.mixins.momentMix
- module:@the-/date.mixins.setMix
- module:@the-/date.mixins.startOfMix
- module:@the-/date.mixins.subtractMix
- MomentMixed
- SetMixed
- StartOfMixed
- SubtractMixed
- #subtract(amount,unit)
- #subtractDay(day)
- #subtractDays(days)
- #subtractHour(hour)
- #subtractHours(hours)
- #subtractMillisecond(millisecond)
- #subtractMilliseconds(milliseconds)
- #subtractMinute(minute)
- #subtractMinutes(minutes)
- #subtractMonth(month)
- #subtractMonths(months)
- #subtractQuarter(quarter)
- #subtractQuarters(quarters)
- #subtractSecond(second)
- #subtractSeconds(seconds)
- #subtractWeek(week)
- #subtractWeeks(weeks)
- #subtractYear(year)
- #subtractYears(years)
- TheDate
See API Guide for more detail
License
This software is released under the MIT License.