schedule is for monthinfo periods

This commit is contained in:
Dobromir Popov
2024-04-20 12:09:30 +03:00
parent 2c062be8a1
commit b535d0853a
6 changed files with 24 additions and 11 deletions

View File

@ -337,7 +337,7 @@ export default async function handler(req, res) {
let updated = await prisma.shift.updateMany({
where: {
startTime: {
gte: new Date(monthInfo.firstMonday.getFullYear(), monthInfo.firstMonday.getMonth(), 1),
gte: new Date(monthInfo.firstMonday.getFullYear(), monthInfo.firstMonday.getMonth(), monthInfo.firstMonday.getDate()),
lt: new Date(monthInfo.lastSunday.getFullYear(), monthInfo.lastSunday.getMonth() + 1, 1),
}
},