Explorar o código

on many systems, we can't have / in filenames, and better to have minutes from 0 to 9 with 2 digits

Vousk-prod %!s(int64=10) %!d(string=hai) anos
pai
achega
dee90c0c7d
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      src/Tools/babylon.tools.ts

+ 2 - 2
src/Tools/babylon.tools.ts

@@ -505,8 +505,8 @@
                 var a = window.document.createElement("a");
                 a.href = base64Image;
                 var date = new Date();
-                var stringDate = date.getFullYear() + "/" + date.getMonth() + "/" + date.getDate() + "-" + date.getHours() + ":" + date.getMinutes();
-                a.setAttribute("download", "screenshot-" + stringDate + ".png");
+                var stringDate = date.getFullYear() + "-" + date.getMonth() + "-" + date.getDate() + "_" + date.getHours() + "-" + ('0'+date.getMinutes()).slice(-2);
+                a.setAttribute("download", "screenshot_" + stringDate + ".png");
 
                 window.document.body.appendChild(a);