From: Vincent Vanwaelscappel Date: Tue, 25 Oct 2022 17:11:08 +0000 (+0200) Subject: wait #5534 @0:10 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=7ff68ccb64a8f29aa042aa07a0a658fc8fb915e2;p=fluidbook-html5.git wait #5534 @0:10 --- diff --git a/js/libs/fluidbook/cart/fluidbook.cart.puma.js b/js/libs/fluidbook/cart/fluidbook.cart.puma.js index 26216aa7..1f422c27 100644 --- a/js/libs/fluidbook/cart/fluidbook.cart.puma.js +++ b/js/libs/fluidbook/cart/fluidbook.cart.puma.js @@ -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 () {