From ca26abedecac72fb68139cb28c540479cbafb31a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Barth=C3=A9lemy?= <31370477+BarthPaleologue@users.noreply.github.com> Date: Sun, 3 Nov 2024 21:00:19 +0100 Subject: [PATCH] improve save file name include cmdr name and save locale time --- src/ts/cosmosJourneyer.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ts/cosmosJourneyer.ts b/src/ts/cosmosJourneyer.ts index 680787a8..392c8e3d 100644 --- a/src/ts/cosmosJourneyer.ts +++ b/src/ts/cosmosJourneyer.ts @@ -383,7 +383,8 @@ export class CosmosJourneyer { const url = URL.createObjectURL(blob); const link = document.createElement("a"); link.href = url; - link.download = "save.json"; + const dateString = new Date().toLocaleString().replace(/[^0-9a-zA-Z]/g, "_"); // avoid special characters in the filename + link.download = `CMDR_${this.player.name}_${dateString}.json`; link.click(); }