@matheo/datepicker
Version:
Angular material date+time picker
1 lines • 21.3 kB
Source Map (JSON)
{"version":3,"file":"matheo-datepicker-date-fns.mjs","sources":["../../../../libs/datepicker/date-fns/date-fns-locales.ts","../../../../libs/datepicker/date-fns/date-fns-adapter.ts","../../../../libs/datepicker/date-fns/date-fns-formats.ts","../../../../libs/datepicker/date-fns/index.ts","../../../../libs/datepicker/date-fns/matheo-datepicker-date-fns.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\nimport { Locale } from 'date-fns';\n\nexport const MAT_DATE_FNS_LOCALES = new InjectionToken<Locale[]>(\n 'MAT_DATE_FNS_LOCALES'\n);\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport { Inject, Injectable, Optional, InjectionToken } from '@angular/core';\nimport { MAT_DATE_LOCALE } from '@angular/material/core';\nimport { DateAdapter } from '@matheo/datepicker/core';\nimport {\n addDays,\n addMonths,\n addYears,\n format,\n getDate,\n getDay,\n getDaysInMonth,\n getMonth,\n getYear,\n Locale,\n parse,\n parseISO,\n setDay,\n setMonth,\n toDate,\n parseJSON,\n getHours,\n getMinutes,\n getMilliseconds,\n setMinutes,\n getSeconds,\n setSeconds,\n setHours,\n addHours,\n addMinutes,\n addSeconds,\n} from 'date-fns';\nimport { zonedTimeToUtc } from 'date-fns-tz/esm';\nimport { enUS } from 'date-fns/esm/locale';\nimport { MAT_DATE_FNS_LOCALES } from './date-fns-locales';\n\nconst UTC_TIMEZONE = 'UTC';\n\n/** Configurable options for {@see DateFnsAdapter}. */\nexport interface MatDateFnsAdapterOptions {\n /**\n * Turns the use of utc dates on or off.\n * Changing this will change how Angular Material components like DatePicker output dates.\n * {@default false}\n */\n useUtc: boolean;\n}\n\n/** InjectionToken for DateFnsAdapter to configure options. */\nexport const MAT_DATE_FNS_ADAPTER_OPTIONS = new InjectionToken<MatDateFnsAdapterOptions>(\n 'MAT_DATE_FNS_ADAPTER_OPTIONS',\n {\n providedIn: 'root',\n factory: MAT_DATE_FNS_ADAPTER_OPTIONS_FACTORY,\n }\n);\n\n/** @docs-private */\nexport function MAT_DATE_FNS_ADAPTER_OPTIONS_FACTORY(): MatDateFnsAdapterOptions {\n return {\n useUtc: false,\n };\n}\n\n/** Creates an array of numbers. */\nfunction range(start: number, end: number): number[] {\n const arr: number[] = [];\n for (let i = start; i <= end; i++) {\n arr.push(i);\n }\n return arr;\n}\n\n/** Adapts date-fns Dates for use with Angular Material. */\n@Injectable()\nexport class DateFnsAdapter extends DateAdapter<Date> {\n private _dateFnsLocale: Locale;\n\n constructor(\n @Optional() @Inject(MAT_DATE_LOCALE) dateLocale: string,\n @Inject(MAT_DATE_FNS_LOCALES) private locales: Locale[],\n @Optional()\n @Inject(MAT_DATE_FNS_ADAPTER_OPTIONS)\n private options?: MatDateFnsAdapterOptions\n ) {\n super();\n\n try {\n this.setLocale(dateLocale || enUS);\n } catch (err) {\n this.setLocale(enUS);\n }\n }\n\n setLocale(locale: string | Locale) {\n if (!locale) {\n throw new Error(\n 'setLocale should be called with the string locale code or date-fns Locale object'\n );\n }\n this._dateFnsLocale = this.getLocale(locale);\n super.setLocale(locale);\n }\n\n private getLocale = (localeCodeOrLocale: string | Locale): Locale => {\n if (localeCodeOrLocale && (localeCodeOrLocale as Locale).code) {\n return localeCodeOrLocale as Locale;\n }\n if (!this.locales || !this.locales.length) {\n throw new Error('locales array does not provided or is empty');\n }\n const locale = this.locales.find(\n (item) => item.code === localeCodeOrLocale\n );\n if (!locale) {\n throw new Error(`locale '${localeCodeOrLocale}' does not exist`);\n }\n return locale;\n };\n\n getYear(date: Date): number {\n return getYear(date);\n }\n\n getMonth(date: Date): number {\n return getMonth(date);\n }\n\n getDate(date: Date): number {\n return getDate(date);\n }\n\n getHours(date: Date): number {\n return getHours(date);\n }\n\n setHours(date: Date, hours: number): Date {\n return setHours(date, hours);\n }\n\n getMinutes(date: Date): number {\n return getMinutes(date);\n }\n\n setMinutes(date: Date, minutes: number): Date {\n return setMinutes(date, minutes);\n }\n\n getSeconds(date: Date): number {\n return getSeconds(date);\n }\n\n setSeconds(date: Date, seconds: number, ms?: number): Date {\n return setSeconds(date, seconds);\n }\n\n getMilliseconds(date: Date): number {\n return getMilliseconds(date);\n }\n\n getDayOfWeek(date: Date): number {\n return getDay(date);\n }\n\n getMonthNames(style: 'long' | 'short' | 'narrow'): string[] {\n const map = {\n long: 'LLLL',\n short: 'LLL',\n narrow: 'LLLLL',\n };\n\n const formatStr = map[style];\n const date = new Date();\n\n return range(0, 11).map((month) =>\n format(setMonth(date, month), formatStr, {\n locale: this._dateFnsLocale,\n })\n );\n }\n\n getDateNames(): string[] {\n return range(1, 31).map((day) => String(day));\n }\n\n getHourNames(): string[] {\n return range(0, 23).map((i) => (i === 0 ? '00' : String(i)));\n }\n\n getMinuteNames(): string[] {\n return range(0, 59).map(String);\n }\n\n getDayOfWeekNames(style: 'long' | 'short' | 'narrow'): string[] {\n const map = {\n long: 'EEEE',\n short: 'EEE',\n narrow: 'EEEEE',\n };\n\n const formatStr = map[style];\n const date = new Date();\n\n return range(0, 6).map((month) =>\n format(setDay(date, month), formatStr, {\n locale: this._dateFnsLocale,\n })\n );\n }\n\n getYearName(date: Date): string {\n return format(date, 'yyyy', {\n locale: this._dateFnsLocale,\n });\n }\n\n getFirstDayOfWeek(): number {\n return this._dateFnsLocale.options.weekStartsOn;\n }\n\n getNumDaysInMonth(date: Date): number {\n return getDaysInMonth(date);\n }\n\n clone(date: Date): Date {\n return toDate(date);\n }\n\n createDate(\n year: number,\n month: number,\n date: number,\n hours: number = 0,\n minutes: number = 0,\n seconds: number = 0,\n ms: number = 0\n ): Date {\n if (month < 0 || month > 11) {\n throw Error(\n `Invalid month index \"${month}\". Month index has to be between 0 and 11.`\n );\n }\n\n if (date < 1) {\n throw Error(`Invalid date \"${date}\". Date has to be greater than 0.`);\n }\n\n const result = this._createDateWithOverflow(\n year,\n month,\n date,\n hours,\n minutes,\n seconds,\n ms\n );\n // Check that the date wasn't above the upper bound for the month, causing the month to overflow\n if (result.getMonth() !== month) {\n throw Error(`Invalid date \"${date}\" for month with index \"${month}\".`);\n }\n\n return result;\n }\n\n today(): Date {\n return new Date();\n }\n\n parse(value: any, parseFormat: any): Date | null {\n if (value) {\n if (typeof value === 'string') {\n if (this.options.useUtc) {\n const d = parse(value.trim(), parseFormat, new Date(), {\n locale: this._dateFnsLocale,\n });\n return zonedTimeToUtc(d, UTC_TIMEZONE);\n }\n return parse(value.trim(), parseFormat, new Date(), {\n locale: this._dateFnsLocale,\n });\n }\n if (typeof value === 'number') {\n return toDate(value);\n }\n if (value instanceof Date) {\n return this.clone(value as Date);\n }\n return null;\n }\n return null;\n }\n\n format(date: Date, displayFormat: string): string {\n return format(date, displayFormat, { locale: this._dateFnsLocale });\n }\n\n addCalendarYears(date: Date, years: number): Date {\n return addYears(date, years);\n }\n\n addCalendarMonths(date: Date, months: number): Date {\n return addMonths(date, months);\n }\n\n addCalendarDays(date: Date, days: number): Date {\n return addDays(date, days);\n }\n\n addCalendarHours(date: Date, hours: number): Date {\n return addHours(date, hours);\n }\n\n addCalendarMinutes(date: Date, minutes: number): Date {\n return addMinutes(date, minutes);\n }\n\n addCalendarSeconds(date: Date, seconds: number, ms?: number): Date {\n return addSeconds(date, seconds);\n }\n\n toIso8601(date: Date): string {\n return date.toISOString();\n }\n\n deserialize(value: any): Date | null {\n if (value) {\n if (typeof value === 'string') {\n if (this.options.useUtc) {\n return parseJSON(value);\n }\n return parseISO(value);\n }\n if (typeof value === 'number') {\n return toDate(value);\n }\n if (value instanceof Date) {\n return this.clone(value as Date);\n }\n return null;\n }\n return null;\n }\n\n isDateInstance(obj: any): boolean {\n return obj instanceof Date;\n }\n\n isValid(date: Date): boolean {\n return date instanceof Date && !isNaN(date.getTime());\n }\n\n invalid(): Date {\n return new Date(NaN);\n }\n\n /** Creates a date but allows the month and date to overflow. */\n private _createDateWithOverflow(\n year: number,\n month: number,\n date: number,\n hours: number = 0,\n minutes: number = 0,\n seconds: number = 0,\n ms: number = 0\n ): Date {\n const result = this._createDateInternal(\n year,\n month,\n date,\n hours,\n minutes,\n seconds,\n ms\n );\n\n // We need to correct for the fact that JS native Date treats years in range [0, 99] as\n // abbreviations for 19xx.\n if (year >= 0 && year < 100) {\n result.setFullYear(this.getYear(result) - 1900);\n }\n return result;\n }\n\n private _createDateInternal(\n year: number,\n month: number,\n date: number,\n hours?: number,\n minutes?: number,\n seconds?: number,\n ms?: number\n ): Date {\n if (this.options.useUtc) {\n return zonedTimeToUtc(\n new Date(year, month, date, hours, minutes, seconds, ms),\n UTC_TIMEZONE\n );\n }\n return new Date(year, month, date, hours, minutes, seconds, ms);\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport { MatDateFormats } from '@matheo/datepicker/core';\n\n// https://date-fns.org/v2.21.3/docs/format\n\nexport const MAT_DATE_FNS_FORMATS: MatDateFormats = {\n parse: {\n dateInput: 'P',\n datetimeInput: 'f',\n timeInput: 'H:mm',\n monthInput: 'MMM',\n yearInput: 'yyyy',\n },\n display: {\n dateInput: 'P',\n datetimeInput: 'Pp',\n timeInput: 'p',\n monthInput: 'MMM yyyy',\n yearInput: 'yyyy',\n dateA11yLabel: 'PP',\n monthLabel: 'MMM',\n monthDayLabel: 'MMM d',\n monthDayA11yLabel: 'MMMM d',\n monthYearLabel: 'MMM yyyy',\n monthYearA11yLabel: 'MMMM yyyy',\n timeLabel: 'p',\n },\n};\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport { NgModule } from '@angular/core';\nimport {\n DateAdapter as MaterialDateAdapter,\n MAT_DATE_FORMATS,\n MAT_DATE_LOCALE,\n} from '@angular/material/core';\nimport { DateAdapter } from '@matheo/datepicker/core';\nimport {\n MAT_DATE_FNS_ADAPTER_OPTIONS,\n DateFnsAdapter,\n} from './date-fns-adapter';\nimport { MAT_DATE_FNS_FORMATS } from './date-fns-formats';\nimport { MAT_DATE_FNS_LOCALES } from './date-fns-locales';\n\nexport * from './date-fns-adapter';\nexport * from './date-fns-formats';\nexport * from './date-fns-locales';\n\n@NgModule({\n providers: [\n {\n provide: DateAdapter,\n useClass: DateFnsAdapter,\n deps: [MAT_DATE_LOCALE, MAT_DATE_FNS_LOCALES, MAT_DATE_FNS_ADAPTER_OPTIONS],\n },\n {\n provide: MaterialDateAdapter,\n useClass: DateFnsAdapter,\n deps: [MAT_DATE_LOCALE, MAT_DATE_FNS_LOCALES, MAT_DATE_FNS_ADAPTER_OPTIONS],\n },\n ],\n})\nexport class DateFnsModule {}\n\n@NgModule({\n imports: [DateFnsModule],\n providers: [\n { provide: MAT_DATE_FORMATS, useValue: MAT_DATE_FNS_FORMATS },\n { provide: MAT_DATE_FNS_LOCALES, useValue: [] },\n ],\n})\nexport class MatDateFnsModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["MaterialDateAdapter"],"mappings":";;;;;;;;MAGa,oBAAoB,GAAG,IAAI,cAAc,CACpD,sBAAsB;;ACJxB;;;;;;;AA2CA,MAAM,YAAY,GAAG,KAAK,CAAC;AAY3B;MACa,4BAA4B,GAAG,IAAI,cAAc,CAC5D,8BAA8B,EAC9B;IACE,UAAU,EAAE,MAAM;IAClB,OAAO,EAAE,oCAAoC;CAC9C,EACD;AAEF;SACgB,oCAAoC;IAClD,OAAO;QACL,MAAM,EAAE,KAAK;KACd,CAAC;AACJ,CAAC;AAED;AACA,SAAS,KAAK,CAAC,KAAa,EAAE,GAAW;IACvC,MAAM,GAAG,GAAa,EAAE,CAAC;IACzB,KAAK,IAAI,CAAC,GAAG,KAAK,EAAE,CAAC,IAAI,GAAG,EAAE,CAAC,EAAE,EAAE;QACjC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC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