Skip to content

Commit

Permalink
update last_updated
Browse files Browse the repository at this point in the history
  • Loading branch information
rithviknishad committed Mar 6, 2024
1 parent 908eb63 commit e7effcc
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions scripts/migrations/002_migrate_github_activity_timestamps.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
});
Expand Down

0 comments on commit e7effcc

Please sign in to comment.