Ver código fonte

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

Vousk-prod 10 anos atrás
pai
commit
dee90c0c7d
1 arquivos alterados com 2 adições e 2 exclusões
  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");
                 var a = window.document.createElement("a");
                 a.href = base64Image;
                 a.href = base64Image;
                 var date = new Date();
                 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);
                 window.document.body.appendChild(a);