UNPKG

locutus

Version:

Locutus other languages' standard libraries to JavaScript for fun and educational purposes

18 lines (17 loc) 794 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.weekheader = weekheader; const _calendar_ts_1 = require("../_helpers/_calendar.js"); function weekheader(width) { // discuss at: https://locutus.io/python/calendar/weekheader/ // parity verified: Python 3.12 // original by: Kevin van Zonneveld (https://kvz.io) // example 1: weekheader(2) // returns 1: 'Mo Tu We Th Fr Sa Su' // example 2: weekheader(3) // returns 2: 'Mon Tue Wed Thu Fri Sat Sun' if (arguments.length === 0) { throw new TypeError("formatweekheader() missing 1 required positional argument: 'width'"); } return (0, _calendar_ts_1.buildWeekHeader)((0, _calendar_ts_1.normalizeWeekWidth)(width, 'weekheader')); }