UNPKG

ngx-mat-datefns-date-adapter

Version:

[![NPM](https://img.shields.io/npm/l/ngx-mat-datefns-date-adapter)](https://github.com/sapozhnikovay/ngx-mat-datefns-date-adapter/blob/master/LICENSE) [![npm](https://img.shields.io/npm/v/ngx-mat-datefns-date-adapter)](https://www.npmjs.com/package/ngx-ma

43 lines (42 loc) 1.85 kB
import { InjectionToken } from '@angular/core'; import { DateAdapter } from '@angular/material/core'; import { Locale } from 'date-fns'; export interface NgxDateFnsDateAdapterOptions { useUtc?: boolean; } export declare const NGX_MAT_DATEFNS_DATE_ADAPTER_OPTIONS: InjectionToken<NgxDateFnsDateAdapterOptions>; export declare function NGX_MAT_DATEFNS_DATE_ADAPTER_OPTIONS_FACTORY(): NgxDateFnsDateAdapterOptions; export declare class NgxDateFnsDateAdapter extends DateAdapter<Date> { private locales; private options?; private _dateFnsLocale; private getLocale; constructor(dateLocale: string | null, locales: Locale[] | null, options?: NgxDateFnsDateAdapterOptions); setLocale(locale: string | Locale): void; addCalendarDays(date: Date, days: number): Date; addCalendarMonths(date: Date, months: number): Date; addCalendarYears(date: Date, years: number): Date; clone(date: Date): Date; createDate(year: number, month: number, date: number): Date; deserialize(value: any): Date | null; format(date: Date, displayFormat: string): string; getDate(date: Date): number; getDateNames(): string[]; getDayOfWeek(date: Date): number; getDayOfWeekNames(style: 'long' | 'short' | 'narrow'): string[]; getFirstDayOfWeek(): number; getMonth(date: Date): number; getMonthNames(style: 'long' | 'short' | 'narrow'): string[]; getNumDaysInMonth(date: Date): number; getYear(date: Date): number; getYearName(date: Date): string; invalid(): Date; isDateInstance(obj: any): boolean; isValid(date: Date): boolean; parse(value: any, parseFormat: any): Date | null; toIso8601(date: Date): string; today(): Date; /** Creates a date but allows the month and date to overflow. */ private _createDateWithOverflow; private _createDateInternal; }