Skip to content

Commit

Permalink
wip timezone
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexandros Coutsicos (Server) committed Feb 3, 2025
1 parent a257e39 commit cc08adc
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions next/app/(main)/beitrag/[date]/[postslug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,12 @@ async function getPost(params) {
const { isEnabled } = draftMode();

try {
const date = moment(params.date, "DD-MM-YYYY").format();
const date = moment.utc(params.date, "DD-MM-YYYY").subtract(2, "h"); // subtract two hours because of the timediff to Switzerland
const slug = params.postslug;
const nextDayDate = moment(params.date, "DD-MM-YYYY").add(1, "d").format();
const nextDayDate = moment
.utc(params.date, "DD-MM-YYYY")
.add(1, "d")
.subtract(2, "h");
console.info("Rerender Post: " + slug);
const itemResponse = await Api.readItemsPost(
{
Expand Down

0 comments on commit cc08adc

Please sign in to comment.