mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-17 01:41:22 +01:00
Merge pull request #504 from Phundrak/master
Change filename format of saved files
This commit is contained in:
commit
a910c834f2
1 changed files with 3 additions and 7 deletions
|
|
@ -546,12 +546,8 @@ function unfog(id) {
|
||||||
function getFileName(dataType) {
|
function getFileName(dataType) {
|
||||||
const name = mapName.value;
|
const name = mapName.value;
|
||||||
const type = dataType ? dataType + " " : "";
|
const type = dataType ? dataType + " " : "";
|
||||||
const date = new Date();
|
const dateString = new Date().toISOString().replace(/:[0-9]+\..*/, "").replaceAll(/[T:]/g, "-");
|
||||||
const datFormatter = new Intl.DateTimeFormat("en", {month: "short", day: "numeric"});
|
return name + " " + type + dateString;
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function downloadFile(data, name, type = "text/plain") {
|
function downloadFile(data, name, type = "text/plain") {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue