@angular/material-moment-adapter

  • Version 12.0.4
  • Published
  • 139 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: any;
  • InjectionToken for moment date adapter to configure options.

variable MAT_MOMENT_DATE_FORMATS

const MAT_MOMENT_DATE_FORMATS: any;

    Functions

    function MAT_MOMENT_DATE_ADAPTER_OPTIONS_FACTORY

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

    Classes

    class MatMomentDateModule

    class MatMomentDateModule {}

      class MomentDateAdapter

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

      constructor

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

        method addCalendarDays

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

          method addCalendarMonths

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

            method addCalendarYears

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

              method clone

              clone: (date: any) => any;

                method createDate

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

                  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: any, displayFormat: string) => string;

                    method getDate

                    getDate: (date: any) => number;

                      method getDateNames

                      getDateNames: () => string[];

                        method getDayOfWeek

                        getDayOfWeek: (date: any) => number;

                          method getDayOfWeekNames

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

                            method getFirstDayOfWeek

                            getFirstDayOfWeek: () => number;

                              method getMonth

                              getMonth: (date: any) => number;

                                method getMonthNames

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

                                  method getNumDaysInMonth

                                  getNumDaysInMonth: (date: any) => number;

                                    method getYear

                                    getYear: (date: any) => number;

                                      method getYearName

                                      getYearName: (date: any) => string;

                                        method invalid

                                        invalid: () => any;

                                          method isDateInstance

                                          isDateInstance: (obj: any) => boolean;

                                            method isValid

                                            isValid: (date: any) => boolean;

                                              method parse

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

                                                method setLocale

                                                setLocale: (locale: string) => void;

                                                  method today

                                                  today: () => any;

                                                    method toIso8601

                                                    toIso8601: (date: any) => string;

                                                      class MomentDateModule

                                                      class MomentDateModule {}

                                                        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 (4)

                                                        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>