Skip to content

Commit ec56f48

Browse files
authored
Use UTC functions on date objects (#827)
1 parent 2be07b2 commit ec56f48

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

components/menu.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ function Level1({ href, menu }) {
8383
link = (
8484
<a href={entry.href}>
8585
<b>
86-
{monthNames[date.getMonth()]} {date.getDate()}
86+
{monthNames[date.getUTCMonth()]} {date.getUTCDate()}
8787
</b>
8888
{entry.title}
8989
</a>

lib/blog.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export function getBlogPostsByYear(limit?: number) {
1616
return years;
1717
}
1818
const date = new Date(post.date);
19-
const year = date.getFullYear().toString();
19+
const year = date.getUTCFullYear().toString();
2020
if (!years[year]) {
2121
years[year] = {
2222
key: year,

0 commit comments

Comments
 (0)