|
|
@@ -33,6 +33,7 @@ export class IrrigationForecastPanelComponent
|
|
|
{
|
|
|
forecastLoaded = false;
|
|
|
data: {
|
|
|
+ days;
|
|
|
forecast: ForecastFlatModel;
|
|
|
};
|
|
|
name: 'forecast';
|
|
|
@@ -58,7 +59,18 @@ export class IrrigationForecastPanelComponent
|
|
|
.subscribe((data: ForecastModel) => {
|
|
|
console.log('forecast', data);
|
|
|
this.data.forecast = Object.values(data);
|
|
|
+ this.data.days = this.generateDays();
|
|
|
this.forecastLoaded = true;
|
|
|
});
|
|
|
}
|
|
|
+
|
|
|
+ generateDays() {
|
|
|
+ const now = new Date();
|
|
|
+ const days = [];
|
|
|
+ for (let i = 0; i <= 7; i++) {
|
|
|
+ days.push(now.toISOString());
|
|
|
+ now.setTime(now.getTime() + 24 * 60 * 60 * 1000);
|
|
|
+ }
|
|
|
+ return days;
|
|
|
+ }
|
|
|
}
|