@angular/material-moment-adapter 8.1.4 → 8.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/material-moment-adapter.umd.js +11 -8
- package/bundles/material-moment-adapter.umd.js.map +1 -1
- package/bundles/material-moment-adapter.umd.min.js +1 -1
- package/bundles/material-moment-adapter.umd.min.js.map +1 -1
- package/esm2015/material-moment-adapter.js +8 -3
- package/esm2015/material-moment-adapter.js.map +1 -1
- package/esm5/material-moment-adapter.es5.js +11 -8
- package/esm5/material-moment-adapter.es5.js.map +1 -1
- package/package.json +5 -5
- package/typings/adapter/moment-date-adapter.d.ts +6 -1
- package/typings/esm5/adapter/moment-date-adapter.d.ts +6 -1
- package/typings/esm5/index.metadata.json +1 -1
- package/typings/index.metadata.json +1 -1
|
@@ -438,21 +438,24 @@ var MomentDateAdapter = /** @class */ (function (_super) {
|
|
|
438
438
|
/**
|
|
439
439
|
* Creates a Moment instance while respecting the current UTC settings.
|
|
440
440
|
* @private
|
|
441
|
-
* @param {
|
|
441
|
+
* @param {?} date
|
|
442
|
+
* @param {?=} format
|
|
443
|
+
* @param {?=} locale
|
|
442
444
|
* @return {?}
|
|
443
445
|
*/
|
|
444
446
|
MomentDateAdapter.prototype._createMoment = /**
|
|
445
447
|
* Creates a Moment instance while respecting the current UTC settings.
|
|
446
448
|
* @private
|
|
447
|
-
* @param {
|
|
449
|
+
* @param {?} date
|
|
450
|
+
* @param {?=} format
|
|
451
|
+
* @param {?=} locale
|
|
448
452
|
* @return {?}
|
|
449
453
|
*/
|
|
450
|
-
function () {
|
|
451
|
-
var
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
return (this._options && this._options.useUtc) ? moment.utc.apply(moment, args) : moment.apply(void 0, args);
|
|
454
|
+
function (date, format, locale) {
|
|
455
|
+
var _a = this._options || {}, strict = _a.strict, useUtc = _a.useUtc;
|
|
456
|
+
return useUtc
|
|
457
|
+
? moment.utc(date, format, locale, strict)
|
|
458
|
+
: moment(date, format, locale, strict);
|
|
456
459
|
};
|
|
457
460
|
MomentDateAdapter.decorators = [
|
|
458
461
|
{ type: core.Injectable },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"material-moment-adapter.umd.js","sources":["../../src/material-moment-adapter/adapter/index.ts","../../src/material-moment-adapter/adapter/moment-date-formats.ts","../../src/material-moment-adapter/adapter/moment-date-adapter.ts","../../node_modules/tslib/tslib.es6.js"],"sourcesContent":["/**\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 {DateAdapter, MAT_DATE_FORMATS, MAT_DATE_LOCALE} from '@angular/material/core';\nimport {MAT_MOMENT_DATE_ADAPTER_OPTIONS, MomentDateAdapter} from './moment-date-adapter';\nimport {MAT_MOMENT_DATE_FORMATS} from './moment-date-formats';\n\nexport * from './moment-date-adapter';\nexport * from './moment-date-formats';\n\n@NgModule({\n providers: [\n {\n provide: DateAdapter,\n useClass: MomentDateAdapter,\n deps: [MAT_DATE_LOCALE, MAT_MOMENT_DATE_ADAPTER_OPTIONS]\n }\n ],\n})\nexport class MomentDateModule {}\n\n\n@NgModule({\n imports: [MomentDateModule],\n providers: [{provide: MAT_DATE_FORMATS, useValue: MAT_MOMENT_DATE_FORMATS}],\n})\nexport class MatMomentDateModule {}\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 '@angular/material/core';\n\n\nexport const MAT_MOMENT_DATE_FORMATS: MatDateFormats = {\n parse: {\n dateInput: 'l',\n },\n display: {\n dateInput: 'l',\n monthYearLabel: 'MMM YYYY',\n dateA11yLabel: 'LL',\n monthYearA11yLabel: 'MMMM YYYY',\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 {Inject, Injectable, Optional, InjectionToken} from '@angular/core';\nimport {DateAdapter, MAT_DATE_LOCALE} from '@angular/material/core';\n// Depending on whether rollup is used, moment needs to be imported differently.\n// Since Moment.js doesn't have a default export, we normally need to import using the `* as`\n// syntax. However, rollup creates a synthetic default module and we thus need to import it using\n// the `default as` syntax.\n// TODO(mmalerba): See if we can clean this up at some point.\nimport * as _moment from 'moment';\n// tslint:disable-next-line:no-duplicate-imports\nimport {default as _rollupMoment, Moment} from 'moment';\n\nconst moment = _rollupMoment || _moment;\n\n/** Configurable options for {@see MomentDateAdapter}. */\nexport interface MatMomentDateAdapterOptions {\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 moment date adapter to configure options. */\nexport const MAT_MOMENT_DATE_ADAPTER_OPTIONS = new InjectionToken<MatMomentDateAdapterOptions>(\n 'MAT_MOMENT_DATE_ADAPTER_OPTIONS', {\n providedIn: 'root',\n factory: MAT_MOMENT_DATE_ADAPTER_OPTIONS_FACTORY\n});\n\n\n/** @docs-private */\nexport function MAT_MOMENT_DATE_ADAPTER_OPTIONS_FACTORY(): MatMomentDateAdapterOptions {\n return {\n useUtc: false\n };\n}\n\n\n/** Creates an array and fills it with values. */\nfunction range<T>(length: number, valueFunction: (index: number) => T): T[] {\n const valuesArray = Array(length);\n for (let i = 0; i < length; i++) {\n valuesArray[i] = valueFunction(i);\n }\n return valuesArray;\n}\n\n\n/** Adapts Moment.js Dates for use with Angular Material. */\n@Injectable()\nexport class MomentDateAdapter extends DateAdapter<Moment> {\n // Note: all of the methods that accept a `Moment` input parameter immediately call `this.clone`\n // on it. This is to ensure that we're working with a `Moment` that has the correct locale setting\n // while avoiding mutating the original object passed to us. Just calling `.locale(...)` on the\n // input would mutate the object.\n\n private _localeData: {\n firstDayOfWeek: number,\n longMonths: string[],\n shortMonths: string[],\n dates: string[],\n longDaysOfWeek: string[],\n shortDaysOfWeek: string[],\n narrowDaysOfWeek: string[]\n };\n\n constructor(@Optional() @Inject(MAT_DATE_LOCALE) dateLocale: string,\n @Optional() @Inject(MAT_MOMENT_DATE_ADAPTER_OPTIONS)\n private _options?: MatMomentDateAdapterOptions) {\n\n super();\n this.setLocale(dateLocale || moment.locale());\n }\n\n setLocale(locale: string) {\n super.setLocale(locale);\n\n let momentLocaleData = moment.localeData(locale);\n this._localeData = {\n firstDayOfWeek: momentLocaleData.firstDayOfWeek(),\n longMonths: momentLocaleData.months(),\n shortMonths: momentLocaleData.monthsShort(),\n dates: range(31, (i) => this.createDate(2017, 0, i + 1).format('D')),\n longDaysOfWeek: momentLocaleData.weekdays(),\n shortDaysOfWeek: momentLocaleData.weekdaysShort(),\n narrowDaysOfWeek: momentLocaleData.weekdaysMin(),\n };\n }\n\n getYear(date: Moment): number {\n return this.clone(date).year();\n }\n\n getMonth(date: Moment): number {\n return this.clone(date).month();\n }\n\n getDate(date: Moment): number {\n return this.clone(date).date();\n }\n\n getDayOfWeek(date: Moment): number {\n return this.clone(date).day();\n }\n\n getMonthNames(style: 'long' | 'short' | 'narrow'): string[] {\n // Moment.js doesn't support narrow month names, so we just use short if narrow is requested.\n return style == 'long' ? this._localeData.longMonths : this._localeData.shortMonths;\n }\n\n getDateNames(): string[] {\n return this._localeData.dates;\n }\n\n getDayOfWeekNames(style: 'long' | 'short' | 'narrow'): string[] {\n if (style == 'long') {\n return this._localeData.longDaysOfWeek;\n }\n if (style == 'short') {\n return this._localeData.shortDaysOfWeek;\n }\n return this._localeData.narrowDaysOfWeek;\n }\n\n getYearName(date: Moment): string {\n return this.clone(date).format('YYYY');\n }\n\n getFirstDayOfWeek(): number {\n return this._localeData.firstDayOfWeek;\n }\n\n getNumDaysInMonth(date: Moment): number {\n return this.clone(date).daysInMonth();\n }\n\n clone(date: Moment): Moment {\n return date.clone().locale(this.locale);\n }\n\n createDate(year: number, month: number, date: number): Moment {\n // Moment.js will create an invalid date if any of the components are out of bounds, but we\n // explicitly check each case so we can throw more descriptive errors.\n if (month < 0 || month > 11) {\n throw Error(`Invalid month index \"${month}\". Month index has to be between 0 and 11.`);\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._createMoment({year, month, date}).locale(this.locale);\n\n // If the result isn't valid, the date must have been out of bounds for this month.\n if (!result.isValid()) {\n throw Error(`Invalid date \"${date}\" for month with index \"${month}\".`);\n }\n\n return result;\n }\n\n today(): Moment {\n return this._createMoment().locale(this.locale);\n }\n\n parse(value: any, parseFormat: string | string[]): Moment | null {\n if (value && typeof value == 'string') {\n return this._createMoment(value, parseFormat, this.locale);\n }\n return value ? this._createMoment(value).locale(this.locale) : null;\n }\n\n format(date: Moment, displayFormat: string): string {\n date = this.clone(date);\n if (!this.isValid(date)) {\n throw Error('MomentDateAdapter: Cannot format invalid date.');\n }\n return date.format(displayFormat);\n }\n\n addCalendarYears(date: Moment, years: number): Moment {\n return this.clone(date).add({years});\n }\n\n addCalendarMonths(date: Moment, months: number): Moment {\n return this.clone(date).add({months});\n }\n\n addCalendarDays(date: Moment, days: number): Moment {\n return this.clone(date).add({days});\n }\n\n toIso8601(date: Moment): string {\n return this.clone(date).format();\n }\n\n /**\n * Returns the given value if given a valid Moment or null. Deserializes valid ISO 8601 strings\n * (https://www.ietf.org/rfc/rfc3339.txt) and valid Date objects into valid Moments and empty\n * string into null. Returns an invalid date for all other values.\n */\n deserialize(value: any): Moment | null {\n let date;\n if (value instanceof Date) {\n date = this._createMoment(value).locale(this.locale);\n } else if (this.isDateInstance(value)) {\n // Note: assumes that cloning also sets the correct locale.\n return this.clone(value);\n }\n if (typeof value === 'string') {\n if (!value) {\n return null;\n }\n date = this._createMoment(value, moment.ISO_8601).locale(this.locale);\n }\n if (date && this.isValid(date)) {\n return this._createMoment(date).locale(this.locale);\n }\n return super.deserialize(value);\n }\n\n isDateInstance(obj: any): boolean {\n return moment.isMoment(obj);\n }\n\n isValid(date: Moment): boolean {\n return this.clone(date).isValid();\n }\n\n invalid(): Moment {\n return moment.invalid();\n }\n\n /** Creates a Moment instance while respecting the current UTC settings. */\n private _createMoment(...args: any[]): Moment {\n return (this._options && this._options.useUtc) ? moment.utc(...args) : moment(...args);\n }\n}\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)\r\n t[p[i]] = s[p[i]];\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator], i = 0;\r\n if (m) return m.call(o);\r\n return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n"],"names":["MAT_DATE_FORMATS","NgModule","MAT_DATE_LOCALE","DateAdapter","Optional","Inject","Injectable","tslib_1.__extends","InjectionToken","_rollupMoment","_moment"],"mappings":";;;;;;;;;;;;;;;AGAA;;;;;;;;;;;;;;;;AAgBA,IAAI,aAAa,GAAG,SAAS,CAAC,EAAE,CAAC,EAAE;IAC/B,aAAa,GAAG,MAAM,CAAC,cAAc;SAChC,EAAE,SAAS,EAAE,EAAE,EAAE,YAAY,KAAK,IAAI,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,SAAS,GAAG,CAAC,CAAC,EAAE,CAAC;QAC5E,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,KAAK,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAC/E,OAAO,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;CAC9B,CAAC;;AAEF,AAAO,SAAS,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE;IAC5B,a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ACD,OAAO,EAAE;QACP,SAAS,EAAE,GAAG;QACd,cAAc,EAAE,UAAU;QAC1B,aAAa,EAAE,IAAI;QACnB,kBAAkB,EAAE,WAAW;KAChC;CACF,CAAD;;;;;;ADLA,AAAA,IAAA,gBAAA,kBAAA,YAAA;IAAA,SAAA,gBAAA,GAAA;KASgC;;QAThC,EAAA,IAAA,EAACF,aAAQ,EAAT,IAAA,EAAA,CAAU;oBACR,SAAS,EAAE;wBACT;4BACE,OAAO,EAAEE,kBAAW;4BACpB,QAAQ,EAAE,iBAAiB;4BAC3B,IAAI,EAAE,CAACD,sBAAe,EAAE,+BAA+B,CAAC;yBACzD;qBACF;iBACF,EAAD,EAAA;;IAC+B,OAA/B,gBAAgC,CAAhC;CAAgC,EAAhC,CAAA,CAAgC;AAAhC,IAKA,EAAA,GAAoD,uBAAuB,CAA3E;AAFA,AAAA,IAAA,mBAAA,kBAAA,YAAA;IAAA,SAAA,mBAAA,GAAA;KAImC;;QAJnC,EAAA,IAAA,EAACD,aAAQ,EAAT,IAAA,EAAA,CAAU;oBACR,OAAO,EAAE,CAAC,gBAAgB,CAAC;oBAC3B,SAAS,EAAE,CAAC,EAAC,OAAO,EAAED,uBAAgB,EAAE,QAAQ,EAAlD,EAA2E,EAAC,CAAC;iBAC5E,EAAD,EAAA;;IACkC,OAAlC,mBAAmC,CAAnC;CAAmC,EAAnC,CAAA;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"material-moment-adapter.umd.js","sources":["../../src/material-moment-adapter/adapter/index.ts","../../src/material-moment-adapter/adapter/moment-date-formats.ts","../../src/material-moment-adapter/adapter/moment-date-adapter.ts","../../node_modules/tslib/tslib.es6.js"],"sourcesContent":["/**\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 {DateAdapter, MAT_DATE_FORMATS, MAT_DATE_LOCALE} from '@angular/material/core';\nimport {MAT_MOMENT_DATE_ADAPTER_OPTIONS, MomentDateAdapter} from './moment-date-adapter';\nimport {MAT_MOMENT_DATE_FORMATS} from './moment-date-formats';\n\nexport * from './moment-date-adapter';\nexport * from './moment-date-formats';\n\n@NgModule({\n providers: [\n {\n provide: DateAdapter,\n useClass: MomentDateAdapter,\n deps: [MAT_DATE_LOCALE, MAT_MOMENT_DATE_ADAPTER_OPTIONS]\n }\n ],\n})\nexport class MomentDateModule {}\n\n\n@NgModule({\n imports: [MomentDateModule],\n providers: [{provide: MAT_DATE_FORMATS, useValue: MAT_MOMENT_DATE_FORMATS}],\n})\nexport class MatMomentDateModule {}\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 '@angular/material/core';\n\n\nexport const MAT_MOMENT_DATE_FORMATS: MatDateFormats = {\n parse: {\n dateInput: 'l',\n },\n display: {\n dateInput: 'l',\n monthYearLabel: 'MMM YYYY',\n dateA11yLabel: 'LL',\n monthYearA11yLabel: 'MMMM YYYY',\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 {Inject, Injectable, Optional, InjectionToken} from '@angular/core';\nimport {DateAdapter, MAT_DATE_LOCALE} from '@angular/material/core';\n// Depending on whether rollup is used, moment needs to be imported differently.\n// Since Moment.js doesn't have a default export, we normally need to import using the `* as`\n// syntax. However, rollup creates a synthetic default module and we thus need to import it using\n// the `default as` syntax.\n// TODO(mmalerba): See if we can clean this up at some point.\nimport * as _moment from 'moment';\n// tslint:disable-next-line:no-duplicate-imports\nimport {default as _rollupMoment, Moment, MomentFormatSpecification, MomentInput} from 'moment';\n\nconst moment = _rollupMoment || _moment;\n\n/** Configurable options for {@see MomentDateAdapter}. */\nexport interface MatMomentDateAdapterOptions {\n\n /**\n * When enabled, the dates have to match the format exactly.\n * See https://momentjs.com/guides/#/parsing/strict-mode/.\n */\n strict?: boolean;\n\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 moment date adapter to configure options. */\nexport const MAT_MOMENT_DATE_ADAPTER_OPTIONS = new InjectionToken<MatMomentDateAdapterOptions>(\n 'MAT_MOMENT_DATE_ADAPTER_OPTIONS', {\n providedIn: 'root',\n factory: MAT_MOMENT_DATE_ADAPTER_OPTIONS_FACTORY\n});\n\n\n/** @docs-private */\nexport function MAT_MOMENT_DATE_ADAPTER_OPTIONS_FACTORY(): MatMomentDateAdapterOptions {\n return {\n useUtc: false\n };\n}\n\n\n/** Creates an array and fills it with values. */\nfunction range<T>(length: number, valueFunction: (index: number) => T): T[] {\n const valuesArray = Array(length);\n for (let i = 0; i < length; i++) {\n valuesArray[i] = valueFunction(i);\n }\n return valuesArray;\n}\n\n\n/** Adapts Moment.js Dates for use with Angular Material. */\n@Injectable()\nexport class MomentDateAdapter extends DateAdapter<Moment> {\n // Note: all of the methods that accept a `Moment` input parameter immediately call `this.clone`\n // on it. This is to ensure that we're working with a `Moment` that has the correct locale setting\n // while avoiding mutating the original object passed to us. Just calling `.locale(...)` on the\n // input would mutate the object.\n\n private _localeData: {\n firstDayOfWeek: number,\n longMonths: string[],\n shortMonths: string[],\n dates: string[],\n longDaysOfWeek: string[],\n shortDaysOfWeek: string[],\n narrowDaysOfWeek: string[]\n };\n\n constructor(@Optional() @Inject(MAT_DATE_LOCALE) dateLocale: string,\n @Optional() @Inject(MAT_MOMENT_DATE_ADAPTER_OPTIONS)\n private _options?: MatMomentDateAdapterOptions) {\n\n super();\n this.setLocale(dateLocale || moment.locale());\n }\n\n setLocale(locale: string) {\n super.setLocale(locale);\n\n let momentLocaleData = moment.localeData(locale);\n this._localeData = {\n firstDayOfWeek: momentLocaleData.firstDayOfWeek(),\n longMonths: momentLocaleData.months(),\n shortMonths: momentLocaleData.monthsShort(),\n dates: range(31, (i) => this.createDate(2017, 0, i + 1).format('D')),\n longDaysOfWeek: momentLocaleData.weekdays(),\n shortDaysOfWeek: momentLocaleData.weekdaysShort(),\n narrowDaysOfWeek: momentLocaleData.weekdaysMin(),\n };\n }\n\n getYear(date: Moment): number {\n return this.clone(date).year();\n }\n\n getMonth(date: Moment): number {\n return this.clone(date).month();\n }\n\n getDate(date: Moment): number {\n return this.clone(date).date();\n }\n\n getDayOfWeek(date: Moment): number {\n return this.clone(date).day();\n }\n\n getMonthNames(style: 'long' | 'short' | 'narrow'): string[] {\n // Moment.js doesn't support narrow month names, so we just use short if narrow is requested.\n return style == 'long' ? this._localeData.longMonths : this._localeData.shortMonths;\n }\n\n getDateNames(): string[] {\n return this._localeData.dates;\n }\n\n getDayOfWeekNames(style: 'long' | 'short' | 'narrow'): string[] {\n if (style == 'long') {\n return this._localeData.longDaysOfWeek;\n }\n if (style == 'short') {\n return this._localeData.shortDaysOfWeek;\n }\n return this._localeData.narrowDaysOfWeek;\n }\n\n getYearName(date: Moment): string {\n return this.clone(date).format('YYYY');\n }\n\n getFirstDayOfWeek(): number {\n return this._localeData.firstDayOfWeek;\n }\n\n getNumDaysInMonth(date: Moment): number {\n return this.clone(date).daysInMonth();\n }\n\n clone(date: Moment): Moment {\n return date.clone().locale(this.locale);\n }\n\n createDate(year: number, month: number, date: number): Moment {\n // Moment.js will create an invalid date if any of the components are out of bounds, but we\n // explicitly check each case so we can throw more descriptive errors.\n if (month < 0 || month > 11) {\n throw Error(`Invalid month index \"${month}\". Month index has to be between 0 and 11.`);\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._createMoment({year, month, date}).locale(this.locale);\n\n // If the result isn't valid, the date must have been out of bounds for this month.\n if (!result.isValid()) {\n throw Error(`Invalid date \"${date}\" for month with index \"${month}\".`);\n }\n\n return result;\n }\n\n today(): Moment {\n return this._createMoment().locale(this.locale);\n }\n\n parse(value: any, parseFormat: string | string[]): Moment | null {\n if (value && typeof value == 'string') {\n return this._createMoment(value, parseFormat, this.locale);\n }\n return value ? this._createMoment(value).locale(this.locale) : null;\n }\n\n format(date: Moment, displayFormat: string): string {\n date = this.clone(date);\n if (!this.isValid(date)) {\n throw Error('MomentDateAdapter: Cannot format invalid date.');\n }\n return date.format(displayFormat);\n }\n\n addCalendarYears(date: Moment, years: number): Moment {\n return this.clone(date).add({years});\n }\n\n addCalendarMonths(date: Moment, months: number): Moment {\n return this.clone(date).add({months});\n }\n\n addCalendarDays(date: Moment, days: number): Moment {\n return this.clone(date).add({days});\n }\n\n toIso8601(date: Moment): string {\n return this.clone(date).format();\n }\n\n /**\n * Returns the given value if given a valid Moment or null. Deserializes valid ISO 8601 strings\n * (https://www.ietf.org/rfc/rfc3339.txt) and valid Date objects into valid Moments and empty\n * string into null. Returns an invalid date for all other values.\n */\n deserialize(value: any): Moment | null {\n let date;\n if (value instanceof Date) {\n date = this._createMoment(value).locale(this.locale);\n } else if (this.isDateInstance(value)) {\n // Note: assumes that cloning also sets the correct locale.\n return this.clone(value);\n }\n if (typeof value === 'string') {\n if (!value) {\n return null;\n }\n date = this._createMoment(value, moment.ISO_8601).locale(this.locale);\n }\n if (date && this.isValid(date)) {\n return this._createMoment(date).locale(this.locale);\n }\n return super.deserialize(value);\n }\n\n isDateInstance(obj: any): boolean {\n return moment.isMoment(obj);\n }\n\n isValid(date: Moment): boolean {\n return this.clone(date).isValid();\n }\n\n invalid(): Moment {\n return moment.invalid();\n }\n\n /** Creates a Moment instance while respecting the current UTC settings. */\n private _createMoment(\n date: MomentInput,\n format?: MomentFormatSpecification,\n locale?: string,\n ): Moment {\n const {strict, useUtc}: MatMomentDateAdapterOptions = this._options || {};\n\n return useUtc\n ? moment.utc(date, format, locale, strict)\n : moment(date, format, locale, strict);\n }\n}\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)\r\n t[p[i]] = s[p[i]];\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator], i = 0;\r\n if (m) return m.call(o);\r\n return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n"],"names":["MAT_DATE_FORMATS","NgModule","MAT_DATE_LOCALE","DateAdapter","Optional","Inject","Injectable","tslib_1.__extends","InjectionToken","_rollupMoment","_moment"],"mappings":";;;;;;;;;;;;;;;AGAA;;;;;;;;;;;;;;;;AAgBA,IAAI,aAAa,GAAG,SAAS,CAAC,EAAE,CAAC,EAAE;IAC/B,aAAa,GAAG,MAAM,CAAC,cAAc;SAChC,EAAE,SAAS,EAAE,EAAE,EAAE,YAAY,KAAK,IAAI,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,SAAS,GAAG,CAAC,CAAC,EAAE,CAAC;QAC5E,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,KAAK,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAC/E,OAAO,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;CAC9B,CAAC;;AAEF,AAAO,SAAS,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE;IAC5B,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACpB,SAAS,EAAE,GAAG,EAAE,IAAI,CAAC,WAAW,GAAG,CAAC,CAAC,EAAE;IACvC,CAAC,CAAC,SAAS,GAAG,CAAC,KAAK,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,SAAS,GAAG,CAAC,CAAC,SAAS,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;CACxF;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,EAAE,+BAA+B,CAAC;yBACzD;qBACF;iBACF,EAAD,EAAA;;IAC+B,OAA/B,gBAAgC,CAAhC;CAAgC,EAAhC,CAAA,CAAgC;AAAhC,IAKA,EAAA,GAAoD,uBAAuB,CAA3E;AAFA,AAAA,IAAA,mBAAA,kBAAA,YAAA;IAAA,SAAA,mBAAA,GAAA;KAImC;;QAJnC,EAAA,IAAA,EAACD,aAAQ,EAAT,IAAA,EAAA,CAAU;oBACR,OAAO,EAAE,CAAC,gBAAgB,CAAC;oBAC3B,SAAS,EAAE,CAAC,EAAC,OAAO,EAAED,uBAAgB,EAAE,QAAQ,EAAlD,EAA2E,EAAC,CAAC;iBAC5E,EAAD,EAAA;;IACkC,OAAlC,mBAAmC,CAAnC;CAAmC,EAAnC,CAAA;;;;;;;;;;;;;;;;;"}
|
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* Use of this source code is governed by an MIT-style license that can be
|
|
6
6
|
* found in the LICENSE file at https://angular.io/license
|
|
7
7
|
*/
|
|
8
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("@angular/material/core"),require("moment")):"function"==typeof define&&define.amd?define("@angular/material-moment-adapter",["exports","@angular/core","@angular/material/core","moment"],e):e((t.ng=t.ng||{},t.ng.materialMomentAdapter={}),t.ng.core,t.ng.material.core,t.moment)}(this,function(t,e,o,r){"use strict";function n(t,e){function o(){this.constructor=t}
|
|
8
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("@angular/material/core"),require("moment")):"function"==typeof define&&define.amd?define("@angular/material-moment-adapter",["exports","@angular/core","@angular/material/core","moment"],e):e((t.ng=t.ng||{},t.ng.materialMomentAdapter={}),t.ng.core,t.ng.material.core,t.moment)}(this,function(t,e,o,r){"use strict";function n(t,e){function o(){this.constructor=t}c(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}function a(){return{useUtc:!1}}function i(t,e){for(var o=Array(t),r=0;r<t;r++)o[r]=e(r);return o}var s=r.default,c=function(t,e){return(c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)},l=s||r,u=new e.InjectionToken("MAT_MOMENT_DATE_ADAPTER_OPTIONS",{providedIn:"root",factory:a}),p=function(t){function r(e,o){var r=t.call(this)||this;return r._options=o,r.setLocale(e||l.locale()),r}return n(r,t),r.prototype.setLocale=function(e){var o=this;t.prototype.setLocale.call(this,e);var r=l.localeData(e);this._localeData={firstDayOfWeek:r.firstDayOfWeek(),longMonths:r.months(),shortMonths:r.monthsShort(),dates:i(31,function(t){return o.createDate(2017,0,t+1).format("D")}),longDaysOfWeek:r.weekdays(),shortDaysOfWeek:r.weekdaysShort(),narrowDaysOfWeek:r.weekdaysMin()}},r.prototype.getYear=function(t){return this.clone(t).year()},r.prototype.getMonth=function(t){return this.clone(t).month()},r.prototype.getDate=function(t){return this.clone(t).date()},r.prototype.getDayOfWeek=function(t){return this.clone(t).day()},r.prototype.getMonthNames=function(t){return"long"==t?this._localeData.longMonths:this._localeData.shortMonths},r.prototype.getDateNames=function(){return this._localeData.dates},r.prototype.getDayOfWeekNames=function(t){return"long"==t?this._localeData.longDaysOfWeek:"short"==t?this._localeData.shortDaysOfWeek:this._localeData.narrowDaysOfWeek},r.prototype.getYearName=function(t){return this.clone(t).format("YYYY")},r.prototype.getFirstDayOfWeek=function(){return this._localeData.firstDayOfWeek},r.prototype.getNumDaysInMonth=function(t){return this.clone(t).daysInMonth()},r.prototype.clone=function(t){return t.clone().locale(this.locale)},r.prototype.createDate=function(t,e,o){if(e<0||e>11)throw Error('Invalid month index "'+e+'". Month index has to be between 0 and 11.');if(o<1)throw Error('Invalid date "'+o+'". Date has to be greater than 0.');var r=this._createMoment({year:t,month:e,date:o}).locale(this.locale);if(!r.isValid())throw Error('Invalid date "'+o+'" for month with index "'+e+'".');return r},r.prototype.today=function(){return this._createMoment().locale(this.locale)},r.prototype.parse=function(t,e){return t&&"string"==typeof t?this._createMoment(t,e,this.locale):t?this._createMoment(t).locale(this.locale):null},r.prototype.format=function(t,e){if(t=this.clone(t),!this.isValid(t))throw Error("MomentDateAdapter: Cannot format invalid date.");return t.format(e)},r.prototype.addCalendarYears=function(t,e){return this.clone(t).add({years:e})},r.prototype.addCalendarMonths=function(t,e){return this.clone(t).add({months:e})},r.prototype.addCalendarDays=function(t,e){return this.clone(t).add({days:e})},r.prototype.toIso8601=function(t){return this.clone(t).format()},r.prototype.deserialize=function(e){var o;if(e instanceof Date)o=this._createMoment(e).locale(this.locale);else if(this.isDateInstance(e))return this.clone(e);if("string"==typeof e){if(!e)return null;o=this._createMoment(e,l.ISO_8601).locale(this.locale)}return o&&this.isValid(o)?this._createMoment(o).locale(this.locale):t.prototype.deserialize.call(this,e)},r.prototype.isDateInstance=function(t){return l.isMoment(t)},r.prototype.isValid=function(t){return this.clone(t).isValid()},r.prototype.invalid=function(){return l.invalid()},r.prototype._createMoment=function(t,e,o){var r=this._options||{},n=r.strict;return r.useUtc?l.utc(t,e,o,n):l(t,e,o,n)},r.decorators=[{type:e.Injectable}],r.ctorParameters=function(){return[{type:String,decorators:[{type:e.Optional},{type:e.Inject,args:[o.MAT_DATE_LOCALE]}]},{type:void 0,decorators:[{type:e.Optional},{type:e.Inject,args:[u]}]}]},r}(o.DateAdapter),f={parse:{dateInput:"l"},display:{dateInput:"l",monthYearLabel:"MMM YYYY",dateA11yLabel:"LL",monthYearA11yLabel:"MMMM YYYY"}},d=function(){function t(){}return t.decorators=[{type:e.NgModule,args:[{providers:[{provide:o.DateAdapter,useClass:p,deps:[o.MAT_DATE_LOCALE,u]}]}]}],t}(),h=f,y=function(){function t(){}return t.decorators=[{type:e.NgModule,args:[{imports:[d],providers:[{provide:o.MAT_DATE_FORMATS,useValue:h}]}]}],t}();t.MomentDateModule=d,t.MatMomentDateModule=y,t.MAT_MOMENT_DATE_ADAPTER_OPTIONS_FACTORY=a,t.MAT_MOMENT_DATE_ADAPTER_OPTIONS=u,t.MomentDateAdapter=p,t.MAT_MOMENT_DATE_FORMATS=f,Object.defineProperty(t,"__esModule",{value:!0})});
|
|
9
9
|
//# sourceMappingURL=material-moment-adapter.umd.min.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"material-moment-adapter.umd.min.js","sources":["../../node_modules/tslib/tslib.es6.js","../../src/material-moment-adapter/adapter/moment-date-adapter.ts","../../src/material-moment-adapter/adapter/moment-date-formats.ts","../../src/material-moment-adapter/adapter/index.ts"],"sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)\r\n t[p[i]] = s[p[i]];\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator], i = 0;\r\n if (m) return m.call(o);\r\n return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\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 {DateAdapter, MAT_DATE_LOCALE} from '@angular/material/core';\n// Depending on whether rollup is used, moment needs to be imported differently.\n// Since Moment.js doesn't have a default export, we normally need to import using the `* as`\n// syntax. However, rollup creates a synthetic default module and we thus need to import it using\n// the `default as` syntax.\n// TODO(mmalerba): See if we can clean this up at some point.\nimport * as _moment from 'moment';\n// tslint:disable-next-line:no-duplicate-imports\nimport {default as _rollupMoment, Moment} from 'moment';\n\nconst moment = _rollupMoment || _moment;\n\n/** Configurable options for {@see MomentDateAdapter}. */\nexport interface MatMomentDateAdapterOptions {\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 moment date adapter to configure options. */\nexport const MAT_MOMENT_DATE_ADAPTER_OPTIONS = new InjectionToken<MatMomentDateAdapterOptions>(\n 'MAT_MOMENT_DATE_ADAPTER_OPTIONS', {\n providedIn: 'root',\n factory: MAT_MOMENT_DATE_ADAPTER_OPTIONS_FACTORY\n});\n\n\n/** @docs-private */\nexport function MAT_MOMENT_DATE_ADAPTER_OPTIONS_FACTORY(): MatMomentDateAdapterOptions {\n return {\n useUtc: false\n };\n}\n\n\n/** Creates an array and fills it with values. */\nfunction range<T>(length: number, valueFunction: (index: number) => T): T[] {\n const valuesArray = Array(length);\n for (let i = 0; i < length; i++) {\n valuesArray[i] = valueFunction(i);\n }\n return valuesArray;\n}\n\n\n/** Adapts Moment.js Dates for use with Angular Material. */\n@Injectable()\nexport class MomentDateAdapter extends DateAdapter<Moment> {\n // Note: all of the methods that accept a `Moment` input parameter immediately call `this.clone`\n // on it. This is to ensure that we're working with a `Moment` that has the correct locale setting\n // while avoiding mutating the original object passed to us. Just calling `.locale(...)` on the\n // input would mutate the object.\n\n private _localeData: {\n firstDayOfWeek: number,\n longMonths: string[],\n shortMonths: string[],\n dates: string[],\n longDaysOfWeek: string[],\n shortDaysOfWeek: string[],\n narrowDaysOfWeek: string[]\n };\n\n constructor(@Optional() @Inject(MAT_DATE_LOCALE) dateLocale: string,\n @Optional() @Inject(MAT_MOMENT_DATE_ADAPTER_OPTIONS)\n private _options?: MatMomentDateAdapterOptions) {\n\n super();\n this.setLocale(dateLocale || moment.locale());\n }\n\n setLocale(locale: string) {\n super.setLocale(locale);\n\n let momentLocaleData = moment.localeData(locale);\n this._localeData = {\n firstDayOfWeek: momentLocaleData.firstDayOfWeek(),\n longMonths: momentLocaleData.months(),\n shortMonths: momentLocaleData.monthsShort(),\n dates: range(31, (i) => this.createDate(2017, 0, i + 1).format('D')),\n longDaysOfWeek: momentLocaleData.weekdays(),\n shortDaysOfWeek: momentLocaleData.weekdaysShort(),\n narrowDaysOfWeek: momentLocaleData.weekdaysMin(),\n };\n }\n\n getYear(date: Moment): number {\n return this.clone(date).year();\n }\n\n getMonth(date: Moment): number {\n return this.clone(date).month();\n }\n\n getDate(date: Moment): number {\n return this.clone(date).date();\n }\n\n getDayOfWeek(date: Moment): number {\n return this.clone(date).day();\n }\n\n getMonthNames(style: 'long' | 'short' | 'narrow'): string[] {\n // Moment.js doesn't support narrow month names, so we just use short if narrow is requested.\n return style == 'long' ? this._localeData.longMonths : this._localeData.shortMonths;\n }\n\n getDateNames(): string[] {\n return this._localeData.dates;\n }\n\n getDayOfWeekNames(style: 'long' | 'short' | 'narrow'): string[] {\n if (style == 'long') {\n return this._localeData.longDaysOfWeek;\n }\n if (style == 'short') {\n return this._localeData.shortDaysOfWeek;\n }\n return this._localeData.narrowDaysOfWeek;\n }\n\n getYearName(date: Moment): string {\n return this.clone(date).format('YYYY');\n }\n\n getFirstDayOfWeek(): number {\n return this._localeData.firstDayOfWeek;\n }\n\n getNumDaysInMonth(date: Moment): number {\n return this.clone(date).daysInMonth();\n }\n\n clone(date: Moment): Moment {\n return date.clone().locale(this.locale);\n }\n\n createDate(year: number, month: number, date: number): Moment {\n // Moment.js will create an invalid date if any of the components are out of bounds, but we\n // explicitly check each case so we can throw more descriptive errors.\n if (month < 0 || month > 11) {\n throw Error(`Invalid month index \"${month}\". Month index has to be between 0 and 11.`);\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._createMoment({year, month, date}).locale(this.locale);\n\n // If the result isn't valid, the date must have been out of bounds for this month.\n if (!result.isValid()) {\n throw Error(`Invalid date \"${date}\" for month with index \"${month}\".`);\n }\n\n return result;\n }\n\n today(): Moment {\n return this._createMoment().locale(this.locale);\n }\n\n parse(value: any, parseFormat: string | string[]): Moment | null {\n if (value && typeof value == 'string') {\n return this._createMoment(value, parseFormat, this.locale);\n }\n return value ? this._createMoment(value).locale(this.locale) : null;\n }\n\n format(date: Moment, displayFormat: string): string {\n date = this.clone(date);\n if (!this.isValid(date)) {\n throw Error('MomentDateAdapter: Cannot format invalid date.');\n }\n return date.format(displayFormat);\n }\n\n addCalendarYears(date: Moment, years: number): Moment {\n return this.clone(date).add({years});\n }\n\n addCalendarMonths(date: Moment, months: number): Moment {\n return this.clone(date).add({months});\n }\n\n addCalendarDays(date: Moment, days: number): Moment {\n return this.clone(date).add({days});\n }\n\n toIso8601(date: Moment): string {\n return this.clone(date).format();\n }\n\n /**\n * Returns the given value if given a valid Moment or null. Deserializes valid ISO 8601 strings\n * (https://www.ietf.org/rfc/rfc3339.txt) and valid Date objects into valid Moments and empty\n * string into null. Returns an invalid date for all other values.\n */\n deserialize(value: any): Moment | null {\n let date;\n if (value instanceof Date) {\n date = this._createMoment(value).locale(this.locale);\n } else if (this.isDateInstance(value)) {\n // Note: assumes that cloning also sets the correct locale.\n return this.clone(value);\n }\n if (typeof value === 'string') {\n if (!value) {\n return null;\n }\n date = this._createMoment(value, moment.ISO_8601).locale(this.locale);\n }\n if (date && this.isValid(date)) {\n return this._createMoment(date).locale(this.locale);\n }\n return super.deserialize(value);\n }\n\n isDateInstance(obj: any): boolean {\n return moment.isMoment(obj);\n }\n\n isValid(date: Moment): boolean {\n return this.clone(date).isValid();\n }\n\n invalid(): Moment {\n return moment.invalid();\n }\n\n /** Creates a Moment instance while respecting the current UTC settings. */\n private _createMoment(...args: any[]): Moment {\n return (this._options && this._options.useUtc) ? moment.utc(...args) : moment(...args);\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 '@angular/material/core';\n\n\nexport const MAT_MOMENT_DATE_FORMATS: MatDateFormats = {\n parse: {\n dateInput: 'l',\n },\n display: {\n dateInput: 'l',\n monthYearLabel: 'MMM YYYY',\n dateA11yLabel: 'LL',\n monthYearA11yLabel: 'MMMM YYYY',\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 {DateAdapter, MAT_DATE_FORMATS, MAT_DATE_LOCALE} from '@angular/material/core';\nimport {MAT_MOMENT_DATE_ADAPTER_OPTIONS, MomentDateAdapter} from './moment-date-adapter';\nimport {MAT_MOMENT_DATE_FORMATS} from './moment-date-formats';\n\nexport * from './moment-date-adapter';\nexport * from './moment-date-formats';\n\n@NgModule({\n providers: [\n {\n provide: DateAdapter,\n useClass: MomentDateAdapter,\n deps: [MAT_DATE_LOCALE, MAT_MOMENT_DATE_ADAPTER_OPTIONS]\n }\n ],\n})\nexport class MomentDateModule {}\n\n\n@NgModule({\n imports: [MomentDateModule],\n providers: [{provide: MAT_DATE_FORMATS, useValue: MAT_MOMENT_DATE_FORMATS}],\n})\nexport class MatMomentDateModule {}\n"],"names":["__extends","d","b","__","this","constructor","extendStatics","prototype","Object","create","MAT_MOMENT_DATE_ADAPTER_OPTIONS_FACTORY","useUtc","range","length","valueFunction","valuesArray","Array","i","setPrototypeOf","__proto__","p","hasOwnProperty","moment","_rollupMoment","_moment","MAT_MOMENT_DATE_ADAPTER_OPTIONS","InjectionToken","providedIn","factory","MomentDateAdapter","_super","dateLocale","_options","_this","call","setLocale","locale","tslib_1.__extends","momentLocaleData","localeData","_localeData","firstDayOfWeek","longMonths","months","shortMonths","monthsShort","dates","createDate","format","longDaysOfWeek","weekdays","shortDaysOfWeek","weekdaysShort","narrowDaysOfWeek","weekdaysMin","getYear","date","clone","year","getMonth","month","getDate","getDayOfWeek","day","getMonthNames","style","getDateNames","getDayOfWeekNames","getYearName","getFirstDayOfWeek","getNumDaysInMonth","daysInMonth","Error","result","_createMoment","isValid","today","parse","value","parseFormat","displayFormat","addCalendarYears","years","add","addCalendarMonths","addCalendarDays","days","toIso8601","deserialize","Date","isDateInstance","ISO_8601","obj","isMoment","invalid","args","_i","arguments","utc","apply","type","Injectable","String","decorators","Optional","Inject","MAT_DATE_LOCALE","undefined","DateAdapter","MAT_MOMENT_DATE_FORMATS","dateInput","display","monthYearLabel","dateA11yLabel","monthYearA11yLabel","MomentDateModule","NgModule","providers","provide","useClass","deps","ɵ0","MatMomentDateModule","imports","MAT_DATE_FORMATS","useValue"],"mappings":";;;;;;;waAuBA,SAAgBA,GAAUC,EAAGC,GAEzB,QAASC,KAAOC,KAAKC,YAAcJ,EADnCK,EAAcL,EAAGC,GAEjBD,EAAEM,UAAkB,OAANL,EAAaM,OAAOC,OAAOP,IAAMC,EAAGI,UAAYL,EAAEK,UAAW,GAAIJ,ICcnF,QAAgBO,KACd,OACEC,QAAQ,GAMZ,QAASC,GAASC,EAAgBC,GAEhC,IAAK,GADCC,GAAcC,MAAMH,GACjBI,EAAI,EAAGA,EAAIJ,EAAQI,IAC1BF,EAAYE,GAAKH,EAAcG,EAEjC,OAAOF,mBDrCLT,EAAgB,SAASL,EAAGC,GAI5B,OAHAI,EAAgBE,OAAOU,iBAChBC,uBAA2BH,QAAS,SAAUf,EAAGC,GAAKD,EAAEkB,UAAYjB,IACvE,SAAUD,EAAGC,GAAK,IAAK,GAAIkB,KAAKlB,GAAOA,EAAEmB,eAAeD,KAAInB,EAAEmB,GAAKlB,EAAEkB,MACpDnB,EAAGC,ICDtBoB,EAASC,GAAiBC,EAanBC,EAAkC,GAAIC,GAAAA,eACjD,mCACEC,WAAY,OACZC,QAASlB,IAuBbmB,EAAA,SAAAC,GAiBE,QAAFD,GAAmDE,EAEvCC,GAFV,GAAFC,GAIIH,EAJJI,KAAA9B,OAAAA,WAEY6B,GAAZD,SAAYA,EAGRC,EAAKE,UAAUJ,GAAcT,EAAOc,YAsKxC,MA3LuCC,GAAvCR,EAAAC,GAwBED,EAAFtB,UAAA4B,UAAE,SAAUC,GAAV,GAAFH,GAAA7B,IACI0B,GAAJvB,UAAU4B,UAAVD,KAAA9B,KAAoBgC,EAEpB,IAAQE,GAAmBhB,EAAOiB,WAAW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,EAAAA,SAADrB,OACEsB,YAEIC,QAASV,EAAAA,YACTW,SAAU1F,EACV2F,MAAOd,EAAAA,gBAAiBjF,SAI9B0F,KAKAM,EAAoDZ,EAFpDa,EAAA,WAAA,QAAAA,MAIkC,sBAJlCtB,KAACgB,EAAAA,SAADrB,OACE4B,SAAUR,GACVE,YAAaC,QAASM,EAAAA,iBAAkBC,SAA1CJ,QAEAC"}
|
|
1
|
+
{"version":3,"file":"material-moment-adapter.umd.min.js","sources":["../../node_modules/tslib/tslib.es6.js","../../src/material-moment-adapter/adapter/moment-date-adapter.ts","../../src/material-moment-adapter/adapter/moment-date-formats.ts","../../src/material-moment-adapter/adapter/index.ts"],"sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)\r\n t[p[i]] = s[p[i]];\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator], i = 0;\r\n if (m) return m.call(o);\r\n return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\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 {DateAdapter, MAT_DATE_LOCALE} from '@angular/material/core';\n// Depending on whether rollup is used, moment needs to be imported differently.\n// Since Moment.js doesn't have a default export, we normally need to import using the `* as`\n// syntax. However, rollup creates a synthetic default module and we thus need to import it using\n// the `default as` syntax.\n// TODO(mmalerba): See if we can clean this up at some point.\nimport * as _moment from 'moment';\n// tslint:disable-next-line:no-duplicate-imports\nimport {default as _rollupMoment, Moment, MomentFormatSpecification, MomentInput} from 'moment';\n\nconst moment = _rollupMoment || _moment;\n\n/** Configurable options for {@see MomentDateAdapter}. */\nexport interface MatMomentDateAdapterOptions {\n\n /**\n * When enabled, the dates have to match the format exactly.\n * See https://momentjs.com/guides/#/parsing/strict-mode/.\n */\n strict?: boolean;\n\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 moment date adapter to configure options. */\nexport const MAT_MOMENT_DATE_ADAPTER_OPTIONS = new InjectionToken<MatMomentDateAdapterOptions>(\n 'MAT_MOMENT_DATE_ADAPTER_OPTIONS', {\n providedIn: 'root',\n factory: MAT_MOMENT_DATE_ADAPTER_OPTIONS_FACTORY\n});\n\n\n/** @docs-private */\nexport function MAT_MOMENT_DATE_ADAPTER_OPTIONS_FACTORY(): MatMomentDateAdapterOptions {\n return {\n useUtc: false\n };\n}\n\n\n/** Creates an array and fills it with values. */\nfunction range<T>(length: number, valueFunction: (index: number) => T): T[] {\n const valuesArray = Array(length);\n for (let i = 0; i < length; i++) {\n valuesArray[i] = valueFunction(i);\n }\n return valuesArray;\n}\n\n\n/** Adapts Moment.js Dates for use with Angular Material. */\n@Injectable()\nexport class MomentDateAdapter extends DateAdapter<Moment> {\n // Note: all of the methods that accept a `Moment` input parameter immediately call `this.clone`\n // on it. This is to ensure that we're working with a `Moment` that has the correct locale setting\n // while avoiding mutating the original object passed to us. Just calling `.locale(...)` on the\n // input would mutate the object.\n\n private _localeData: {\n firstDayOfWeek: number,\n longMonths: string[],\n shortMonths: string[],\n dates: string[],\n longDaysOfWeek: string[],\n shortDaysOfWeek: string[],\n narrowDaysOfWeek: string[]\n };\n\n constructor(@Optional() @Inject(MAT_DATE_LOCALE) dateLocale: string,\n @Optional() @Inject(MAT_MOMENT_DATE_ADAPTER_OPTIONS)\n private _options?: MatMomentDateAdapterOptions) {\n\n super();\n this.setLocale(dateLocale || moment.locale());\n }\n\n setLocale(locale: string) {\n super.setLocale(locale);\n\n let momentLocaleData = moment.localeData(locale);\n this._localeData = {\n firstDayOfWeek: momentLocaleData.firstDayOfWeek(),\n longMonths: momentLocaleData.months(),\n shortMonths: momentLocaleData.monthsShort(),\n dates: range(31, (i) => this.createDate(2017, 0, i + 1).format('D')),\n longDaysOfWeek: momentLocaleData.weekdays(),\n shortDaysOfWeek: momentLocaleData.weekdaysShort(),\n narrowDaysOfWeek: momentLocaleData.weekdaysMin(),\n };\n }\n\n getYear(date: Moment): number {\n return this.clone(date).year();\n }\n\n getMonth(date: Moment): number {\n return this.clone(date).month();\n }\n\n getDate(date: Moment): number {\n return this.clone(date).date();\n }\n\n getDayOfWeek(date: Moment): number {\n return this.clone(date).day();\n }\n\n getMonthNames(style: 'long' | 'short' | 'narrow'): string[] {\n // Moment.js doesn't support narrow month names, so we just use short if narrow is requested.\n return style == 'long' ? this._localeData.longMonths : this._localeData.shortMonths;\n }\n\n getDateNames(): string[] {\n return this._localeData.dates;\n }\n\n getDayOfWeekNames(style: 'long' | 'short' | 'narrow'): string[] {\n if (style == 'long') {\n return this._localeData.longDaysOfWeek;\n }\n if (style == 'short') {\n return this._localeData.shortDaysOfWeek;\n }\n return this._localeData.narrowDaysOfWeek;\n }\n\n getYearName(date: Moment): string {\n return this.clone(date).format('YYYY');\n }\n\n getFirstDayOfWeek(): number {\n return this._localeData.firstDayOfWeek;\n }\n\n getNumDaysInMonth(date: Moment): number {\n return this.clone(date).daysInMonth();\n }\n\n clone(date: Moment): Moment {\n return date.clone().locale(this.locale);\n }\n\n createDate(year: number, month: number, date: number): Moment {\n // Moment.js will create an invalid date if any of the components are out of bounds, but we\n // explicitly check each case so we can throw more descriptive errors.\n if (month < 0 || month > 11) {\n throw Error(`Invalid month index \"${month}\". Month index has to be between 0 and 11.`);\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._createMoment({year, month, date}).locale(this.locale);\n\n // If the result isn't valid, the date must have been out of bounds for this month.\n if (!result.isValid()) {\n throw Error(`Invalid date \"${date}\" for month with index \"${month}\".`);\n }\n\n return result;\n }\n\n today(): Moment {\n return this._createMoment().locale(this.locale);\n }\n\n parse(value: any, parseFormat: string | string[]): Moment | null {\n if (value && typeof value == 'string') {\n return this._createMoment(value, parseFormat, this.locale);\n }\n return value ? this._createMoment(value).locale(this.locale) : null;\n }\n\n format(date: Moment, displayFormat: string): string {\n date = this.clone(date);\n if (!this.isValid(date)) {\n throw Error('MomentDateAdapter: Cannot format invalid date.');\n }\n return date.format(displayFormat);\n }\n\n addCalendarYears(date: Moment, years: number): Moment {\n return this.clone(date).add({years});\n }\n\n addCalendarMonths(date: Moment, months: number): Moment {\n return this.clone(date).add({months});\n }\n\n addCalendarDays(date: Moment, days: number): Moment {\n return this.clone(date).add({days});\n }\n\n toIso8601(date: Moment): string {\n return this.clone(date).format();\n }\n\n /**\n * Returns the given value if given a valid Moment or null. Deserializes valid ISO 8601 strings\n * (https://www.ietf.org/rfc/rfc3339.txt) and valid Date objects into valid Moments and empty\n * string into null. Returns an invalid date for all other values.\n */\n deserialize(value: any): Moment | null {\n let date;\n if (value instanceof Date) {\n date = this._createMoment(value).locale(this.locale);\n } else if (this.isDateInstance(value)) {\n // Note: assumes that cloning also sets the correct locale.\n return this.clone(value);\n }\n if (typeof value === 'string') {\n if (!value) {\n return null;\n }\n date = this._createMoment(value, moment.ISO_8601).locale(this.locale);\n }\n if (date && this.isValid(date)) {\n return this._createMoment(date).locale(this.locale);\n }\n return super.deserialize(value);\n }\n\n isDateInstance(obj: any): boolean {\n return moment.isMoment(obj);\n }\n\n isValid(date: Moment): boolean {\n return this.clone(date).isValid();\n }\n\n invalid(): Moment {\n return moment.invalid();\n }\n\n /** Creates a Moment instance while respecting the current UTC settings. */\n private _createMoment(\n date: MomentInput,\n format?: MomentFormatSpecification,\n locale?: string,\n ): Moment {\n const {strict, useUtc}: MatMomentDateAdapterOptions = this._options || {};\n\n return useUtc\n ? moment.utc(date, format, locale, strict)\n : moment(date, format, locale, strict);\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 '@angular/material/core';\n\n\nexport const MAT_MOMENT_DATE_FORMATS: MatDateFormats = {\n parse: {\n dateInput: 'l',\n },\n display: {\n dateInput: 'l',\n monthYearLabel: 'MMM YYYY',\n dateA11yLabel: 'LL',\n monthYearA11yLabel: 'MMMM YYYY',\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 {DateAdapter, MAT_DATE_FORMATS, MAT_DATE_LOCALE} from '@angular/material/core';\nimport {MAT_MOMENT_DATE_ADAPTER_OPTIONS, MomentDateAdapter} from './moment-date-adapter';\nimport {MAT_MOMENT_DATE_FORMATS} from './moment-date-formats';\n\nexport * from './moment-date-adapter';\nexport * from './moment-date-formats';\n\n@NgModule({\n providers: [\n {\n provide: DateAdapter,\n useClass: MomentDateAdapter,\n deps: [MAT_DATE_LOCALE, MAT_MOMENT_DATE_ADAPTER_OPTIONS]\n }\n ],\n})\nexport class MomentDateModule {}\n\n\n@NgModule({\n imports: [MomentDateModule],\n providers: [{provide: MAT_DATE_FORMATS, useValue: MAT_MOMENT_DATE_FORMATS}],\n})\nexport class MatMomentDateModule {}\n"],"names":["__extends","d","b","__","this","constructor","extendStatics","prototype","Object","create","MAT_MOMENT_DATE_ADAPTER_OPTIONS_FACTORY","useUtc","range","length","valueFunction","valuesArray","Array","i","setPrototypeOf","__proto__","p","hasOwnProperty","moment","_rollupMoment","_moment","MAT_MOMENT_DATE_ADAPTER_OPTIONS","InjectionToken","providedIn","factory","MomentDateAdapter","_super","dateLocale","_options","_this","call","setLocale","locale","tslib_1.__extends","momentLocaleData","localeData","_localeData","firstDayOfWeek","longMonths","months","shortMonths","monthsShort","dates","createDate","format","longDaysOfWeek","weekdays","shortDaysOfWeek","weekdaysShort","narrowDaysOfWeek","weekdaysMin","getYear","date","clone","year","getMonth","month","getDate","getDayOfWeek","day","getMonthNames","style","getDateNames","getDayOfWeekNames","getYearName","getFirstDayOfWeek","getNumDaysInMonth","daysInMonth","Error","result","_createMoment","isValid","today","parse","value","parseFormat","displayFormat","addCalendarYears","years","add","addCalendarMonths","addCalendarDays","days","toIso8601","deserialize","Date","isDateInstance","ISO_8601","obj","isMoment","invalid","_a","strict","utc","type","Injectable","String","decorators","Optional","Inject","args","MAT_DATE_LOCALE","undefined","DateAdapter","MAT_MOMENT_DATE_FORMATS","dateInput","display","monthYearLabel","dateA11yLabel","monthYearA11yLabel","MomentDateModule","NgModule","providers","provide","useClass","deps","ɵ0","MatMomentDateModule","imports","MAT_DATE_FORMATS","useValue"],"mappings":";;;;;;;waAuBA,SAAgBA,GAAUC,EAAGC,GAEzB,QAASC,KAAOC,KAAKC,YAAcJ,EADnCK,EAAcL,EAAGC,GAEjBD,EAAEM,UAAkB,OAANL,EAAaM,OAAOC,OAAOP,IAAMC,EAAGI,UAAYL,EAAEK,UAAW,GAAIJ,ICqBnF,QAAgBO,KACd,OACEC,QAAQ,GAMZ,QAASC,GAASC,EAAgBC,GAEhC,IAAK,GADCC,GAAcC,MAAMH,GACjBI,EAAI,EAAGA,EAAIJ,EAAQI,IAC1BF,EAAYE,GAAKH,EAAcG,EAEjC,OAAOF,mBD5CLT,EAAgB,SAASL,EAAGC,GAI5B,OAHAI,EAAgBE,OAAOU,iBAChBC,uBAA2BH,QAAS,SAAUf,EAAGC,GAAKD,EAAEkB,UAAYjB,IACvE,SAAUD,EAAGC,GAAK,IAAK,GAAIkB,KAAKlB,GAAOA,EAAEmB,eAAeD,KAAInB,EAAEmB,GAAKlB,EAAEkB,MACpDnB,EAAGC,ICDtBoB,EAASC,GAAiBC,EAoBnBC,EAAkC,GAAIC,GAAAA,eACjD,mCACEC,WAAY,OACZC,QAASlB,IAuBbmB,EAAA,SAAAC,GAiBE,QAAFD,GAAmDE,EAEvCC,GAFV,GAAFC,GAIIH,EAJJ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AKI,EAAAA,WAALJ,KAAiBK,EAAAA,OAAjBC,MAAwB/E,QAkLxBI,GAnMuC8E,EAAAA,aCvD1BC,GACX/B,OACEgC,UAAW,KAEbC,SACED,UAAW,IACXE,eAAgB,WAChBC,cAAe,KACfC,mBAAoB,cCHxBC,EAAA,WAAA,QAAAA,MAS+B,sBAT/BhB,KAACiB,EAAAA,SAADX,OACEY,YAEIC,QAASV,EAAAA,YACTW,SAAUzF,EACV0F,MAAOd,EAAAA,gBAAiBhF,SAI9ByF,KAKAM,EAAoDZ,EAFpDa,EAAA,WAAA,QAAAA,MAIkC,sBAJlCvB,KAACiB,EAAAA,SAADX,OACEkB,SAAUR,GACVE,YAAaC,QAASM,EAAAA,iBAAkBC,SAA1CJ,QAEAC"}
|
|
@@ -299,11 +299,16 @@ class MomentDateAdapter extends DateAdapter {
|
|
|
299
299
|
/**
|
|
300
300
|
* Creates a Moment instance while respecting the current UTC settings.
|
|
301
301
|
* @private
|
|
302
|
-
* @param {
|
|
302
|
+
* @param {?} date
|
|
303
|
+
* @param {?=} format
|
|
304
|
+
* @param {?=} locale
|
|
303
305
|
* @return {?}
|
|
304
306
|
*/
|
|
305
|
-
_createMoment(
|
|
306
|
-
|
|
307
|
+
_createMoment(date, format, locale) {
|
|
308
|
+
const { strict, useUtc } = this._options || {};
|
|
309
|
+
return useUtc
|
|
310
|
+
? moment.utc(date, format, locale, strict)
|
|
311
|
+
: moment(date, format, locale, strict);
|
|
307
312
|
}
|
|
308
313
|
}
|
|
309
314
|
MomentDateAdapter.decorators = [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"material-moment-adapter.js","sources":["../../src/material-moment-adapter/adapter/index.ts","../../src/material-moment-adapter/adapter/moment-date-formats.ts","../../src/material-moment-adapter/adapter/moment-date-adapter.ts"],"sourcesContent":["/**\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 {DateAdapter, MAT_DATE_FORMATS, MAT_DATE_LOCALE} from '@angular/material/core';\nimport {MAT_MOMENT_DATE_ADAPTER_OPTIONS, MomentDateAdapter} from './moment-date-adapter';\nimport {MAT_MOMENT_DATE_FORMATS} from './moment-date-formats';\n\nexport * from './moment-date-adapter';\nexport * from './moment-date-formats';\n\n@NgModule({\n providers: [\n {\n provide: DateAdapter,\n useClass: MomentDateAdapter,\n deps: [MAT_DATE_LOCALE, MAT_MOMENT_DATE_ADAPTER_OPTIONS]\n }\n ],\n})\nexport class MomentDateModule {}\n\n\n@NgModule({\n imports: [MomentDateModule],\n providers: [{provide: MAT_DATE_FORMATS, useValue: MAT_MOMENT_DATE_FORMATS}],\n})\nexport class MatMomentDateModule {}\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 '@angular/material/core';\n\n\nexport const MAT_MOMENT_DATE_FORMATS: MatDateFormats = {\n parse: {\n dateInput: 'l',\n },\n display: {\n dateInput: 'l',\n monthYearLabel: 'MMM YYYY',\n dateA11yLabel: 'LL',\n monthYearA11yLabel: 'MMMM YYYY',\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 {Inject, Injectable, Optional, InjectionToken} from '@angular/core';\nimport {DateAdapter, MAT_DATE_LOCALE} from '@angular/material/core';\n// Depending on whether rollup is used, moment needs to be imported differently.\n// Since Moment.js doesn't have a default export, we normally need to import using the `* as`\n// syntax. However, rollup creates a synthetic default module and we thus need to import it using\n// the `default as` syntax.\n// TODO(mmalerba): See if we can clean this up at some point.\nimport * as _moment from 'moment';\n// tslint:disable-next-line:no-duplicate-imports\nimport {default as _rollupMoment, Moment} from 'moment';\n\nconst moment = _rollupMoment || _moment;\n\n/** Configurable options for {@see MomentDateAdapter}. */\nexport interface MatMomentDateAdapterOptions {\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 moment date adapter to configure options. */\nexport const MAT_MOMENT_DATE_ADAPTER_OPTIONS = new InjectionToken<MatMomentDateAdapterOptions>(\n 'MAT_MOMENT_DATE_ADAPTER_OPTIONS', {\n providedIn: 'root',\n factory: MAT_MOMENT_DATE_ADAPTER_OPTIONS_FACTORY\n});\n\n\n/** @docs-private */\nexport function MAT_MOMENT_DATE_ADAPTER_OPTIONS_FACTORY(): MatMomentDateAdapterOptions {\n return {\n useUtc: false\n };\n}\n\n\n/** Creates an array and fills it with values. */\nfunction range<T>(length: number, valueFunction: (index: number) => T): T[] {\n const valuesArray = Array(length);\n for (let i = 0; i < length; i++) {\n valuesArray[i] = valueFunction(i);\n }\n return valuesArray;\n}\n\n\n/** Adapts Moment.js Dates for use with Angular Material. */\n@Injectable()\nexport class MomentDateAdapter extends DateAdapter<Moment> {\n // Note: all of the methods that accept a `Moment` input parameter immediately call `this.clone`\n // on it. This is to ensure that we're working with a `Moment` that has the correct locale setting\n // while avoiding mutating the original object passed to us. Just calling `.locale(...)` on the\n // input would mutate the object.\n\n private _localeData: {\n firstDayOfWeek: number,\n longMonths: string[],\n shortMonths: string[],\n dates: string[],\n longDaysOfWeek: string[],\n shortDaysOfWeek: string[],\n narrowDaysOfWeek: string[]\n };\n\n constructor(@Optional() @Inject(MAT_DATE_LOCALE) dateLocale: string,\n @Optional() @Inject(MAT_MOMENT_DATE_ADAPTER_OPTIONS)\n private _options?: MatMomentDateAdapterOptions) {\n\n super();\n this.setLocale(dateLocale || moment.locale());\n }\n\n setLocale(locale: string) {\n super.setLocale(locale);\n\n let momentLocaleData = moment.localeData(locale);\n this._localeData = {\n firstDayOfWeek: momentLocaleData.firstDayOfWeek(),\n longMonths: momentLocaleData.months(),\n shortMonths: momentLocaleData.monthsShort(),\n dates: range(31, (i) => this.createDate(2017, 0, i + 1).format('D')),\n longDaysOfWeek: momentLocaleData.weekdays(),\n shortDaysOfWeek: momentLocaleData.weekdaysShort(),\n narrowDaysOfWeek: momentLocaleData.weekdaysMin(),\n };\n }\n\n getYear(date: Moment): number {\n return this.clone(date).year();\n }\n\n getMonth(date: Moment): number {\n return this.clone(date).month();\n }\n\n getDate(date: Moment): number {\n return this.clone(date).date();\n }\n\n getDayOfWeek(date: Moment): number {\n return this.clone(date).day();\n }\n\n getMonthNames(style: 'long' | 'short' | 'narrow'): string[] {\n // Moment.js doesn't support narrow month names, so we just use short if narrow is requested.\n return style == 'long' ? this._localeData.longMonths : this._localeData.shortMonths;\n }\n\n getDateNames(): string[] {\n return this._localeData.dates;\n }\n\n getDayOfWeekNames(style: 'long' | 'short' | 'narrow'): string[] {\n if (style == 'long') {\n return this._localeData.longDaysOfWeek;\n }\n if (style == 'short') {\n return this._localeData.shortDaysOfWeek;\n }\n return this._localeData.narrowDaysOfWeek;\n }\n\n getYearName(date: Moment): string {\n return this.clone(date).format('YYYY');\n }\n\n getFirstDayOfWeek(): number {\n return this._localeData.firstDayOfWeek;\n }\n\n getNumDaysInMonth(date: Moment): number {\n return this.clone(date).daysInMonth();\n }\n\n clone(date: Moment): Moment {\n return date.clone().locale(this.locale);\n }\n\n createDate(year: number, month: number, date: number): Moment {\n // Moment.js will create an invalid date if any of the components are out of bounds, but we\n // explicitly check each case so we can throw more descriptive errors.\n if (month < 0 || month > 11) {\n throw Error(`Invalid month index \"${month}\". Month index has to be between 0 and 11.`);\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._createMoment({year, month, date}).locale(this.locale);\n\n // If the result isn't valid, the date must have been out of bounds for this month.\n if (!result.isValid()) {\n throw Error(`Invalid date \"${date}\" for month with index \"${month}\".`);\n }\n\n return result;\n }\n\n today(): Moment {\n return this._createMoment().locale(this.locale);\n }\n\n parse(value: any, parseFormat: string | string[]): Moment | null {\n if (value && typeof value == 'string') {\n return this._createMoment(value, parseFormat, this.locale);\n }\n return value ? this._createMoment(value).locale(this.locale) : null;\n }\n\n format(date: Moment, displayFormat: string): string {\n date = this.clone(date);\n if (!this.isValid(date)) {\n throw Error('MomentDateAdapter: Cannot format invalid date.');\n }\n return date.format(displayFormat);\n }\n\n addCalendarYears(date: Moment, years: number): Moment {\n return this.clone(date).add({years});\n }\n\n addCalendarMonths(date: Moment, months: number): Moment {\n return this.clone(date).add({months});\n }\n\n addCalendarDays(date: Moment, days: number): Moment {\n return this.clone(date).add({days});\n }\n\n toIso8601(date: Moment): string {\n return this.clone(date).format();\n }\n\n /**\n * Returns the given value if given a valid Moment or null. Deserializes valid ISO 8601 strings\n * (https://www.ietf.org/rfc/rfc3339.txt) and valid Date objects into valid Moments and empty\n * string into null. Returns an invalid date for all other values.\n */\n deserialize(value: any): Moment | null {\n let date;\n if (value instanceof Date) {\n date = this._createMoment(value).locale(this.locale);\n } else if (this.isDateInstance(value)) {\n // Note: assumes that cloning also sets the correct locale.\n return this.clone(value);\n }\n if (typeof value === 'string') {\n if (!value) {\n return null;\n }\n date = this._createMoment(value, moment.ISO_8601).locale(this.locale);\n }\n if (date && this.isValid(date)) {\n return this._createMoment(date).locale(this.locale);\n }\n return super.deserialize(value);\n }\n\n isDateInstance(obj: any): boolean {\n return moment.isMoment(obj);\n }\n\n isValid(date: Moment): boolean {\n return this.clone(date).isValid();\n }\n\n invalid(): Moment {\n return moment.invalid();\n }\n\n /** Creates a Moment instance while respecting the current UTC settings. */\n private _createMoment(...args: any[]): Moment {\n return (this._options && this._options.useUtc) ? moment.utc(...args) : moment(...args);\n }\n}\n"],"names":["_rollupMoment","_moment"],"mappings":";;;;;;;;;;;;;;;;;AEmBA,MAAM,MAAM,GAAGA,sBAAa,IAAIC,aAAO,CAAvC;;;;;AAaA,AAAA,MAAa,+BAA+B,GAAG,IAAI,cAAc,CAC/D,iCAAiC,EAAE;IACjC,UAAU,EAAE,MAAM;IACl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AjD,EAAA,CAAA,EAAA;IACA,EAAA,IAAA,EAAA,SAAA,EAAA,UAAA,EAAA,CAAA,EAAA,IAAA,EAAK,QAAQ,EAAb,EAAA,EAAA,IAAA,EAAiB,MAAM,EAAvB,IAAA,EAAA,CAAwB,+BAA+B,EAAvD,EAAA,CAAA,EAAA;;;;;;;;;ADjEA,AAAA,MAAa,uBAAuB,GAAmB;IACrD,KAAK,EAAE;QACL,SAAS,EAAE,GAAG;KACf;IACD,OAAO,EAAE;QACP,SAAS,EAAE,GAAG;QACd,cAAc,EAAE,UAAU;QAC1B,aAAa,EAAE,IAAI;QACnB,kBAAkB,EAAE,WAAW;KAChC;CACF;;;;;;ADID,MAAa,gBAAgB,CAA7B;;;IATA,EAAA,IAAA,EAAC,QAAQ,EAAT,IAAA,EAAA,CAAU;gBACR,SAAS,EAAE;oBACT;wBACE,OAAO,EAAE,WAAW;wBACpB,QAAQ,EAAE,iBAAiB;wBAC3B,IAAI,EAAE,CAAC,eAAe,EAAE,+BAA+B,CAAC;qBACzD;iBACF;aACF,EAAD,EAAA;;AAMA,MAAA,EAAA,GAAoD,uBAAuB,CAA3E;AAEA,AAAA,MAAa,mBAAmB,CAAhC;;;IAJA,EAAA,IAAA,EAAC,QAAQ,EAAT,IAAA,EAAA,CAAU;gBACR,OAAO,EAAE,CAAC,gBAAgB,CAAC;gBAC3B,SAAS,EAAE,CAAC,EAAC,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAlD,EAA2E,EAAC,CAAC;aAC5E,EAAD,EAAA;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"material-moment-adapter.js","sources":["../../src/material-moment-adapter/adapter/index.ts","../../src/material-moment-adapter/adapter/moment-date-formats.ts","../../src/material-moment-adapter/adapter/moment-date-adapter.ts"],"sourcesContent":["/**\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 {DateAdapter, MAT_DATE_FORMATS, MAT_DATE_LOCALE} from '@angular/material/core';\nimport {MAT_MOMENT_DATE_ADAPTER_OPTIONS, MomentDateAdapter} from './moment-date-adapter';\nimport {MAT_MOMENT_DATE_FORMATS} from './moment-date-formats';\n\nexport * from './moment-date-adapter';\nexport * from './moment-date-formats';\n\n@NgModule({\n providers: [\n {\n provide: DateAdapter,\n useClass: MomentDateAdapter,\n deps: [MAT_DATE_LOCALE, MAT_MOMENT_DATE_ADAPTER_OPTIONS]\n }\n ],\n})\nexport class MomentDateModule {}\n\n\n@NgModule({\n imports: [MomentDateModule],\n providers: [{provide: MAT_DATE_FORMATS, useValue: MAT_MOMENT_DATE_FORMATS}],\n})\nexport class MatMomentDateModule {}\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 '@angular/material/core';\n\n\nexport const MAT_MOMENT_DATE_FORMATS: MatDateFormats = {\n parse: {\n dateInput: 'l',\n },\n display: {\n dateInput: 'l',\n monthYearLabel: 'MMM YYYY',\n dateA11yLabel: 'LL',\n monthYearA11yLabel: 'MMMM YYYY',\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 {Inject, Injectable, Optional, InjectionToken} from '@angular/core';\nimport {DateAdapter, MAT_DATE_LOCALE} from '@angular/material/core';\n// Depending on whether rollup is used, moment needs to be imported differently.\n// Since Moment.js doesn't have a default export, we normally need to import using the `* as`\n// syntax. However, rollup creates a synthetic default module and we thus need to import it using\n// the `default as` syntax.\n// TODO(mmalerba): See if we can clean this up at some point.\nimport * as _moment from 'moment';\n// tslint:disable-next-line:no-duplicate-imports\nimport {default as _rollupMoment, Moment, MomentFormatSpecification, MomentInput} from 'moment';\n\nconst moment = _rollupMoment || _moment;\n\n/** Configurable options for {@see MomentDateAdapter}. */\nexport interface MatMomentDateAdapterOptions {\n\n /**\n * When enabled, the dates have to match the format exactly.\n * See https://momentjs.com/guides/#/parsing/strict-mode/.\n */\n strict?: boolean;\n\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 moment date adapter to configure options. */\nexport const MAT_MOMENT_DATE_ADAPTER_OPTIONS = new InjectionToken<MatMomentDateAdapterOptions>(\n 'MAT_MOMENT_DATE_ADAPTER_OPTIONS', {\n providedIn: 'root',\n factory: MAT_MOMENT_DATE_ADAPTER_OPTIONS_FACTORY\n});\n\n\n/** @docs-private */\nexport function MAT_MOMENT_DATE_ADAPTER_OPTIONS_FACTORY(): MatMomentDateAdapterOptions {\n return {\n useUtc: false\n };\n}\n\n\n/** Creates an array and fills it with values. */\nfunction range<T>(length: number, valueFunction: (index: number) => T): T[] {\n const valuesArray = Array(length);\n for (let i = 0; i < length; i++) {\n valuesArray[i] = valueFunction(i);\n }\n return valuesArray;\n}\n\n\n/** Adapts Moment.js Dates for use with Angular Material. */\n@Injectable()\nexport class MomentDateAdapter extends DateAdapter<Moment> {\n // Note: all of the methods that accept a `Moment` input parameter immediately call `this.clone`\n // on it. This is to ensure that we're working with a `Moment` that has the correct locale setting\n // while avoiding mutating the original object passed to us. Just calling `.locale(...)` on the\n // input would mutate the object.\n\n private _localeData: {\n firstDayOfWeek: number,\n longMonths: string[],\n shortMonths: string[],\n dates: string[],\n longDaysOfWeek: string[],\n shortDaysOfWeek: string[],\n narrowDaysOfWeek: string[]\n };\n\n constructor(@Optional() @Inject(MAT_DATE_LOCALE) dateLocale: string,\n @Optional() @Inject(MAT_MOMENT_DATE_ADAPTER_OPTIONS)\n private _options?: MatMomentDateAdapterOptions) {\n\n super();\n this.setLocale(dateLocale || moment.locale());\n }\n\n setLocale(locale: string) {\n super.setLocale(locale);\n\n let momentLocaleData = moment.localeData(locale);\n this._localeData = {\n firstDayOfWeek: momentLocaleData.firstDayOfWeek(),\n longMonths: momentLocaleData.months(),\n shortMonths: momentLocaleData.monthsShort(),\n dates: range(31, (i) => this.createDate(2017, 0, i + 1).format('D')),\n longDaysOfWeek: momentLocaleData.weekdays(),\n shortDaysOfWeek: momentLocaleData.weekdaysShort(),\n narrowDaysOfWeek: momentLocaleData.weekdaysMin(),\n };\n }\n\n getYear(date: Moment): number {\n return this.clone(date).year();\n }\n\n getMonth(date: Moment): number {\n return this.clone(date).month();\n }\n\n getDate(date: Moment): number {\n return this.clone(date).date();\n }\n\n getDayOfWeek(date: Moment): number {\n return this.clone(date).day();\n }\n\n getMonthNames(style: 'long' | 'short' | 'narrow'): string[] {\n // Moment.js doesn't support narrow month names, so we just use short if narrow is requested.\n return style == 'long' ? this._localeData.longMonths : this._localeData.shortMonths;\n }\n\n getDateNames(): string[] {\n return this._localeData.dates;\n }\n\n getDayOfWeekNames(style: 'long' | 'short' | 'narrow'): string[] {\n if (style == 'long') {\n return this._localeData.longDaysOfWeek;\n }\n if (style == 'short') {\n return this._localeData.shortDaysOfWeek;\n }\n return this._localeData.narrowDaysOfWeek;\n }\n\n getYearName(date: Moment): string {\n return this.clone(date).format('YYYY');\n }\n\n getFirstDayOfWeek(): number {\n return this._localeData.firstDayOfWeek;\n }\n\n getNumDaysInMonth(date: Moment): number {\n return this.clone(date).daysInMonth();\n }\n\n clone(date: Moment): Moment {\n return date.clone().locale(this.locale);\n }\n\n createDate(year: number, month: number, date: number): Moment {\n // Moment.js will create an invalid date if any of the components are out of bounds, but we\n // explicitly check each case so we can throw more descriptive errors.\n if (month < 0 || month > 11) {\n throw Error(`Invalid month index \"${month}\". Month index has to be between 0 and 11.`);\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._createMoment({year, month, date}).locale(this.locale);\n\n // If the result isn't valid, the date must have been out of bounds for this month.\n if (!result.isValid()) {\n throw Error(`Invalid date \"${date}\" for month with index \"${month}\".`);\n }\n\n return result;\n }\n\n today(): Moment {\n return this._createMoment().locale(this.locale);\n }\n\n parse(value: any, parseFormat: string | string[]): Moment | null {\n if (value && typeof value == 'string') {\n return this._createMoment(value, parseFormat, this.locale);\n }\n return value ? this._createMoment(value).locale(this.locale) : null;\n }\n\n format(date: Moment, displayFormat: string): string {\n date = this.clone(date);\n if (!this.isValid(date)) {\n throw Error('MomentDateAdapter: Cannot format invalid date.');\n }\n return date.format(displayFormat);\n }\n\n addCalendarYears(date: Moment, years: number): Moment {\n return this.clone(date).add({years});\n }\n\n addCalendarMonths(date: Moment, months: number): Moment {\n return this.clone(date).add({months});\n }\n\n addCalendarDays(date: Moment, days: number): Moment {\n return this.clone(date).add({days});\n }\n\n toIso8601(date: Moment): string {\n return this.clone(date).format();\n }\n\n /**\n * Returns the given value if given a valid Moment or null. Deserializes valid ISO 8601 strings\n * (https://www.ietf.org/rfc/rfc3339.txt) and valid Date objects into valid Moments and empty\n * string into null. Returns an invalid date for all other values.\n */\n deserialize(value: any): Moment | null {\n let date;\n if (value instanceof Date) {\n date = this._createMoment(value).locale(this.locale);\n } else if (this.isDateInstance(value)) {\n // Note: assumes that cloning also sets the correct locale.\n return this.clone(value);\n }\n if (typeof value === 'string') {\n if (!value) {\n return null;\n }\n date = this._createMoment(value, moment.ISO_8601).locale(this.locale);\n }\n if (date && this.isValid(date)) {\n return this._createMoment(date).locale(this.locale);\n }\n return super.deserialize(value);\n }\n\n isDateInstance(obj: any): boolean {\n return moment.isMoment(obj);\n }\n\n isValid(date: Moment): boolean {\n return this.clone(date).isValid();\n }\n\n invalid(): Moment {\n return moment.invalid();\n }\n\n /** Creates a Moment instance while respecting the current UTC settings. */\n private _createMoment(\n date: MomentInput,\n format?: MomentFormatSpecification,\n locale?: string,\n ): Moment {\n const {strict, useUtc}: MatMomentDateAdapterOptions = this._options || {};\n\n return useUtc\n ? moment.utc(date, format, locale, strict)\n : moment(date, format, locale, strict);\n }\n}\n"],"names":["_rollupMoment","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C5E,EAAD,EAAA;;;;;;;;;;;;;;;"}
|
|
@@ -407,21 +407,24 @@ var MomentDateAdapter = /** @class */ (function (_super) {
|
|
|
407
407
|
/**
|
|
408
408
|
* Creates a Moment instance while respecting the current UTC settings.
|
|
409
409
|
* @private
|
|
410
|
-
* @param {
|
|
410
|
+
* @param {?} date
|
|
411
|
+
* @param {?=} format
|
|
412
|
+
* @param {?=} locale
|
|
411
413
|
* @return {?}
|
|
412
414
|
*/
|
|
413
415
|
MomentDateAdapter.prototype._createMoment = /**
|
|
414
416
|
* Creates a Moment instance while respecting the current UTC settings.
|
|
415
417
|
* @private
|
|
416
|
-
* @param {
|
|
418
|
+
* @param {?} date
|
|
419
|
+
* @param {?=} format
|
|
420
|
+
* @param {?=} locale
|
|
417
421
|
* @return {?}
|
|
418
422
|
*/
|
|
419
|
-
function () {
|
|
420
|
-
var
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
return (this._options && this._options.useUtc) ? moment.utc.apply(moment, args) : moment.apply(void 0, args);
|
|
423
|
+
function (date, format, locale) {
|
|
424
|
+
var _a = this._options || {}, strict = _a.strict, useUtc = _a.useUtc;
|
|
425
|
+
return useUtc
|
|
426
|
+
? moment.utc(date, format, locale, strict)
|
|
427
|
+
: moment(date, format, locale, strict);
|
|
425
428
|
};
|
|
426
429
|
MomentDateAdapter.decorators = [
|
|
427
430
|
{ type: Injectable },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"material-moment-adapter.es5.js","sources":["../../src/material-moment-adapter/adapter/index.ts","../../src/material-moment-adapter/adapter/moment-date-formats.ts","../../src/material-moment-adapter/adapter/moment-date-adapter.ts"],"sourcesContent":["/**\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 {DateAdapter, MAT_DATE_FORMATS, MAT_DATE_LOCALE} from '@angular/material/core';\nimport {MAT_MOMENT_DATE_ADAPTER_OPTIONS, MomentDateAdapter} from './moment-date-adapter';\nimport {MAT_MOMENT_DATE_FORMATS} from './moment-date-formats';\n\nexport * from './moment-date-adapter';\nexport * from './moment-date-formats';\n\n@NgModule({\n providers: [\n {\n provide: DateAdapter,\n useClass: MomentDateAdapter,\n deps: [MAT_DATE_LOCALE, MAT_MOMENT_DATE_ADAPTER_OPTIONS]\n }\n ],\n})\nexport class MomentDateModule {}\n\n\n@NgModule({\n imports: [MomentDateModule],\n providers: [{provide: MAT_DATE_FORMATS, useValue: MAT_MOMENT_DATE_FORMATS}],\n})\nexport class MatMomentDateModule {}\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 '@angular/material/core';\n\n\nexport const MAT_MOMENT_DATE_FORMATS: MatDateFormats = {\n parse: {\n dateInput: 'l',\n },\n display: {\n dateInput: 'l',\n monthYearLabel: 'MMM YYYY',\n dateA11yLabel: 'LL',\n monthYearA11yLabel: 'MMMM YYYY',\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 {Inject, Injectable, Optional, InjectionToken} from '@angular/core';\nimport {DateAdapter, MAT_DATE_LOCALE} from '@angular/material/core';\n// Depending on whether rollup is used, moment needs to be imported differently.\n// Since Moment.js doesn't have a default export, we normally need to import using the `* as`\n// syntax. However, rollup creates a synthetic default module and we thus need to import it using\n// the `default as` syntax.\n// TODO(mmalerba): See if we can clean this up at some point.\nimport * as _moment from 'moment';\n// tslint:disable-next-line:no-duplicate-imports\nimport {default as _rollupMoment, Moment} from 'moment';\n\nconst moment = _rollupMoment || _moment;\n\n/** Configurable options for {@see MomentDateAdapter}. */\nexport interface MatMomentDateAdapterOptions {\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 moment date adapter to configure options. */\nexport const MAT_MOMENT_DATE_ADAPTER_OPTIONS = new InjectionToken<MatMomentDateAdapterOptions>(\n 'MAT_MOMENT_DATE_ADAPTER_OPTIONS', {\n providedIn: 'root',\n factory: MAT_MOMENT_DATE_ADAPTER_OPTIONS_FACTORY\n});\n\n\n/** @docs-private */\nexport function MAT_MOMENT_DATE_ADAPTER_OPTIONS_FACTORY(): MatMomentDateAdapterOptions {\n return {\n useUtc: false\n };\n}\n\n\n/** Creates an array and fills it with values. */\nfunction range<T>(length: number, valueFunction: (index: number) => T): T[] {\n const valuesArray = Array(length);\n for (let i = 0; i < length; i++) {\n valuesArray[i] = valueFunction(i);\n }\n return valuesArray;\n}\n\n\n/** Adapts Moment.js Dates for use with Angular Material. */\n@Injectable()\nexport class MomentDateAdapter extends DateAdapter<Moment> {\n // Note: all of the methods that accept a `Moment` input parameter immediately call `this.clone`\n // on it. This is to ensure that we're working with a `Moment` that has the correct locale setting\n // while avoiding mutating the original object passed to us. Just calling `.locale(...)` on the\n // input would mutate the object.\n\n private _localeData: {\n firstDayOfWeek: number,\n longMonths: string[],\n shortMonths: string[],\n dates: string[],\n longDaysOfWeek: string[],\n shortDaysOfWeek: string[],\n narrowDaysOfWeek: string[]\n };\n\n constructor(@Optional() @Inject(MAT_DATE_LOCALE) dateLocale: string,\n @Optional() @Inject(MAT_MOMENT_DATE_ADAPTER_OPTIONS)\n private _options?: MatMomentDateAdapterOptions) {\n\n super();\n this.setLocale(dateLocale || moment.locale());\n }\n\n setLocale(locale: string) {\n super.setLocale(locale);\n\n let momentLocaleData = moment.localeData(locale);\n this._localeData = {\n firstDayOfWeek: momentLocaleData.firstDayOfWeek(),\n longMonths: momentLocaleData.months(),\n shortMonths: momentLocaleData.monthsShort(),\n dates: range(31, (i) => this.createDate(2017, 0, i + 1).format('D')),\n longDaysOfWeek: momentLocaleData.weekdays(),\n shortDaysOfWeek: momentLocaleData.weekdaysShort(),\n narrowDaysOfWeek: momentLocaleData.weekdaysMin(),\n };\n }\n\n getYear(date: Moment): number {\n return this.clone(date).year();\n }\n\n getMonth(date: Moment): number {\n return this.clone(date).month();\n }\n\n getDate(date: Moment): number {\n return this.clone(date).date();\n }\n\n getDayOfWeek(date: Moment): number {\n return this.clone(date).day();\n }\n\n getMonthNames(style: 'long' | 'short' | 'narrow'): string[] {\n // Moment.js doesn't support narrow month names, so we just use short if narrow is requested.\n return style == 'long' ? this._localeData.longMonths : this._localeData.shortMonths;\n }\n\n getDateNames(): string[] {\n return this._localeData.dates;\n }\n\n getDayOfWeekNames(style: 'long' | 'short' | 'narrow'): string[] {\n if (style == 'long') {\n return this._localeData.longDaysOfWeek;\n }\n if (style == 'short') {\n return this._localeData.shortDaysOfWeek;\n }\n return this._localeData.narrowDaysOfWeek;\n }\n\n getYearName(date: Moment): string {\n return this.clone(date).format('YYYY');\n }\n\n getFirstDayOfWeek(): number {\n return this._localeData.firstDayOfWeek;\n }\n\n getNumDaysInMonth(date: Moment): number {\n return this.clone(date).daysInMonth();\n }\n\n clone(date: Moment): Moment {\n return date.clone().locale(this.locale);\n }\n\n createDate(year: number, month: number, date: number): Moment {\n // Moment.js will create an invalid date if any of the components are out of bounds, but we\n // explicitly check each case so we can throw more descriptive errors.\n if (month < 0 || month > 11) {\n throw Error(`Invalid month index \"${month}\". Month index has to be between 0 and 11.`);\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._createMoment({year, month, date}).locale(this.locale);\n\n // If the result isn't valid, the date must have been out of bounds for this month.\n if (!result.isValid()) {\n throw Error(`Invalid date \"${date}\" for month with index \"${month}\".`);\n }\n\n return result;\n }\n\n today(): Moment {\n return this._createMoment().locale(this.locale);\n }\n\n parse(value: any, parseFormat: string | string[]): Moment | null {\n if (value && typeof value == 'string') {\n return this._createMoment(value, parseFormat, this.locale);\n }\n return value ? this._createMoment(value).locale(this.locale) : null;\n }\n\n format(date: Moment, displayFormat: string): string {\n date = this.clone(date);\n if (!this.isValid(date)) {\n throw Error('MomentDateAdapter: Cannot format invalid date.');\n }\n return date.format(displayFormat);\n }\n\n addCalendarYears(date: Moment, years: number): Moment {\n return this.clone(date).add({years});\n }\n\n addCalendarMonths(date: Moment, months: number): Moment {\n return this.clone(date).add({months});\n }\n\n addCalendarDays(date: Moment, days: number): Moment {\n return this.clone(date).add({days});\n }\n\n toIso8601(date: Moment): string {\n return this.clone(date).format();\n }\n\n /**\n * Returns the given value if given a valid Moment or null. Deserializes valid ISO 8601 strings\n * (https://www.ietf.org/rfc/rfc3339.txt) and valid Date objects into valid Moments and empty\n * string into null. Returns an invalid date for all other values.\n */\n deserialize(value: any): Moment | null {\n let date;\n if (value instanceof Date) {\n date = this._createMoment(value).locale(this.locale);\n } else if (this.isDateInstance(value)) {\n // Note: assumes that cloning also sets the correct locale.\n return this.clone(value);\n }\n if (typeof value === 'string') {\n if (!value) {\n return null;\n }\n date = this._createMoment(value, moment.ISO_8601).locale(this.locale);\n }\n if (date && this.isValid(date)) {\n return this._createMoment(date).locale(this.locale);\n }\n return super.deserialize(value);\n }\n\n isDateInstance(obj: any): boolean {\n return moment.isMoment(obj);\n }\n\n isValid(date: Moment): boolean {\n return this.clone(date).isValid();\n }\n\n invalid(): Moment {\n return moment.invalid();\n }\n\n /** Creates a Moment instance while respecting the current UTC settings. */\n private _createMoment(...args: any[]): Moment {\n return (this._options && this._options.useUtc) ? moment.utc(...args) : moment(...args);\n }\n}\n"],"names":["tslib_1.__extends","_rollupMoment","_moment"],"mappings":";;;;;;;;;;;;;;;;;;AEmBA,IAAM,MAAM,GAAGC,sBAAa,IAAIC,aAAO,CAAvC;;;;;AAaA,AAAA,IAAa,+BAA+B,GAAG,IAAI,cAAc,CAC/D,iCAAiC,EAAE;IACjC,UAAU,EAAE,MAAM;IAClB,OAAO,EAAE,uCAAuC;CACnD,CAAC,CAAF;;;;;AAIA,AAAA,SAAgB,uCA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A,mBAAA,kBAAA,YAAA;IAAA,SAAA,mBAAA,GAAA;KAImC;;QAJnC,EAAA,IAAA,EAAC,QAAQ,EAAT,IAAA,EAAA,CAAU;oBACR,OAAO,EAAE,CAAC,gBAAgB,CAAC;oBAC3B,SAAS,EAAE,CAAC,EAAC,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAlD,EAA2E,EAAC,CAAC;iBAC5E,EAAD,EAAA;;IACkC,OAAlC,mBAAmC,CAAnC;CAAmC,EAAnC,CAAA;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"material-moment-adapter.es5.js","sources":["../../src/material-moment-adapter/adapter/index.ts","../../src/material-moment-adapter/adapter/moment-date-formats.ts","../../src/material-moment-adapter/adapter/moment-date-adapter.ts"],"sourcesContent":["/**\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 {DateAdapter, MAT_DATE_FORMATS, MAT_DATE_LOCALE} from '@angular/material/core';\nimport {MAT_MOMENT_DATE_ADAPTER_OPTIONS, MomentDateAdapter} from './moment-date-adapter';\nimport {MAT_MOMENT_DATE_FORMATS} from './moment-date-formats';\n\nexport * from './moment-date-adapter';\nexport * from './moment-date-formats';\n\n@NgModule({\n providers: [\n {\n provide: DateAdapter,\n useClass: MomentDateAdapter,\n deps: [MAT_DATE_LOCALE, MAT_MOMENT_DATE_ADAPTER_OPTIONS]\n }\n ],\n})\nexport class MomentDateModule {}\n\n\n@NgModule({\n imports: [MomentDateModule],\n providers: [{provide: MAT_DATE_FORMATS, useValue: MAT_MOMENT_DATE_FORMATS}],\n})\nexport class MatMomentDateModule {}\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 '@angular/material/core';\n\n\nexport const MAT_MOMENT_DATE_FORMATS: MatDateFormats = {\n parse: {\n dateInput: 'l',\n },\n display: {\n dateInput: 'l',\n monthYearLabel: 'MMM YYYY',\n dateA11yLabel: 'LL',\n monthYearA11yLabel: 'MMMM YYYY',\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 {Inject, Injectable, Optional, InjectionToken} from '@angular/core';\nimport {DateAdapter, MAT_DATE_LOCALE} from '@angular/material/core';\n// Depending on whether rollup is used, moment needs to be imported differently.\n// Since Moment.js doesn't have a default export, we normally need to import using the `* as`\n// syntax. However, rollup creates a synthetic default module and we thus need to import it using\n// the `default as` syntax.\n// TODO(mmalerba): See if we can clean this up at some point.\nimport * as _moment from 'moment';\n// tslint:disable-next-line:no-duplicate-imports\nimport {default as _rollupMoment, Moment, MomentFormatSpecification, MomentInput} from 'moment';\n\nconst moment = _rollupMoment || _moment;\n\n/** Configurable options for {@see MomentDateAdapter}. */\nexport interface MatMomentDateAdapterOptions {\n\n /**\n * When enabled, the dates have to match the format exactly.\n * See https://momentjs.com/guides/#/parsing/strict-mode/.\n */\n strict?: boolean;\n\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 moment date adapter to configure options. */\nexport const MAT_MOMENT_DATE_ADAPTER_OPTIONS = new InjectionToken<MatMomentDateAdapterOptions>(\n 'MAT_MOMENT_DATE_ADAPTER_OPTIONS', {\n providedIn: 'root',\n factory: MAT_MOMENT_DATE_ADAPTER_OPTIONS_FACTORY\n});\n\n\n/** @docs-private */\nexport function MAT_MOMENT_DATE_ADAPTER_OPTIONS_FACTORY(): MatMomentDateAdapterOptions {\n return {\n useUtc: false\n };\n}\n\n\n/** Creates an array and fills it with values. */\nfunction range<T>(length: number, valueFunction: (index: number) => T): T[] {\n const valuesArray = Array(length);\n for (let i = 0; i < length; i++) {\n valuesArray[i] = valueFunction(i);\n }\n return valuesArray;\n}\n\n\n/** Adapts Moment.js Dates for use with Angular Material. */\n@Injectable()\nexport class MomentDateAdapter extends DateAdapter<Moment> {\n // Note: all of the methods that accept a `Moment` input parameter immediately call `this.clone`\n // on it. This is to ensure that we're working with a `Moment` that has the correct locale setting\n // while avoiding mutating the original object passed to us. Just calling `.locale(...)` on the\n // input would mutate the object.\n\n private _localeData: {\n firstDayOfWeek: number,\n longMonths: string[],\n shortMonths: string[],\n dates: string[],\n longDaysOfWeek: string[],\n shortDaysOfWeek: string[],\n narrowDaysOfWeek: string[]\n };\n\n constructor(@Optional() @Inject(MAT_DATE_LOCALE) dateLocale: string,\n @Optional() @Inject(MAT_MOMENT_DATE_ADAPTER_OPTIONS)\n private _options?: MatMomentDateAdapterOptions) {\n\n super();\n this.setLocale(dateLocale || moment.locale());\n }\n\n setLocale(locale: string) {\n super.setLocale(locale);\n\n let momentLocaleData = moment.localeData(locale);\n this._localeData = {\n firstDayOfWeek: momentLocaleData.firstDayOfWeek(),\n longMonths: momentLocaleData.months(),\n shortMonths: momentLocaleData.monthsShort(),\n dates: range(31, (i) => this.createDate(2017, 0, i + 1).format('D')),\n longDaysOfWeek: momentLocaleData.weekdays(),\n shortDaysOfWeek: momentLocaleData.weekdaysShort(),\n narrowDaysOfWeek: momentLocaleData.weekdaysMin(),\n };\n }\n\n getYear(date: Moment): number {\n return this.clone(date).year();\n }\n\n getMonth(date: Moment): number {\n return this.clone(date).month();\n }\n\n getDate(date: Moment): number {\n return this.clone(date).date();\n }\n\n getDayOfWeek(date: Moment): number {\n return this.clone(date).day();\n }\n\n getMonthNames(style: 'long' | 'short' | 'narrow'): string[] {\n // Moment.js doesn't support narrow month names, so we just use short if narrow is requested.\n return style == 'long' ? this._localeData.longMonths : this._localeData.shortMonths;\n }\n\n getDateNames(): string[] {\n return this._localeData.dates;\n }\n\n getDayOfWeekNames(style: 'long' | 'short' | 'narrow'): string[] {\n if (style == 'long') {\n return this._localeData.longDaysOfWeek;\n }\n if (style == 'short') {\n return this._localeData.shortDaysOfWeek;\n }\n return this._localeData.narrowDaysOfWeek;\n }\n\n getYearName(date: Moment): string {\n return this.clone(date).format('YYYY');\n }\n\n getFirstDayOfWeek(): number {\n return this._localeData.firstDayOfWeek;\n }\n\n getNumDaysInMonth(date: Moment): number {\n return this.clone(date).daysInMonth();\n }\n\n clone(date: Moment): Moment {\n return date.clone().locale(this.locale);\n }\n\n createDate(year: number, month: number, date: number): Moment {\n // Moment.js will create an invalid date if any of the components are out of bounds, but we\n // explicitly check each case so we can throw more descriptive errors.\n if (month < 0 || month > 11) {\n throw Error(`Invalid month index \"${month}\". Month index has to be between 0 and 11.`);\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._createMoment({year, month, date}).locale(this.locale);\n\n // If the result isn't valid, the date must have been out of bounds for this month.\n if (!result.isValid()) {\n throw Error(`Invalid date \"${date}\" for month with index \"${month}\".`);\n }\n\n return result;\n }\n\n today(): Moment {\n return this._createMoment().locale(this.locale);\n }\n\n parse(value: any, parseFormat: string | string[]): Moment | null {\n if (value && typeof value == 'string') {\n return this._createMoment(value, parseFormat, this.locale);\n }\n return value ? this._createMoment(value).locale(this.locale) : null;\n }\n\n format(date: Moment, displayFormat: string): string {\n date = this.clone(date);\n if (!this.isValid(date)) {\n throw Error('MomentDateAdapter: Cannot format invalid date.');\n }\n return date.format(displayFormat);\n }\n\n addCalendarYears(date: Moment, years: number): Moment {\n return this.clone(date).add({years});\n }\n\n addCalendarMonths(date: Moment, months: number): Moment {\n return this.clone(date).add({months});\n }\n\n addCalendarDays(date: Moment, days: number): Moment {\n return this.clone(date).add({days});\n }\n\n toIso8601(date: Moment): string {\n return this.clone(date).format();\n }\n\n /**\n * Returns the given value if given a valid Moment or null. Deserializes valid ISO 8601 strings\n * (https://www.ietf.org/rfc/rfc3339.txt) and valid Date objects into valid Moments and empty\n * string into null. Returns an invalid date for all other values.\n */\n deserialize(value: any): Moment | null {\n let date;\n if (value instanceof Date) {\n date = this._createMoment(value).locale(this.locale);\n } else if (this.isDateInstance(value)) {\n // Note: assumes that cloning also sets the correct locale.\n return this.clone(value);\n }\n if (typeof value === 'string') {\n if (!value) {\n return null;\n }\n date = this._createMoment(value, moment.ISO_8601).locale(this.locale);\n }\n if (date && this.isValid(date)) {\n return this._createMoment(date).locale(this.locale);\n }\n return super.deserialize(value);\n }\n\n isDateInstance(obj: any): boolean {\n return moment.isMoment(obj);\n }\n\n isValid(date: Moment): boolean {\n return this.clone(date).isValid();\n }\n\n invalid(): Moment {\n return moment.invalid();\n }\n\n /** Creates a Moment instance while respecting the current UTC settings. */\n private _createMoment(\n date: MomentInput,\n format?: MomentFormatSpecification,\n locale?: string,\n ): Moment {\n const {strict, useUtc}: MatMomentDateAdapterOptions = this._options || {};\n\n return useUtc\n ? moment.utc(date, format, locale, strict)\n : moment(date, format, locale, strict);\n }\n}\n"],"names":["tslib_1.__extends","_rollupMoment","_moment"],"mappings":";;;;;;;;;;;;;;;;;;AEmBA,IAAM,MAAM,GAAGC,sBAAa,IAAIC,aAAO,CAAvC;;;;;AAoBA,AAAA,IAAa,+BAA+B,GAAG,IAAI,cAAc,CAC/D,iCAAiC,EAAE;IACjC,UAAU,EAAE,MAAM;IAClB,OAAO,EAAE,uCAAuC;CACnD,CAAC,CAAF;;;;;AAIA,AAAA,SAAgB,uCAAuC,GAAvD;IACE,OAAO;QACL,MAAM,EAAE,KAAK;KACd,CAAC;CACH;;;;;;;;AAID,SAAS,KAAK,CAAI,MAAc,EAAE,aAAmC,EAArE;;IACA,IAAQ,WAAW,GAAG,KAAK,CAAC,MAAM,CAAC,CAAnC;IACE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE;QAC/B,WAAW,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC;KACnC;IACD,OAAO,WAAW,CAAC;CACpB;;;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
|
3
|
+
"version": "8.2.3",
|
|
4
4
|
"description": "Angular Material Moment Adapter",
|
|
5
5
|
"main": "./bundles/material-moment-adapter.umd.js",
|
|
6
6
|
"module": "./esm5/material-moment-adapter.es5.js",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
},
|
|
17
17
|
"homepage": "https://github.com/angular/components#readme",
|
|
18
18
|
"peerDependencies": {
|
|
19
|
-
"@angular/material": "8.
|
|
19
|
+
"@angular/material": "8.2.3",
|
|
20
20
|
"@angular/core": "^8.0.0 || ^9.0.0-0",
|
|
21
21
|
"moment": "^2.18.1"
|
|
22
22
|
},
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"@angular/material-moment-adapter"
|
|
31
31
|
]
|
|
32
32
|
},
|
|
33
|
-
"releaseGitCommitSha": "
|
|
34
|
-
"releaseGitBranch": "8.
|
|
35
|
-
"releaseGitUser": "
|
|
33
|
+
"releaseGitCommitSha": "0b175c619f37f450f147d42f8c562f08333ed330",
|
|
34
|
+
"releaseGitBranch": "8.2.x",
|
|
35
|
+
"releaseGitUser": "Miles Malerba <mmalerba@google.com>"
|
|
36
36
|
}
|
|
@@ -10,12 +10,17 @@ import { DateAdapter } from '@angular/material/core';
|
|
|
10
10
|
import { Moment } from 'moment';
|
|
11
11
|
/** Configurable options for {@see MomentDateAdapter}. */
|
|
12
12
|
export interface MatMomentDateAdapterOptions {
|
|
13
|
+
/**
|
|
14
|
+
* When enabled, the dates have to match the format exactly.
|
|
15
|
+
* See https://momentjs.com/guides/#/parsing/strict-mode/.
|
|
16
|
+
*/
|
|
17
|
+
strict?: boolean;
|
|
13
18
|
/**
|
|
14
19
|
* Turns the use of utc dates on or off.
|
|
15
20
|
* Changing this will change how Angular Material components like DatePicker output dates.
|
|
16
21
|
* {@default false}
|
|
17
22
|
*/
|
|
18
|
-
useUtc
|
|
23
|
+
useUtc?: boolean;
|
|
19
24
|
}
|
|
20
25
|
/** InjectionToken for moment date adapter to configure options. */
|
|
21
26
|
export declare const MAT_MOMENT_DATE_ADAPTER_OPTIONS: InjectionToken<MatMomentDateAdapterOptions>;
|
|
@@ -10,12 +10,17 @@ import { DateAdapter } from '@angular/material/core';
|
|
|
10
10
|
import { Moment } from 'moment';
|
|
11
11
|
/** Configurable options for {@see MomentDateAdapter}. */
|
|
12
12
|
export interface MatMomentDateAdapterOptions {
|
|
13
|
+
/**
|
|
14
|
+
* When enabled, the dates have to match the format exactly.
|
|
15
|
+
* See https://momentjs.com/guides/#/parsing/strict-mode/.
|
|
16
|
+
*/
|
|
17
|
+
strict?: boolean;
|
|
13
18
|
/**
|
|
14
19
|
* Turns the use of utc dates on or off.
|
|
15
20
|
* Changing this will change how Angular Material components like DatePicker output dates.
|
|
16
21
|
* {@default false}
|
|
17
22
|
*/
|
|
18
|
-
useUtc
|
|
23
|
+
useUtc?: boolean;
|
|
19
24
|
}
|
|
20
25
|
/** InjectionToken for moment date adapter to configure options. */
|
|
21
26
|
export declare const MAT_MOMENT_DATE_ADAPTER_OPTIONS: InjectionToken<MatMomentDateAdapterOptions>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"__symbolic":"module","version":4,"metadata":{"MomentDateModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":16,"character":1},"arguments":[{"providers":[{"provide":{"__symbolic":"reference","module":"@angular/material/core","name":"DateAdapter","line":19,"character":15},"useClass":{"__symbolic":"reference","name":"MomentDateAdapter"},"deps":[{"__symbolic":"reference","module":"@angular/material/core","name":"MAT_DATE_LOCALE","line":21,"character":13},{"__symbolic":"reference","name":"MAT_MOMENT_DATE_ADAPTER_OPTIONS"}]}]}]}],"members":{}},"MatMomentDateModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":28,"character":1},"arguments":[{"imports":[{"__symbolic":"reference","name":"MomentDateModule"}],"providers":[{"provide":{"__symbolic":"reference","module":"@angular/material/core","name":"MAT_DATE_FORMATS","line":30,"character":24},"useValue":{"__symbolic":"reference","name":"MAT_MOMENT_DATE_FORMATS"}}]}]}],"members":{}},"MatMomentDateAdapterOptions":{"__symbolic":"interface"},"MAT_MOMENT_DATE_ADAPTER_OPTIONS":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":
|
|
1
|
+
{"__symbolic":"module","version":4,"metadata":{"MomentDateModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":16,"character":1},"arguments":[{"providers":[{"provide":{"__symbolic":"reference","module":"@angular/material/core","name":"DateAdapter","line":19,"character":15},"useClass":{"__symbolic":"reference","name":"MomentDateAdapter"},"deps":[{"__symbolic":"reference","module":"@angular/material/core","name":"MAT_DATE_LOCALE","line":21,"character":13},{"__symbolic":"reference","name":"MAT_MOMENT_DATE_ADAPTER_OPTIONS"}]}]}]}],"members":{}},"MatMomentDateModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":28,"character":1},"arguments":[{"imports":[{"__symbolic":"reference","name":"MomentDateModule"}],"providers":[{"provide":{"__symbolic":"reference","module":"@angular/material/core","name":"MAT_DATE_FORMATS","line":30,"character":24},"useValue":{"__symbolic":"reference","name":"MAT_MOMENT_DATE_FORMATS"}}]}]}],"members":{}},"MatMomentDateAdapterOptions":{"__symbolic":"interface"},"MAT_MOMENT_DATE_ADAPTER_OPTIONS":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":39,"character":51},"arguments":["MAT_MOMENT_DATE_ADAPTER_OPTIONS",{"providedIn":"root","factory":{"__symbolic":"reference","name":"MAT_MOMENT_DATE_ADAPTER_OPTIONS_FACTORY"}}]},"MAT_MOMENT_DATE_ADAPTER_OPTIONS_FACTORY":{"__symbolic":"function","parameters":[],"value":{"useUtc":false}},"MomentDateAdapter":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"@angular/material/core","name":"DateAdapter","line":66,"character":39},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":65,"character":1}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional","line":82,"character":15}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":82,"character":27},"arguments":[{"__symbolic":"reference","module":"@angular/material/core","name":"MAT_DATE_LOCALE","line":82,"character":34}]}],[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional","line":83,"character":5}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":83,"character":17},"arguments":[{"__symbolic":"reference","name":"MAT_MOMENT_DATE_ADAPTER_OPTIONS"}]}]],"parameters":[{"__symbolic":"reference","name":"string"},{"__symbolic":"reference","name":"any"}]}],"setLocale":[{"__symbolic":"method"}],"getYear":[{"__symbolic":"method"}],"getMonth":[{"__symbolic":"method"}],"getDate":[{"__symbolic":"method"}],"getDayOfWeek":[{"__symbolic":"method"}],"getMonthNames":[{"__symbolic":"method"}],"getDateNames":[{"__symbolic":"method"}],"getDayOfWeekNames":[{"__symbolic":"method"}],"getYearName":[{"__symbolic":"method"}],"getFirstDayOfWeek":[{"__symbolic":"method"}],"getNumDaysInMonth":[{"__symbolic":"method"}],"clone":[{"__symbolic":"method"}],"createDate":[{"__symbolic":"method"}],"today":[{"__symbolic":"method"}],"parse":[{"__symbolic":"method"}],"format":[{"__symbolic":"method"}],"addCalendarYears":[{"__symbolic":"method"}],"addCalendarMonths":[{"__symbolic":"method"}],"addCalendarDays":[{"__symbolic":"method"}],"toIso8601":[{"__symbolic":"method"}],"deserialize":[{"__symbolic":"method"}],"isDateInstance":[{"__symbolic":"method"}],"isValid":[{"__symbolic":"method"}],"invalid":[{"__symbolic":"method"}],"_createMoment":[{"__symbolic":"method"}]}},"MAT_MOMENT_DATE_FORMATS":{"parse":{"dateInput":"l"},"display":{"dateInput":"l","monthYearLabel":"MMM YYYY","dateA11yLabel":"LL","monthYearA11yLabel":"MMMM YYYY"}}},"origins":{"MomentDateModule":"./adapter/index","MatMomentDateModule":"./adapter/index","MatMomentDateAdapterOptions":"./adapter/moment-date-adapter","MAT_MOMENT_DATE_ADAPTER_OPTIONS":"./adapter/moment-date-adapter","MAT_MOMENT_DATE_ADAPTER_OPTIONS_FACTORY":"./adapter/moment-date-adapter","MomentDateAdapter":"./adapter/moment-date-adapter","MAT_MOMENT_DATE_FORMATS":"./adapter/moment-date-formats"},"importAs":"@angular/material-moment-adapter"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"__symbolic":"module","version":4,"metadata":{"MomentDateModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":16,"character":1},"arguments":[{"providers":[{"provide":{"__symbolic":"reference","module":"@angular/material/core","name":"DateAdapter","line":19,"character":15},"useClass":{"__symbolic":"reference","name":"MomentDateAdapter"},"deps":[{"__symbolic":"reference","module":"@angular/material/core","name":"MAT_DATE_LOCALE","line":21,"character":13},{"__symbolic":"reference","name":"MAT_MOMENT_DATE_ADAPTER_OPTIONS"}]}]}]}],"members":{}},"MatMomentDateModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":28,"character":1},"arguments":[{"imports":[{"__symbolic":"reference","name":"MomentDateModule"}],"providers":[{"provide":{"__symbolic":"reference","module":"@angular/material/core","name":"MAT_DATE_FORMATS","line":30,"character":24},"useValue":{"__symbolic":"reference","name":"MAT_MOMENT_DATE_FORMATS"}}]}]}],"members":{}},"MatMomentDateAdapterOptions":{"__symbolic":"interface"},"MAT_MOMENT_DATE_ADAPTER_OPTIONS":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":
|
|
1
|
+
{"__symbolic":"module","version":4,"metadata":{"MomentDateModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":16,"character":1},"arguments":[{"providers":[{"provide":{"__symbolic":"reference","module":"@angular/material/core","name":"DateAdapter","line":19,"character":15},"useClass":{"__symbolic":"reference","name":"MomentDateAdapter"},"deps":[{"__symbolic":"reference","module":"@angular/material/core","name":"MAT_DATE_LOCALE","line":21,"character":13},{"__symbolic":"reference","name":"MAT_MOMENT_DATE_ADAPTER_OPTIONS"}]}]}]}],"members":{}},"MatMomentDateModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":28,"character":1},"arguments":[{"imports":[{"__symbolic":"reference","name":"MomentDateModule"}],"providers":[{"provide":{"__symbolic":"reference","module":"@angular/material/core","name":"MAT_DATE_FORMATS","line":30,"character":24},"useValue":{"__symbolic":"reference","name":"MAT_MOMENT_DATE_FORMATS"}}]}]}],"members":{}},"MatMomentDateAdapterOptions":{"__symbolic":"interface"},"MAT_MOMENT_DATE_ADAPTER_OPTIONS":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":39,"character":51},"arguments":["MAT_MOMENT_DATE_ADAPTER_OPTIONS",{"providedIn":"root","factory":{"__symbolic":"reference","name":"MAT_MOMENT_DATE_ADAPTER_OPTIONS_FACTORY"}}]},"MAT_MOMENT_DATE_ADAPTER_OPTIONS_FACTORY":{"__symbolic":"function","parameters":[],"value":{"useUtc":false}},"MomentDateAdapter":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"@angular/material/core","name":"DateAdapter","line":66,"character":39},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":65,"character":1}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional","line":82,"character":15}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":82,"character":27},"arguments":[{"__symbolic":"reference","module":"@angular/material/core","name":"MAT_DATE_LOCALE","line":82,"character":34}]}],[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional","line":83,"character":5}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":83,"character":17},"arguments":[{"__symbolic":"reference","name":"MAT_MOMENT_DATE_ADAPTER_OPTIONS"}]}]],"parameters":[{"__symbolic":"reference","name":"string"},{"__symbolic":"reference","name":"any"}]}],"setLocale":[{"__symbolic":"method"}],"getYear":[{"__symbolic":"method"}],"getMonth":[{"__symbolic":"method"}],"getDate":[{"__symbolic":"method"}],"getDayOfWeek":[{"__symbolic":"method"}],"getMonthNames":[{"__symbolic":"method"}],"getDateNames":[{"__symbolic":"method"}],"getDayOfWeekNames":[{"__symbolic":"method"}],"getYearName":[{"__symbolic":"method"}],"getFirstDayOfWeek":[{"__symbolic":"method"}],"getNumDaysInMonth":[{"__symbolic":"method"}],"clone":[{"__symbolic":"method"}],"createDate":[{"__symbolic":"method"}],"today":[{"__symbolic":"method"}],"parse":[{"__symbolic":"method"}],"format":[{"__symbolic":"method"}],"addCalendarYears":[{"__symbolic":"method"}],"addCalendarMonths":[{"__symbolic":"method"}],"addCalendarDays":[{"__symbolic":"method"}],"toIso8601":[{"__symbolic":"method"}],"deserialize":[{"__symbolic":"method"}],"isDateInstance":[{"__symbolic":"method"}],"isValid":[{"__symbolic":"method"}],"invalid":[{"__symbolic":"method"}],"_createMoment":[{"__symbolic":"method"}]}},"MAT_MOMENT_DATE_FORMATS":{"parse":{"dateInput":"l"},"display":{"dateInput":"l","monthYearLabel":"MMM YYYY","dateA11yLabel":"LL","monthYearA11yLabel":"MMMM YYYY"}}},"origins":{"MomentDateModule":"./adapter/index","MatMomentDateModule":"./adapter/index","MatMomentDateAdapterOptions":"./adapter/moment-date-adapter","MAT_MOMENT_DATE_ADAPTER_OPTIONS":"./adapter/moment-date-adapter","MAT_MOMENT_DATE_ADAPTER_OPTIONS_FACTORY":"./adapter/moment-date-adapter","MomentDateAdapter":"./adapter/moment-date-adapter","MAT_MOMENT_DATE_FORMATS":"./adapter/moment-date-formats"},"importAs":"@angular/material-moment-adapter"}
|