@date-io/moment
- Version 3.2.0
- Published
- 40.9 kB
- 1 dependency
- MIT license
Install
npm i @date-io/moment
yarn add @date-io/moment
pnpm add @date-io/moment
Overview
Abstraction over common javascript date management libraries
Index
Classes
MomentUtils
- addDays
- addHours
- addMinutes
- addMonths
- addSeconds
- addWeeks
- addYears
- date()
- endOfDay
- endOfMonth
- endOfWeek
- endOfYear
- format
- formatByString
- formatNumber
- formats
- getCurrentLocaleCode
- getDate
- getDaysInMonth
- getDiff
- getFormatHelperText
- getHours
- getMeridiemText
- getMinutes
- getMonth
- getMonthArray
- getNextMonth
- getPreviousMonth
- getSeconds
- getWeek
- getWeekArray
- getWeekdays
- getYear
- getYearRange
- is12HourCycleInCurrentLocale
- isAfter
- isAfterDay
- isAfterMonth
- isAfterYear
- isBefore
- isBeforeDay
- isBeforeMonth
- isBeforeYear
- isEqual
- isNull
- isSameDay
- isSameHour
- isSameMonth
- isSameYear
- isValid
- isWithinRange
- lib
- locale
- mergeDateAndTime
- moment
- parse
- parseISO
- setDate
- setHours
- setMinutes
- setMonth
- setSeconds
- setYear
- startOfDay
- startOfMonth
- startOfWeek
- startOfYear
- toISO
- toJsDate
Classes
class MomentUtils
class MomentUtils implements IUtils<defaultMoment.Moment, string> {}
constructor
constructor({ locale, formats, instance,}?: { formats?: DateIOFormats; locale?: string; instance?: any;});
property addDays
addDays: (date: defaultMoment.Moment, count: number) => defaultMoment.Moment;
property addHours
addHours: (date: defaultMoment.Moment, count: number) => defaultMoment.Moment;
property addMinutes
addMinutes: (date: defaultMoment.Moment, count: number) => defaultMoment.Moment;
property addMonths
addMonths: (date: defaultMoment.Moment, count: number) => defaultMoment.Moment;
property addSeconds
addSeconds: (date: defaultMoment.Moment, count: number) => defaultMoment.Moment;
property addWeeks
addWeeks: (date: defaultMoment.Moment, count: number) => defaultMoment.Moment;
property addYears
addYears: (date: defaultMoment.Moment, count: number) => defaultMoment.Moment;
property endOfDay
endOfDay: (date: defaultMoment.Moment) => defaultMoment.Moment;
property endOfMonth
endOfMonth: (date: defaultMoment.Moment) => defaultMoment.Moment;
property endOfWeek
endOfWeek: (date: defaultMoment.Moment) => defaultMoment.Moment;
property endOfYear
endOfYear: (date: defaultMoment.Moment) => defaultMoment.Moment;
property format
format: (date: defaultMoment.Moment, formatKey: keyof DateIOFormats) => string;
property formatByString
formatByString: (date: defaultMoment.Moment, formatString: string) => string;
property formatNumber
formatNumber: (numberToFormat: string) => string;
property formats
formats: DateIOFormats;
property getCurrentLocaleCode
getCurrentLocaleCode: () => string;
property getDate
getDate: (date: defaultMoment.Moment) => number;
property getDaysInMonth
getDaysInMonth: (date: defaultMoment.Moment) => number;
property getDiff
getDiff: ( date: defaultMoment.Moment, comparing: Moment | string, unit?: Unit) => number;
property getFormatHelperText
getFormatHelperText: (format: string) => string;
property getHours
getHours: (date: defaultMoment.Moment) => number;
property getMeridiemText
getMeridiemText: (ampm: 'am' | 'pm') => string;
property getMinutes
getMinutes: (date: defaultMoment.Moment) => number;
property getMonth
getMonth: (date: defaultMoment.Moment) => number;
property getMonthArray
getMonthArray: (date: defaultMoment.Moment) => defaultMoment.Moment[];
property getNextMonth
getNextMonth: (date: defaultMoment.Moment) => defaultMoment.Moment;
property getPreviousMonth
getPreviousMonth: (date: defaultMoment.Moment) => defaultMoment.Moment;
property getSeconds
getSeconds: (date: defaultMoment.Moment) => number;
property getWeek
getWeek: (date: defaultMoment.Moment) => number;
property getWeekArray
getWeekArray: (date: defaultMoment.Moment) => defaultMoment.Moment[][];
property getWeekdays
getWeekdays: () => string[];
property getYear
getYear: (date: defaultMoment.Moment) => number;
property getYearRange
getYearRange: ( start: defaultMoment.Moment, end: defaultMoment.Moment) => defaultMoment.Moment[];
property is12HourCycleInCurrentLocale
is12HourCycleInCurrentLocale: () => boolean;
property isAfter
isAfter: (date: defaultMoment.Moment, value: defaultMoment.Moment) => boolean;
property isAfterDay
isAfterDay: (date: defaultMoment.Moment, value: defaultMoment.Moment) => boolean;
property isAfterMonth
isAfterMonth: ( date: defaultMoment.Moment, value: defaultMoment.Moment) => boolean;
property isAfterYear
isAfterYear: ( date: defaultMoment.Moment, value: defaultMoment.Moment) => boolean;
property isBefore
isBefore: (date: defaultMoment.Moment, value: defaultMoment.Moment) => boolean;
property isBeforeDay
isBeforeDay: ( date: defaultMoment.Moment, value: defaultMoment.Moment) => boolean;
property isBeforeMonth
isBeforeMonth: ( date: defaultMoment.Moment, value: defaultMoment.Moment) => boolean;
property isBeforeYear
isBeforeYear: ( date: defaultMoment.Moment, value: defaultMoment.Moment) => boolean;
property isEqual
isEqual: (value: any, comparing: any) => boolean;
property isNull
isNull: (date: defaultMoment.Moment) => boolean;
property isSameDay
isSameDay: ( date: defaultMoment.Moment, comparing: defaultMoment.Moment) => boolean;
property isSameHour
isSameHour: ( date: defaultMoment.Moment, comparing: defaultMoment.Moment) => boolean;
property isSameMonth
isSameMonth: ( date: defaultMoment.Moment, comparing: defaultMoment.Moment) => boolean;
property isSameYear
isSameYear: ( date: defaultMoment.Moment, comparing: defaultMoment.Moment) => boolean;
property isValid
isValid: (value: any) => boolean;
property isWithinRange
isWithinRange: ( date: defaultMoment.Moment, [start, end]: [Moment, Moment]) => boolean;
property lib
lib: string;
property locale
locale?: string;
property mergeDateAndTime
mergeDateAndTime: ( date: defaultMoment.Moment, time: defaultMoment.Moment) => defaultMoment.Moment;
property moment
moment: any;
property parse
parse: (value: string, format: string) => defaultMoment.Moment | null;
property parseISO
parseISO: (isoString: string) => defaultMoment.Moment;
property setDate
setDate: (date: defaultMoment.Moment, year: number) => defaultMoment.Moment;
property setHours
setHours: (date: defaultMoment.Moment, count: number) => defaultMoment.Moment;
property setMinutes
setMinutes: (date: defaultMoment.Moment, count: number) => defaultMoment.Moment;
property setMonth
setMonth: (date: defaultMoment.Moment, count: number) => defaultMoment.Moment;
property setSeconds
setSeconds: (date: defaultMoment.Moment, count: number) => defaultMoment.Moment;
property setYear
setYear: (date: defaultMoment.Moment, year: number) => defaultMoment.Moment;
property startOfDay
startOfDay: (date: defaultMoment.Moment) => defaultMoment.Moment;
property startOfMonth
startOfMonth: (date: defaultMoment.Moment) => defaultMoment.Moment;
property startOfWeek
startOfWeek: (date: defaultMoment.Moment) => defaultMoment.Moment;
property startOfYear
startOfYear: (date: defaultMoment.Moment) => defaultMoment.Moment;
property toISO
toISO: (value: defaultMoment.Moment) => string;
property toJsDate
toJsDate: (value: defaultMoment.Moment) => Date;
method date
date: < TArg extends unknown = undefined, TRes extends unknown = TArg extends null ? null : TArg extends undefined ? defaultMoment.Moment : any>( value?: TArg) => TRes;
Package Files (2)
Dependencies (1)
Dev Dependencies (3)
Peer Dependencies (1)
Badge
To add a badge like this oneto your package's README, use the codes available below.
You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@date-io/moment
.
- Markdown[![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@date-io/moment)
- HTML<a href="https://www.jsdocs.io/package/@date-io/moment"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
Package analyzed in 3179 ms. - Missing or incorrect documentation? Open an issue for this package.