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", });