locutus
Version:
Locutus other languages' standard libraries to JavaScript for fun and educational purposes
19 lines (18 loc) • 882 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.week = week;
const _calendar_ts_1 = require("../_helpers/_calendar.js");
function week(theweek, width) {
// discuss at: https://locutus.io/python/calendar/week/
// parity verified: Python 3.12
// original by: Kevin van Zonneveld (https://kvz.io)
// example 1: week([[26, 0], [27, 1], [28, 2], [29, 3], [0, 4], [0, 5], [0, 6]], 2)
// returns 1: '26 27 28 29 '
if (arguments.length === 0) {
throw new TypeError("formatweek() missing 2 required positional arguments: 'theweek' and 'width'");
}
if (arguments.length === 1) {
throw new TypeError("formatweek() missing 1 required positional argument: 'width'");
}
return (0, _calendar_ts_1.formatWeek)(theweek, (0, _calendar_ts_1.toCalendarInteger)(width, 'week'));
}