metaforecast/src/backend/flow/history/old/updateHistory.js
Vyacheslav Matyukhin 244f02b3af
refactor: monorepo
2022-03-22 03:30:25 +03:00

22 lines
640 B
JavaScript

import { addToHistory } from "./addToHistory.js";
import { createHistoryForMonth } from "./createHistoryForMonth.js";
export async function updateHistoryOld() {
let currentDate = new Date();
let dayOfMonth = currentDate.getDate();
if (dayOfMonth == 1) {
console.log(
`Creating history for the month ${currentDate.toISOString().slice(0, 7)}`
);
await createHistoryForMonth();
} else {
console.log(`Updating history for ${currentDate.toISOString()}`);
await addToHistory();
}
}
export async function updateHistory() {
let currentDate = new Date();
let year = currentDate.toISOString().slice(0, 4);
}