tripGrouping 2 month

This commit is contained in:
Pringgosutono
2025-10-08 16:21:44 +07:00
parent 70c534c204
commit 6fe3050c1c

View File

@ -162,9 +162,9 @@ async function job() {
async function tripGrouping() {
console.log("Trip grouping job executed:", moment().format("YYYY-MM-DD HH:mm:ss"))
for (let i = 0; i <= 12; i++) {
const lasYearDate = moment().subtract(1, "years")
const histMonth = lasYearDate.clone().add(i, "months")
for (let i = 0; i <= 1; i++) {
const lastMonth = moment().subtract(1, "months")
const histMonth = lastMonth.clone().add(i, "months")
const histYy = histMonth.format("YY")
const histMm = histMonth.format("MM")
const histTableName = `tracks_${histYy}${histMm}`