UNPKG

vremel

Version:

JavaScript date utility library for Temporal API

22 lines (21 loc) 321 B
/** @internal */ export function getMonthAbbreviationFromNumber(num: number): string { const name = [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", ][num - 1]; if (name === undefined) { throw new Error(`Invalid month number: ${num}`); } return name; }