Skip to content

Commit 750c94d

Browse files
committed
refactor: remove luxon dependency and update date formatting on blog posts
1 parent 0d4592e commit 750c94d

File tree

3 files changed

+2748
-5459
lines changed

3 files changed

+2748
-5459
lines changed

app/lib/blog.server.ts

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { DateTime } from "luxon";
21
import invariant from "tiny-invariant";
32
import { LRUCache } from "lru-cache";
43
import yaml from "yaml";
@@ -100,15 +99,10 @@ function getValidAuthorNames(authorNames: string[]) {
10099
}
101100

102101
function formatDate(date: Date) {
103-
let offset = new Date().getTimezoneOffset();
104-
return (
105-
DateTime.fromJSDate(date)
106-
// Necessary to set the offset for local development
107-
.plus({ minutes: offset })
108-
.toLocaleString(DateTime.DATE_FULL, {
109-
locale: "en-US",
110-
})
111-
);
102+
return new Intl.DateTimeFormat("en-US", {
103+
dateStyle: "long",
104+
timeZone: "America/New_York",
105+
}).format(date);
112106
}
113107

114108
/**

package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
"front-matter": "^4.0.2",
3939
"isbot": "^4",
4040
"lru-cache": "^10.1.0",
41-
"luxon": "^3.7.2",
4241
"parse-numeric-range": "^1.3.0",
4342
"react": "^18.3.1",
4443
"react-dom": "^18.3.1",
@@ -68,7 +67,6 @@
6867
"@testing-library/jest-dom": "^6.9.1",
6968
"@types/eslint": "^9.6.1",
7069
"@types/hast": "^3.0.4",
71-
"@types/luxon": "^3.7.1",
7270
"@types/node": "^24.10.13",
7371
"@types/react": "^18.3.28",
7472
"@types/react-dom": "^18.3.7",

0 commit comments

Comments
 (0)