@angular/material-moment-adapter

  • Version 14.0.4
  • Published
  • 103 kB
  • 1 dependency
  • MIT license

Install

npm i @angular/material-moment-adapter
yarn add @angular/material-moment-adapter
pnpm add @angular/material-moment-adapter

Overview

Angular Material Moment Adapter

Index

Variables

variable MAT_MOMENT_DATE_ADAPTER_OPTIONS

const MAT_MOMENT_DATE_ADAPTER_OPTIONS: InjectionToken<MatMomentDateAdapterOptions>;
  • InjectionToken for moment date adapter to configure options.

variable MAT_MOMENT_DATE_FORMATS

const MAT_MOMENT_DATE_FORMATS: MatDateFormats;

    Functions

    function MAT_MOMENT_DATE_ADAPTER_OPTIONS_FACTORY

    MAT_MOMENT_DATE_ADAPTER_OPTIONS_FACTORY: () => MatMomentDateAdapterOptions;
    • @docs-private

    Classes

    class MatMomentDateModule

    class MatMomentDateModule {}

      property ɵfac

      static ɵfac: i0.ɵɵFactoryDeclaration<MatMomentDateModule, never>;

        property ɵinj

        static ɵinj: i0.ɵɵInjectorDeclaration<MatMomentDateModule>;

          property ɵmod

          static ɵmod: i0.ɵɵNgModuleDeclaration<
          MatMomentDateModule,
          never,
          [typeof MomentDateModule],
          never
          >;

            class MomentDateAdapter

            class MomentDateAdapter extends DateAdapter<Moment> {}
            • Adapts Moment.js Dates for use with Angular Material.

            constructor

            constructor(dateLocale: string, _options?: MatMomentDateAdapterOptions);

              property ɵfac

              static ɵfac: i0.ɵɵFactoryDeclaration<
              MomentDateAdapter,
              [{ optional: true }, { optional: true }]
              >;

                property ɵprov

                static ɵprov: i0.ɵɵInjectableDeclaration<MomentDateAdapter>;

                  method addCalendarDays

                  addCalendarDays: (date: Moment, days: number) => Moment;

                    method addCalendarMonths

                    addCalendarMonths: (date: Moment, months: number) => Moment;

                      method addCalendarYears

                      addCalendarYears: (date: Moment, years: number) => Moment;

                        method clone

                        clone: (date: Moment) => Moment;

                          method createDate

                          createDate: (year: number, month: number, date: number) => Moment;

                            method deserialize

                            deserialize: (value: any) => Moment | null;
                            • Returns the given value if given a valid Moment or null. Deserializes valid ISO 8601 strings (https://www.ietf.org/rfc/rfc3339.txt) and valid Date objects into valid Moments and empty string into null. Returns an invalid date for all other values.

                            method format

                            format: (date: Moment, displayFormat: string) => string;

                              method getDate

                              getDate: (date: Moment) => number;

                                method getDateNames

                                getDateNames: () => string[];

                                  method getDayOfWeek

                                  getDayOfWeek: (date: Moment) => number;

                                    method getDayOfWeekNames

                                    getDayOfWeekNames: (style: 'long' | 'short' | 'narrow') => string[];

                                      method getFirstDayOfWeek

                                      getFirstDayOfWeek: () => number;

                                        method getMonth

                                        getMonth: (date: Moment) => number;

                                          method getMonthNames

                                          getMonthNames: (style: 'long' | 'short' | 'narrow') => string[];

                                            method getNumDaysInMonth

                                            getNumDaysInMonth: (date: Moment) => number;

                                              method getYear

                                              getYear: (date: Moment) => number;

                                                method getYearName

                                                getYearName: (date: Moment) => string;

                                                  method invalid

                                                  invalid: () => Moment;

                                                    method isDateInstance

                                                    isDateInstance: (obj: any) => boolean;

                                                      method isValid

                                                      isValid: (date: Moment) => boolean;

                                                        method parse

                                                        parse: (value: any, parseFormat: string | string[]) => Moment | null;

                                                          method setLocale

                                                          setLocale: (locale: string) => void;

                                                            method today

                                                            today: () => Moment;

                                                              method toIso8601

                                                              toIso8601: (date: Moment) => string;

                                                                class MomentDateModule

                                                                class MomentDateModule {}

                                                                  property ɵfac

                                                                  static ɵfac: i0.ɵɵFactoryDeclaration<MomentDateModule, never>;

                                                                    property ɵinj

                                                                    static ɵinj: i0.ɵɵInjectorDeclaration<MomentDateModule>;

                                                                      property ɵmod

                                                                      static ɵmod: i0.ɵɵNgModuleDeclaration<MomentDateModule, never, never, never>;

                                                                        Interfaces

                                                                        interface MatMomentDateAdapterOptions

                                                                        interface MatMomentDateAdapterOptions {}
                                                                        • Configurable options for .

                                                                        property strict

                                                                        strict?: boolean;
                                                                        • When enabled, the dates have to match the format exactly. See https://momentjs.com/guides/#/parsing/strict-mode/.

                                                                        property useUtc

                                                                        useUtc?: boolean;
                                                                        • Turns the use of utc dates on or off. Changing this will change how Angular Material components like DatePicker output dates.

                                                                        Package Files (1)

                                                                        Dependencies (1)

                                                                        Dev Dependencies (0)

                                                                        No dev dependencies.

                                                                        Peer Dependencies (3)

                                                                        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/@angular/material-moment-adapter.

                                                                        • Markdown
                                                                          [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@angular/material-moment-adapter)
                                                                        • HTML
                                                                          <a href="https://www.jsdocs.io/package/@angular/material-moment-adapter"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>