Merge pull request #504 from Phundrak/master

Change filename format of saved files
This commit is contained in:
Azgaar 2020-08-07 22:36:14 +03:00 committed by GitHub
commit a910c834f2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -546,12 +546,8 @@ function unfog(id) {
function getFileName(dataType) {
const name = mapName.value;
const type = dataType ? dataType + " " : "";
const date = new Date();
const datFormatter = new Intl.DateTimeFormat("en", {month: "short", day: "numeric"});
const timeFormatter = new Intl.DateTimeFormat("ru", {hour: "numeric", minute: "numeric"});
const day = datFormatter.format(date).replace(" ", "");
const time = timeFormatter.format(date).replace(":", "-");
return name + " " + type + day + " " + time;
const dateString = new Date().toISOString().replace(/:[0-9]+\..*/, "").replaceAll(/[T:]/g, "-");
return name + " " + type + dateString;
}
function downloadFile(data, name, type = "text/plain") {