Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Azgaar committed Aug 17, 2020
2 parents f17af04 + 0cceb31 commit f7ed405
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion modules/ui/editors.js
Original file line number Diff line number Diff line change
Expand Up @@ -544,9 +544,18 @@ function unfog(id) {
}

function getFileName(dataType) {
const formatTime = (time) => {
return (time < 10) ? "0" + time : time;
};
const name = mapName.value;
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;
}

Expand Down

0 comments on commit f7ed405

Please sign in to comment.