@drewsonne/maya-dates
Version:
Typescript package to manipulate dates in the Maya Calendar
29 lines • 1 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
var calendar_round_1 = require("../cr/calendar-round");
var CalendarRoundIterator = (function () {
function CalendarRoundIterator() {
this.isFirst = true;
this.fullDate = calendar_round_1.origin;
this.current = this.fullDate;
}
CalendarRoundIterator.prototype.reset = function () {
this.current = this.fullDate;
this.isFirst = true;
};
CalendarRoundIterator.prototype.next = function () {
if (this.isFirst) {
this.isFirst = false;
return { value: this.current, done: false };
}
var next = this.current.next();
if (next === this.fullDate) {
return { value: null, done: true };
}
this.current = next;
return { value: next, done: false };
};
return CalendarRoundIterator;
}());
exports.default = CalendarRoundIterator;
//# sourceMappingURL=calendar-round-iter.js.map