Skip to content

Commit

Permalink
intl datetime options
Browse files Browse the repository at this point in the history
  • Loading branch information
codemist committed Jul 26, 2024
1 parent 44890d4 commit 64ffb91
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/utils/formatDate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,11 @@
// TODO: Add unit test when changing this code:
/* c8 ignore next 8 */

type DateTimeFormatOptions = {
year: "numeric";
month: "long";
day: "numeric";
};

function formatDate(date: string, locales: string): string {
const jsDate = new Date(date);
/** @type {{ year: 'numeric', month: 'long', day: 'numeric' }} */

const options: DateTimeFormatOptions = {
const options: Intl.DateTimeFormatOptions = {
year: "numeric",
month: "long",
day: "numeric",
Expand Down

0 comments on commit 64ffb91

Please sign in to comment.