fix(notdienst): resolve timezone offset mismatch in plan generation and fix linter warning in calendar modal
This commit is contained in:
@@ -47,8 +47,8 @@ export async function generatePlanAction(year?: number, month?: number) {
|
||||
where: {
|
||||
kitaId,
|
||||
date: {
|
||||
gte: new Date(targetYear, targetMonth - 1, 1),
|
||||
lt: new Date(targetYear, targetMonth, 1),
|
||||
gte: new Date(Date.UTC(targetYear, targetMonth - 1, 1)),
|
||||
lt: new Date(Date.UTC(targetYear, targetMonth, 1)),
|
||||
},
|
||||
},
|
||||
include: { child: { select: { familyId: true } } },
|
||||
@@ -155,7 +155,8 @@ export async function updateAssignmentAction(
|
||||
const session = await requireRole([UserRole.ADMIN, UserRole.KOORDINATOR]);
|
||||
const kitaId = session.user.kitaId!;
|
||||
|
||||
const parsedDate = new Date(date);
|
||||
const [yr, mo, dy] = date.slice(0, 10).split("-").map(Number);
|
||||
const parsedDate = new Date(Date.UTC(yr, mo - 1, dy));
|
||||
|
||||
try {
|
||||
await prisma.$transaction(async (tx) => {
|
||||
|
||||
Reference in New Issue
Block a user