Kaynağa Gözat

🐛 fix calendar to ISO string conversion

jmacura 3 yıl önce
ebeveyn
işleme
a23db19150
1 değiştirilmiş dosya ile 3 ekleme ve 2 silme
  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 {