Remove email reporting except between May - September
This commit is contained in:
@@ -53,7 +53,7 @@ export async function sendReportEmail(start, end, subject = "TrACreport Summary"
|
||||
}
|
||||
|
||||
// Daily Report
|
||||
cron.schedule('5 1 * * *', () => {
|
||||
cron.schedule('5 1 * 5,6,7,8,9 *', () => {
|
||||
const today = new Date();
|
||||
const yesterday = new Date(today);
|
||||
yesterday.setUTCDate(today.getUTCDate() - 1);
|
||||
@@ -61,7 +61,7 @@ cron.schedule('5 1 * * *', () => {
|
||||
});
|
||||
|
||||
// Weekly Report
|
||||
cron.schedule('10 1 * * 1', () => {
|
||||
cron.schedule('10 1 * 5,6,7,8,9 1', () => {
|
||||
const today = new Date();
|
||||
const end = new Date(today);
|
||||
end.setUTCDate(today.getUTCDate() - 1);
|
||||
@@ -71,7 +71,7 @@ cron.schedule('10 1 * * 1', () => {
|
||||
})
|
||||
|
||||
// Monthly Report
|
||||
cron.schedule('15 1 1 * *', () => {
|
||||
cron.schedule('15 1 1 5,6,7,8,9 *', () => {
|
||||
const today = new Date();
|
||||
const end = new Date(Date.UTC(today.getUTCFullYear(), today.getUTCMonth(), 0)); // Last day of previous month
|
||||
const start = new Date(Date.UTC(end.getUTCFullYear(), end.getUTCMonth(), 1)); // First day of previous month
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { generateHTMLReport } from "./reportHtml.js";
|
||||
import { writeFile } from "fs/promises";
|
||||
import { fetchReportsInRange } from "../models/report.js";
|
||||
|
||||
export interface BaseReport {
|
||||
|
||||
Reference in New Issue
Block a user