Skip to content

Commit

Permalink
avoid repetition of format options (#1796)
Browse files Browse the repository at this point in the history
(as suggested by #1794 (comment); note that the second line is still in the ugly "paragraph" mode in VSCode, even though it's shorter that the first line 🤷
  • Loading branch information
Fil authored Aug 9, 2023
1 parent 090ad3a commit 84e3f70
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/format.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@
* Returns a function that formats a given month number (from 0 = January to 11
* = December) according to the specified *locale* and *format*.
*
* @param locale a [BCP 47 language tag][1]; defaults to U.S. English.
* @param format a [month format][2]: either *2-digit*, *numeric*, *narrow*,
* *short*, *long*; defaults to *short*.
*
* [1]: https://tools.ietf.org/html/bcp47
* [2]: https://tc39.es/ecma402/#datetimeformat-objects
*
* @param locale - a [BCP 47 language tag][1]; defaults to U.S. English.
* @param format - a [month format][2]; defaults to *short*.
*/
export function formatMonth(
locale?: string,
Expand All @@ -18,12 +17,11 @@ export function formatMonth(
* Returns a function that formats a given week day number (from 0 = Sunday to 6
* = Saturday) according to the specified *locale* and *format*.
*
* @param locale a [BCP 47 language tag][1]; defaults to U.S. English.
* @param format a [weekday format][2]: either *narrow*, *short*, or *long*;
* defaults to *short*.
*
* [1]: https://tools.ietf.org/html/bcp47
* [2]: https://tc39.es/ecma402/#datetimeformat-objects
*
* @param locale a [BCP 47 language tag][1]; defaults to U.S. English.
* @param format a [weekday format][2]; defaults to *short*.
*/
export function formatWeekday(locale?: string, format?: "long" | "short" | "narrow"): (i: number) => string;

Expand Down

0 comments on commit 84e3f70

Please sign in to comment.