@angular/material-moment-adapter
- Version 19.0.5
- Published
- 42.6 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
Functions
Classes
MomentDateAdapter
- addCalendarDays()
- addCalendarMonths()
- addCalendarYears()
- addSeconds()
- clone()
- createDate()
- deserialize()
- format()
- getDate()
- getDateNames()
- getDayOfWeek()
- getDayOfWeekNames()
- getFirstDayOfWeek()
- getHours()
- getMinutes()
- getMonth()
- getMonthNames()
- getNumDaysInMonth()
- getSeconds()
- getYear()
- getYearName()
- invalid()
- isDateInstance()
- isValid()
- ɵfac
- ɵprov
- parse()
- parseTime()
- setLocale()
- setTime()
- today()
- toIso8601()
Interfaces
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
function provideMomentDateAdapter
provideMomentDateAdapter: ( formats?: MatDateFormats, options?: MatMomentDateAdapterOptions) => Provider[];
Classes
class MatMomentDateModule
class MatMomentDateModule {}
class MomentDateAdapter
class MomentDateAdapter extends DateAdapter<Moment> {}
Adapts Moment.js Dates for use with Angular Material.
constructor
constructor(...args: unknown[]);
property ɵfac
static ɵfac: i0.ɵɵFactoryDeclaration<MomentDateAdapter, never>;
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 addSeconds
addSeconds: (date: Moment, amount: 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 getHours
getHours: (date: Moment) => number;
method getMinutes
getMinutes: (date: Moment) => number;
method getMonth
getMonth: (date: Moment) => number;
method getMonthNames
getMonthNames: (style: 'long' | 'short' | 'narrow') => string[];
method getNumDaysInMonth
getNumDaysInMonth: (date: Moment) => number;
method getSeconds
getSeconds: (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 parseTime
parseTime: (value: any, parseFormat: string | string[]) => Moment | null;
method setLocale
setLocale: (locale: string) => void;
method setTime
setTime: ( target: Moment, hours: number, minutes: number, seconds: number) => Moment;
method today
today: () => Moment;
method toIso8601
toIso8601: (date: Moment) => string;
class MomentDateModule
class MomentDateModule {}
Interfaces
interface MatMomentDateAdapterOptions
interface MatMomentDateAdapterOptions {}
Configurable options for MomentDateAdapter.
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. Defaults to
false
.
Package Files (1)
Dependencies (1)
Dev Dependencies (0)
No dev dependencies.
Peer Dependencies (3)
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/@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>
- Updated .
Package analyzed in 2101 ms. - Missing or incorrect documentation? Open an issue for this package.