@date-io/moment

  • Version 2.15.0
  • Published
  • 39.1 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

class MomentUtils

class MomentUtils implements IUtils<defaultMoment.Moment> {}

    constructor

    constructor({ locale, formats, instance }?: Opts);

      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 date

                    date: (value?: any) => 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 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 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 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 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;

                                                                                                              property parseISO

                                                                                                              parseISO: (isoString: string) => 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;

                                                                                                                                      Namespaces

                                                                                                                                      namespace @date-io/type

                                                                                                                                      module '@date-io/type' {}

                                                                                                                                        type DateType

                                                                                                                                        type DateType = Moment;

                                                                                                                                          Package Files (3)

                                                                                                                                          Dependencies (1)

                                                                                                                                          Dev Dependencies (3)

                                                                                                                                          Peer Dependencies (1)

                                                                                                                                          Badge

                                                                                                                                          To add a badge like this onejsDocs.io badgeto 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>