Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
chibat committed Nov 25, 2023
1 parent ec35fa0 commit 8abb271
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions routes/notification.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ export default defineRoute(async (req, _ctx) => {
});
}
const notifications = await selectNotificationsWithUpdate(session.user.id);
let locale: Intl.Locale;
try {
locale = new Intl.Locale(req.headers.get("accept-language")?.split(",").at(0) ?? "en");
} catch (error) {
locale = new Intl.Locale("en");
}
// let locale: Intl.Locale;
// try {
// locale = new Intl.Locale(req.headers.get("accept-language")?.split(",").at(0) ?? "en");
// } catch (error) {
// locale = new Intl.Locale("en");
// }
return (
<>
<Head>
Expand All @@ -29,7 +29,7 @@ export default defineRoute(async (req, _ctx) => {
<h1>Notification</h1>
{notifications.map(notification =>
<div class="mb-1" key={notification.id}>
<span class="me-3">{new Date(notification.created_at).toLocaleString(locale)}</span>
<span class="me-3">{new Date(notification.created_at).toISOString()}</span>
{notification.type === "follow" && <a href={`/users/${notification.action_user_id}`}><b>{notification.action_user?.name}</b> followed you.</a>
}
{notification.type === "like" && <a href={`/posts/${notification.post_id}`}><b>{notification.action_user?.name}</b> liked your post.</a>
Expand Down

0 comments on commit 8abb271

Please sign in to comment.