MomentJS API Manual
Guide
Function
- moment()
- moment(undefined)
- moment([])
- moment({})
- moment(String)
- moment(String, String)
- moment(String, String, String)
- moment(String, String, Boolean)
- moment(String, String, String, Boolean)
- moment(String, String[], String, Boolean)
- moment(String, moment.CUSTOM_FORMAT, [String], [Boolean])
- moment(String, moment.HTML_FMT.DATETIME_LOCAL, [String], [Boolean])
- moment(String, [..., moment.ISO_8601, ...], [String], [Boolean])
- moment({unit: value, ...})
- moment(Number)
- moment.unix(Number)
- moment(Date)
- moment(Number[])
- moment(Moment)
- moment.utc()
- moment.utc(Number)
- moment.utc(Number[])
- moment.utc(String)
- moment.utc(String, String)
- moment.utc(String, String[])
- moment.utc(String, String, String)
- moment.utc(String, String, Boolean)
- moment.utc(String, String, String, Boolean)
- moment.utc(Moment)
- moment.utc(Date)
- moment.parseZone()
- moment.parseZone(String)
- moment.parseZone(String, String)
- moment.parseZone(String, [String])
- moment.parseZone(String, String, Boolean)
- moment.parseZone(String, String, String, Boolean)
- moment().isValid()
- moment().creationData()
- "moment(""15"", ""hh"")"
- moment().millisecond(Number)
- moment().millisecond()
- moment().milliseconds(Number)
- moment().milliseconds()
- moment().second(Number)
- moment().second()
- moment().seconds(Number)
- moment().seconds()
- moment().minute(Number)
- moment().minute()
- moment().minutes(Number)
- moment().minutes()
- moment().hour(Number)
- moment().hour()
- moment().hours(Number)
- moment().hours()
- moment().date(Number)
- moment().date()
- moment().dates(Number)
- moment().dates()
- moment().day(Number|String)
- moment().day()
- moment().days(Number|String)
- moment().days()
- moment().weekday(Number)
- moment().weekday()
- moment().isoWeekday(Number)
- moment().isoWeekday()
- moment().dayOfYear(Number)
- moment().dayOfYear()
- moment().week(Number)
- moment().week()
- moment().weeks(Number)
- moment().weeks()
- moment().isoWeek(Number)
- moment().isoWeek()
- moment().isoWeeks(Number)
- moment().isoWeeks()
- moment().month(Number|String)
- moment().month()
- moment().months(Number|String)
- moment().months()
- moment().quarter()
- moment().quarter(Number)
- moment().quarters()
- moment().quarters(Number)
- moment().year(Number)
- moment().year()
- moment().years(Number)
- moment().years()
- moment().weekYear(Number)
- moment().weekYear()
- moment().isoWeekYear(Number)
- moment().isoWeekYear()
- moment().weeksInYear()
- moment().isoWeeksInYear()
- moment().get('year')
- moment().get('month')
- moment().get('date')
- moment().get('hour')
- moment().get('minute')
- moment().get('second')
- moment().get('millisecond')
- moment().set(String, Int)
- moment().set(Object(String, Int))
- moment.max(Moment[,Moment...])
- moment.max(Moment[])
- moment.min(Moment[,Moment...])
- moment.min(Moment[])
- moment().add(Number, String)
- moment().add(Duration)
- moment().add(Object)
- moment().subtract(Number, String)
- moment().subtract(Duration)
- moment().subtract(Object)
- moment().startOf(String)
- moment().endOf(String)
- moment().max(Moment|String|Number|Date|Array)
- moment().min(Moment|String|Number|Date|Array)
- moment().local()
- moment().utc()
- moment().utcOffset()
- moment().utcOffset(Number|String)
- moment().utcOffset(Number|String, Boolean)
- moment().zone()
- moment().zone(Number|String)
- moment().format()
- moment().format(String)
- moment().fromNow()
- moment().fromNow(Boolean)
- moment().from(Moment|String|Number|Date|Array)
- moment().from(Moment|String|Number|Date|Array, Boolean)
- moment().toNow()
- moment().toNow(Boolean)
- moment().to(Moment|String|Number|Date|Array)
- moment().to(Moment|String|Number|Date|Array, Boolean)
- moment().calendar()
- moment().calendar(referenceTime)
- moment().calendar(referenceTime, formats)
- moment().diff(Moment|String|Number|Date|Array)
- moment().diff(Moment|String|Number|Date|Array, String)
- moment().diff(Moment|String|Number|Date|Array, String, Boolean)
- moment().valueOf()
- +moment()
- moment().unix()
- moment().daysInMonth()
- moment().toDate()
- moment().toArray()
- moment().toJSON()
- moment().toISOString()
- moment().toISOString(keepOffset)
- moment().toObject()
- moment().toString()
- moment().inspect()
- moment().isBefore(Moment|String|Number|Date|Array)
- moment().isBefore(Moment|String|Number|Date|Array, String)
- moment().isSame(Moment|String|Number|Date|Array)
- moment().isSame(Moment|String|Number|Date|Array, String)
- moment().isAfter(Moment|String|Number|Date|Array)
- moment().isAfter(Moment|String|Number|Date|Array, String)
- moment().isSameOrBefore(Moment|String|Number|Date|Array)
- moment().isSameOrBefore(Moment|String|Number|Date|Array, String)
- moment().isSameOrAfter(Moment|String|Number|Date|Array)
- moment().isSameOrAfter(Moment|String|Number|Date|Array, String)
- moment().isBetween(moment-like, moment-like)
- moment().isBetween(moment-like, moment-like, String)
- moment().isBetween(moment-like, moment-like, String, String)
- moment().isDST()
- moment('2013-03-10 2:30', 'YYYY-MM-DD HH:mm').isDSTShifted()
- moment().isLeapYear()
- moment.isMoment(obj)
- moment.isDate(obj)
- moment.locale(String)
- moment.locale(String[])
- moment.locale(String, Object)
- moment.lang(String)
- moment.lang(String[])
- moment.lang(String, Object)
- moment().locale(String|Boolean)
- moment().lang(String|Boolean)
- moment.locale()
- moment.lang()
- moment.months()
- moment.monthsShort()
- moment.weekdays()
- moment.weekdaysShort()
- moment.weekdaysMin()
- localeData = moment.localeData()
- localeData.months(Moment)
- localeData.months()
- localeData.monthsShort(Moment)
- localeData.monthsShort()
- localeData.monthsParse(String)
- localeData.weekdays(Moment)
- localeData.weekdays()
- localeData.weekdays(Boolean) ## Added 2.24.0, sorts weekdays by locale
- localeData.weekdaysShort(Moment)
- localeData.weekdaysShort()
- localeData.weekdaysShort(Boolean) ## Added 2.24.0, sorts weekdays by locale
- localeData.weekdaysMin(Moment)
- localeData.weekdaysMin()
- localeData.weekdaysMin(Boolean) ## Added 2.24.0, sorts weekdays by locale
- localeData.weekdaysParse(String)
- localeData.longDateFormat(String)
- localeData.isPM(String)
- localeData.meridiem(Number, Number, Boolean)
- localeData.calendar(String, Moment)
- localeData.relativeTime(Number, Boolean, String, Boolean)
- localeData.pastFuture(Number, String)
- localeData.ordinal(Number)
- localeData.preparse(String)
- localeData.postformat(String)
- localeData.week(Moment)
- localeData.invalidDate()
- localeData.firstDayOfWeek()
- localeData.firstDayOfYear()
- moment.locale('x-pseudo')
- moment.relativeTimeThreshold(unit)
- moment.relativeTimeThreshold(unit, limit)
- moment.relativeTimeRounding()
- moment.relativeTimeRounding(fn)
- moment.now = function () { return +new Date()
- moment.duration(Number, String)
- moment.duration(Number)
- moment.duration(Object)
- moment.duration(String)
- moment.duration().clone()
- moment.duration().humanize()
- moment.duration().milliseconds()
- moment.duration().asMilliseconds()
- moment.duration().seconds()
- moment.duration().asSeconds()
- moment.duration().minutes()
- moment.duration().asMinutes()
- moment.duration().hours()
- moment.duration().asHours()
- moment.duration().days()
- moment.duration().asDays()
- moment.duration().weeks()
- moment.duration().asWeeks()
- moment.duration().months()
- moment.duration().asMonths()
- moment.duration().years()
- moment.duration().asYears()
- moment.duration().add(Number, String)
- moment.duration().add(Number)
- moment.duration().add(Duration)
- moment.duration().add(Object)
- moment.duration().subtract(Number, String)
- moment.duration().subtract(Number)
- moment.duration().subtract(Duration)
- moment.duration().subtract(Object)
- var duration = moment.duration(x.diff(y))
- moment.duration().as(String)
- moment.duration().get(String)
- moment.duration().toJSON()
- moment.isDuration(obj)
- moment.duration().toISOString()
- moment.duration().locale()
- moment.duration().locale(String)
- moment.normalizeUnits(String)
- moment.invalid(Object)