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
|
// Daily Report
|
||||||
cron.schedule('5 1 * * *', () => {
|
cron.schedule('5 1 * 5,6,7,8,9 *', () => {
|
||||||
const today = new Date();
|
const today = new Date();
|
||||||
const yesterday = new Date(today);
|
const yesterday = new Date(today);
|
||||||
yesterday.setUTCDate(today.getUTCDate() - 1);
|
yesterday.setUTCDate(today.getUTCDate() - 1);
|
||||||
@@ -61,7 +61,7 @@ cron.schedule('5 1 * * *', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Weekly Report
|
// Weekly Report
|
||||||
cron.schedule('10 1 * * 1', () => {
|
cron.schedule('10 1 * 5,6,7,8,9 1', () => {
|
||||||
const today = new Date();
|
const today = new Date();
|
||||||
const end = new Date(today);
|
const end = new Date(today);
|
||||||
end.setUTCDate(today.getUTCDate() - 1);
|
end.setUTCDate(today.getUTCDate() - 1);
|
||||||
@@ -71,7 +71,7 @@ cron.schedule('10 1 * * 1', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
// Monthly Report
|
// Monthly Report
|
||||||
cron.schedule('15 1 1 * *', () => {
|
cron.schedule('15 1 1 5,6,7,8,9 *', () => {
|
||||||
const today = new Date();
|
const today = new Date();
|
||||||
const end = new Date(Date.UTC(today.getUTCFullYear(), today.getUTCMonth(), 0)); // Last day of previous month
|
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
|
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 { generateHTMLReport } from "./reportHtml.js";
|
||||||
import { writeFile } from "fs/promises";
|
|
||||||
import { fetchReportsInRange } from "../models/report.js";
|
import { fetchReportsInRange } from "../models/report.js";
|
||||||
|
|
||||||
export interface BaseReport {
|
export interface BaseReport {
|
||||||
|
|||||||
Reference in New Issue
Block a user