mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-17 09:41:24 +01:00
Merge branch 'master' of https://github.com/Azgaar/Fantasy-Map-Generator
This commit is contained in:
commit
f7ed40518d
1 changed files with 10 additions and 1 deletions
|
|
@ -544,9 +544,18 @@ function unfog(id) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function getFileName(dataType) {
|
function getFileName(dataType) {
|
||||||
|
const formatTime = (time) => {
|
||||||
|
return (time < 10) ? "0" + time : time;
|
||||||
|
};
|
||||||
const name = mapName.value;
|
const name = mapName.value;
|
||||||
const type = dataType ? dataType + " " : "";
|
const type = dataType ? dataType + " " : "";
|
||||||
const dateString = new Date().toISOString().replace(/:[0-9]+\..*/, "").replace(/[T:]/g, "-");
|
const date = new Date();
|
||||||
|
const year = date.getFullYear();
|
||||||
|
const month = formatTime(date.getMonth());
|
||||||
|
const day = formatTime(date.getDay());
|
||||||
|
const hour = formatTime(date.getHours());
|
||||||
|
const minutes = formatTime(date.getMinutes());
|
||||||
|
const dateString = [year, month, day, hour, minutes].join('-');
|
||||||
return name + " " + type + dateString;
|
return name + " " + type + dateString;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue