Fix monthly events query

This commit is contained in:
Regalijan 2024-02-22 13:46:23 -05:00
parent 41d5935fb5
commit f2b546b60c
Signed by: regalijan
GPG Key ID: 5D4196DA269EF520

View File

@ -3,7 +3,7 @@ import { jsonError } from "../../../common.js";
export async function onRequestPost(context: RequestContext) { export async function onRequestPost(context: RequestContext) {
const { day, details, type } = context.data.body; const { day, details, type } = context.data.body;
const now = new Date(); const now = new Date();
const currentMonth = now.getUTCMonth(); const currentMonth = now.getUTCMonth() + 1;
const currentYear = now.getUTCFullYear(); const currentYear = now.getUTCFullYear();
const lastDayOfMonth = new Date(currentYear, currentMonth, 0).getUTCDate(); const lastDayOfMonth = new Date(currentYear, currentMonth, 0).getUTCDate();