From e7effcc8cfca2ad552a55c9f21ce51cb888f6755 Mon Sep 17 00:00:00 2001 From: rithviknishad Date: Wed, 6 Mar 2024 15:42:36 +0530 Subject: [PATCH] update last_updated --- scripts/migrations/002_migrate_github_activity_timestamps.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/migrations/002_migrate_github_activity_timestamps.js b/scripts/migrations/002_migrate_github_activity_timestamps.js index f65ff191..1f277706 100644 --- a/scripts/migrations/002_migrate_github_activity_timestamps.js +++ b/scripts/migrations/002_migrate_github_activity_timestamps.js @@ -16,12 +16,15 @@ async function main() { files.map(async (file) => { const filePath = path.join(githubDataPath, file); const data = JSON.parse(await readFile(filePath)); + + data.last_updated = new Date(data.last_updated * 1000).toISOString(); data.activity = data.activity.map((entry) => { return { ...entry, time: new Date(entry.time * 1000).toISOString(), }; }); + await writeFile(filePath, JSON.stringify(data, undefined, " "), { encoding: "utf-8", });