UNPKG

@dhutaryan/ngx-mat-timepicker

Version:

Angular timepicker to add time which is based on material design and Angular material.

46 lines (45 loc) 2.21 kB
import { TimeAdapter } from './time-adapter'; import { MatTimePeriodType } from '../time-period'; import * as i0 from "@angular/core"; /** Adapts the native JS Date for components that work with time. */ export declare class NativeDateTimeAdapter extends TimeAdapter<Date> { private readonly _matTimeLocale; constructor(matTimeLocale: string); now(): Date; parse(value: any, parseFormat?: any): Date | null; parseTime(value: string): { hour: number; minute: number; meridiem?: 'am' | 'pm'; }; getHour(date: Date): number; getMinute(date: Date): number; updateHour(date: Date, hour: number): Date; updateMinute(date: Date, minute: number): Date; getPeriod(date: Date): MatTimePeriodType; format(date: Date, displayFormat: Object): string; /** * Returns the given value if given a valid Date or null. Deserializes valid ISO 8601 strings * (https://www.ietf.org/rfc/rfc3339.txt) into valid Dates and empty string into null. Returns an * invalid date for all other values. */ deserialize(value: any): Date | null; isTimeInstance(obj: any): boolean; isValid(date: Date): boolean; invalid(): Date; compareTime(first: Date, second: Date): number; /** * When converting Date object to string, javascript built-in functions may return wrong * results because it applies its internal DST rules. The DST rules around the world change * very frequently, and the current valid rule is not always valid in previous years though. * We work around this problem building a new Date object which has its internal UTC * representation with the local date and time. * @param dtf Intl.DateTimeFormat object, containing the desired string format. It must have * timeZone set to 'utc' to work fine. * @param date Date from which we want to get the string representation according to dtf * @returns A Date object with its UTC representation based on the passed in date info */ private _format; static ɵfac: i0.ɵɵFactoryDeclaration<NativeDateTimeAdapter, [{ optional: true; }]>; static ɵprov: i0.ɵɵInjectableDeclaration<NativeDateTimeAdapter>; }