From cf3707150d59068abb5ee4f32ea1c85d51389d8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E1=84=8B=E1=85=A2=E1=84=91=E1=85=B3=E1=86=AF=20=E1=84=82?= =?UTF-8?q?=E1=85=A9=E1=84=90=E1=85=B3=E1=84=87=E1=85=AE=E1=86=A8?= Date: Mon, 16 Sep 2019 10:07:10 +0900 Subject: [PATCH] Fix: maestro record page bug - IE doesn't support padStart method --- src/web/module/maestro_section_record.html | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/web/module/maestro_section_record.html b/src/web/module/maestro_section_record.html index 1253519..4d912e3 100644 --- a/src/web/module/maestro_section_record.html +++ b/src/web/module/maestro_section_record.html @@ -61,8 +61,14 @@ function setDatePickersForYears(years) { function updateDatePickerIn(inputID, date) { var yyyy = date.getFullYear(); - var mm = String(date.getMonth() + 1).padStart(2, '0'); //January is 0! - var dd = String(date.getDate()).padStart(2, '0'); + var mm = String(date.getMonth() + 1); //January is 0! + if(mm.length === 1) { + mm = "0" + mm; + } + var dd = String(date.getDate()); + if(dd.length === 1) { + dd = "0" + dd; + } $(inputID).datepicker('update', yyyy + "-" + mm + "-" + dd); }