]> _ Git - fluidbook-html5.git/commitdiff
wait #5534 @0:10
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 25 Oct 2022 17:11:08 +0000 (19:11 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 25 Oct 2022 17:11:08 +0000 (19:11 +0200)
js/libs/fluidbook/cart/fluidbook.cart.puma.js

index 26216aa7d5b8b63bad5105f65f4e752fee476ba1..1f422c27df674b24d570801ebc4227d87bd42c2f 100644 (file)
@@ -236,7 +236,21 @@ FluidbookCartPuma.prototype = {
             return this.exportFileName;
         }
         var date = new Date();
-        return this.fluidbook.settings.title + ' - ' + date.getFullYear() + '-' + date.getMonth() + '-' + date.getDate();
+        return this.fluidbook.settings.title + ' - ' + this.formatDate(date);
+    },
+
+    formatDate: function (date) {
+        var d = new Date(date),
+            month = '' + (d.getMonth() + 1),
+            day = '' + d.getDate(),
+            year = d.getFullYear();
+
+        if (month.length < 2)
+            month = '0' + month;
+        if (day.length < 2)
+            day = '0' + day;
+
+        return [year, month, day].join('-');
     },
 
     exportEANXLS: function () {