UNPKG

@phensley/cldr-core

Version:
44 lines 1.78 kB
"use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); Object.defineProperty(exports, "__esModule", { value: true }); var gregorian_1 = require("./gregorian"); /** * Gregorian calendar with ISO-8601 first day of week and minimum days in week. * * type: iso8601 * * @alpha */ var ISO8601Date = /** @class */ (function (_super) { __extends(ISO8601Date, _super); function ISO8601Date() { // ISO-8601 dates use hard-coded firstDay and minDays return _super.call(this, 'iso8601', 2 /* MONDAY */, 4 /* ISO8601_MIN_DAYS */) || this; } ISO8601Date.prototype.add = function (fields) { var zoneId = fields.zoneId || this.timeZoneId(); var _a = this._add(fields), jd = _a[0], ms = _a[1]; return new ISO8601Date().initFromJD(jd, ms, zoneId); }; ISO8601Date.prototype.toString = function () { return this._toString('ISO8601'); }; ISO8601Date.fromUnixEpoch = function (epoch, zoneId, firstDay, minDays) { return new ISO8601Date().initFromUnixEpoch(epoch, zoneId); }; ISO8601Date.prototype.initFromUnixEpoch = function (epoch, zoneId) { return _super.prototype.initFromUnixEpoch.call(this, epoch, zoneId); }; return ISO8601Date; }(gregorian_1.GregorianDate)); exports.ISO8601Date = ISO8601Date; //# sourceMappingURL=iso8601.js.map