UNPKG

@drewsonne/maya-dates

Version:

Typescript package to manipulate dates in the Maya Calendar

64 lines 2.3 kB
"use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); var western_1 = __importDefault(require("./western")); var OFFSET_TABLE = [ [1011734, -8], [1455864, -8], [1599864, -5], [1743864, -2], [1887864, 1], [1903742, 2], [1940267, 3], [1976792, 4], [2049842, 5], [2086367, 6], [2122892, 7], [2195942, 8], [2232467, 9], [2268991, 10], [2299160, 0], ]; var GregorianCalendarDate = (function (_super) { __extends(GregorianCalendarDate, _super); function GregorianCalendarDate() { return _super !== null && _super.apply(this, arguments) || this; } Object.defineProperty(GregorianCalendarDate.prototype, "offset", { get: function () { var currentOffset = -8; for (var _i = 0, OFFSET_TABLE_1 = OFFSET_TABLE; _i < OFFSET_TABLE_1.length; _i++) { var _a = OFFSET_TABLE_1[_i], startJdn = _a[0], offsetValue = _a[1]; if (this.julianDay >= startJdn) { currentOffset = offsetValue; } else { break; } } return currentOffset; }, enumerable: false, configurable: true }); return GregorianCalendarDate; }(western_1.default)); exports.default = GregorianCalendarDate; //# sourceMappingURL=gregorian.js.map