Skip to content

Commit

Permalink
explicitly specify the timezone of the DateTimeFormat
Browse files Browse the repository at this point in the history
  • Loading branch information
yuheiy committed Mar 7, 2024
1 parent 57352fe commit cf04017
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/lib/render-date-to-html.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const locale = `${SITE_LANG}-${SITE_REGION}`;

const dateFormatter = new Intl.DateTimeFormat(locale, {
dateStyle: 'long',
timeZone: 'Asia/Tokyo',
});

export function renderDateToHtml(date: Date) {
Expand Down
1 change: 1 addition & 0 deletions src/lib/render-year-month-range-to-html.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const locale = `${SITE_LANG}-${SITE_REGION}`;
const yearMonthFormatter = new Intl.DateTimeFormat(locale, {
year: 'numeric',
month: 'long',
timeZone: 'Asia/Tokyo',
});

function renderYearMonthToHtml(yearMonth: YearMonth) {
Expand Down

0 comments on commit cf04017

Please sign in to comment.