source: trip-planner-front/node_modules/@angular/material/core/datetime/native-date-adapter.d.ts.__ivy_ngcc_bak@ 6c1585f

Last change on this file since 6c1585f was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 3.9 KB
Line 
1/**
2 * @license
3 * Copyright Google LLC All Rights Reserved.
4 *
5 * Use of this source code is governed by an MIT-style license that can be
6 * found in the LICENSE file at https://angular.io/license
7 */
8import { Platform } from '@angular/cdk/platform';
9import { DateAdapter } from './date-adapter';
10/** Adapts the native JS Date for use with cdk-based components that work with dates. */
11export declare class NativeDateAdapter extends DateAdapter<Date> {
12 /** Whether to clamp the date between 1 and 9999 to avoid IE and Edge errors. */
13 private readonly _clampDate;
14 /**
15 * Whether to use `timeZone: 'utc'` with `Intl.DateTimeFormat` when formatting dates.
16 * Without this `Intl.DateTimeFormat` sometimes chooses the wrong timeZone, which can throw off
17 * the result. (e.g. in the en-US locale `new Date(1800, 7, 14).toLocaleDateString()`
18 * will produce `'8/13/1800'`.
19 *
20 * TODO(mmalerba): drop this variable. It's not being used in the code right now. We're now
21 * getting the string representation of a Date object from its utc representation. We're keeping
22 * it here for sometime, just for precaution, in case we decide to revert some of these changes
23 * though.
24 */
25 useUtcForDisplay: boolean;
26 constructor(matDateLocale: string, platform: Platform);
27 getYear(date: Date): number;
28 getMonth(date: Date): number;
29 getDate(date: Date): number;
30 getDayOfWeek(date: Date): number;
31 getMonthNames(style: 'long' | 'short' | 'narrow'): string[];
32 getDateNames(): string[];
33 getDayOfWeekNames(style: 'long' | 'short' | 'narrow'): string[];
34 getYearName(date: Date): string;
35 getFirstDayOfWeek(): number;
36 getNumDaysInMonth(date: Date): number;
37 clone(date: Date): Date;
38 createDate(year: number, month: number, date: number): Date;
39 today(): Date;
40 parse(value: any): Date | null;
41 format(date: Date, displayFormat: Object): string;
42 addCalendarYears(date: Date, years: number): Date;
43 addCalendarMonths(date: Date, months: number): Date;
44 addCalendarDays(date: Date, days: number): Date;
45 toIso8601(date: Date): string;
46 /**
47 * Returns the given value if given a valid Date or null. Deserializes valid ISO 8601 strings
48 * (https://www.ietf.org/rfc/rfc3339.txt) into valid Dates and empty string into null. Returns an
49 * invalid date for all other values.
50 */
51 deserialize(value: any): Date | null;
52 isDateInstance(obj: any): boolean;
53 isValid(date: Date): boolean;
54 invalid(): Date;
55 /** Creates a date but allows the month and date to overflow. */
56 private _createDateWithOverflow;
57 /**
58 * Pads a number to make it two digits.
59 * @param n The number to pad.
60 * @returns The padded number.
61 */
62 private _2digit;
63 /**
64 * Strip out unicode LTR and RTL characters. Edge and IE insert these into formatted dates while
65 * other browsers do not. We remove them to make output consistent and because they interfere with
66 * date parsing.
67 * @param str The string to strip direction characters from.
68 * @returns The stripped string.
69 */
70 private _stripDirectionalityCharacters;
71 /**
72 * When converting Date object to string, javascript built-in functions may return wrong
73 * results because it applies its internal DST rules. The DST rules around the world change
74 * very frequently, and the current valid rule is not always valid in previous years though.
75 * We work around this problem building a new Date object which has its internal UTC
76 * representation with the local date and time.
77 * @param dtf Intl.DateTimeFormat object, containg the desired string format. It must have
78 * timeZone set to 'utc' to work fine.
79 * @param date Date from which we want to get the string representation according to dtf
80 * @returns A Date object with its UTC representation based on the passed in date info
81 */
82 private _format;
83}
Note: See TracBrowser for help on using the repository browser.