Skip to content

Commit

Permalink
fix(apps/frontend-*): ensure that local time is used in frontend and …
Browse files Browse the repository at this point in the history
…push notifications
  • Loading branch information
sjschlapbach committed Sep 20, 2023
1 parent afa6314 commit 4730d03
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -195,13 +195,13 @@ function MicroSessionWizard({
startDate: initialValues?.scheduledStartAt
? dayjs(initialValues?.scheduledStartAt)
.local()
.format('YYYY-MM-DDThh:mm')
: dayjs().local().format('YYYY-MM-DDThh:mm'),
.format('YYYY-MM-DDTHH:mm')
: dayjs().local().format('YYYY-MM-DDTHH:mm'),
endDate: initialValues?.scheduledEndAt
? dayjs(initialValues?.scheduledEndAt)
.local()
.format('YYYY-MM-DDThh:mm')
: dayjs().add(1, 'days').format('YYYY-MM-DDThh:mm'),
.format('YYYY-MM-DDTHH:mm')
: dayjs().add(1, 'days').format('YYYY-MM-DDTHH:mm'),
multiplier: initialValues?.pointsMultiplier
? String(initialValues?.pointsMultiplier)
: '1',
Expand Down
4 changes: 2 additions & 2 deletions apps/frontend-pwa/src/components/CourseElement.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@ function CourseElement({
<div className="text-xs">
{isFuture &&
t('shared.generic.startAt', {
time: dayjs(course.startDate).utc().format('DD.MM.YYYY'),
time: dayjs(course.startDate).local().format('DD.MM.YYYY'),
})}
{isPast &&
t('shared.generic.finishedAt', {
time: dayjs(course.endDate).utc().format('DD.MM.YYYY'),
time: dayjs(course.endDate).local().format('DD.MM.YYYY'),
})}
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion packages/graphql/src/lib/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export function checkCronToken(ctx: Context) {
}

export function formatDate(dateTime: Date) {
let date = dayjs(dateTime).utc()
let date = dayjs(dateTime).local()

return {
date: `${date.format('DD')}.${date.format('MM')}.${date.format('YYYY')}`,
Expand Down

0 comments on commit 4730d03

Please sign in to comment.