Skip to content

Commit

Permalink
minor
Browse files Browse the repository at this point in the history
  • Loading branch information
nitedani committed Jan 27, 2024
1 parent ad9cf9c commit 719ea00
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 7 deletions.
3 changes: 1 addition & 2 deletions examples/basic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
"typescript": "^5.3.3",
"vike": "^0.4.160",
"vike-react": "^0.4.4",
"vite": "^5.0.12",
"devalue": "^4.3.2"
"vite": "^5.0.12"
},
"type": "module"
}
3 changes: 1 addition & 2 deletions examples/basic/pages/index/+Page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
export default Page

import React, { useId } from 'react'
import { uneval } from 'devalue'
const date = new Date('2024-01-01 00:00+07:00')

function Page() {
Expand Down Expand Up @@ -46,7 +45,7 @@ const DateTime = ({ date, format }: { date: Date; format: (date: Date) => string
__html: import.meta.env.SSR
? `
{
const allFormattedDates = ${uneval(allFormattedDates)};
const allFormattedDates = JSON.parse('${JSON.stringify(allFormattedDates)}');
const localOffsetHours = -(new Date().getTimezoneOffset() / 60).toFixed(1);
const localFormattedDate = allFormattedDates[localOffsetHours];
window['localFormattedDate${key}'] = localFormattedDate;
Expand Down
3 changes: 0 additions & 3 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 719ea00

Please sign in to comment.