소스 검색

🐛 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 {