timeperiodjs
Version:
Time Period Library
27 lines (26 loc) • 685 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Sorter = void 0;
class Sorter {
constructor(periods, dates) {
this._periods = [];
this._dates = [];
if (periods)
this._periods = [...periods];
if (dates)
this._dates = [...dates];
}
get periods() {
return [...this._periods];
}
get dates() {
return [...this._dates];
}
static sortAscending(firstVal, secondVal) {
return firstVal - secondVal;
}
static sortDescending(firstVal, secondVal) {
return secondVal - firstVal;
}
}
exports.Sorter = Sorter;