瀏覽代碼

🐛 fix calendar to ISO string conversion

jmacura 3 年之前
父節點
當前提交
a23db19150
共有 1 個文件被更改,包括 3 次插入2 次删除
  1. 3 2
      src/app/calculator/calculator.component.ts

+ 3 - 2
src/app/calculator/calculator.component.ts

@@ -91,8 +91,9 @@ export class CalculatorComponent implements HsPanelComponent, OnInit {
   }
 
   updateSelectedDate(value: NgbDateStruct) {
-    this.calcService.selectedDate =
-      value.year + '-' + value.month + '-' + value.day;
+    this.calcService.selectedDate = `${value.year}-${
+      value.month < 10 ? '0' : ''
+    }${value.month}-${value.day < 10 ? '0' : ''}${value.day}`;
   }
 
   hasDataAvailable(date: NgbDateStruct): boolean {