removed logging in weather service.
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good

changed moment to peerdependency.
This commit is contained in:
Mark van der Wal 2020-09-03 10:37:24 +02:00
parent 76bdad6eaf
commit 1030b1c41a
3 changed files with 4 additions and 8 deletions

View File

@ -39,7 +39,8 @@
"rxjs": "^6.5.4", "rxjs": "^6.5.4",
"tassign": "^1.0.0", "tassign": "^1.0.0",
"tslib": "^1.10.0", "tslib": "^1.10.0",
"zone.js": "~0.10.2" "zone.js": "~0.10.2",
"moment": "^2.27.0"
}, },
"devDependencies": { "devDependencies": {
"@angular-devkit/build-angular": "~0.901.0", "@angular-devkit/build-angular": "~0.901.0",

View File

@ -17,9 +17,7 @@
"@aspnet/signalr": "^1.1.4", "@aspnet/signalr": "^1.1.4",
"font-awesome": "^4.7.0", "font-awesome": "^4.7.0",
"ngx-uploadx": "^3.3.4", "ngx-uploadx": "^3.3.4",
"angular-oauth2-oidc": "^9.1" "angular-oauth2-oidc": "^9.1",
},
"dependencies": {
"moment": "^2.27.0" "moment": "^2.27.0"
} }
} }

View File

@ -2,7 +2,7 @@ import {Injectable} from '@angular/core';
import {HttpClient} from '@angular/common/http'; import {HttpClient} from '@angular/common/http';
import {Observable} from 'rxjs'; import {Observable} from 'rxjs';
import {GeoJSON} from 'ol/format'; import {GeoJSON} from 'ol/format';
import {map, switchMap, tap} from 'rxjs/operators'; import {map, switchMap} from 'rxjs/operators';
import {getCenter} from 'ol/extent'; import {getCenter} from 'ol/extent';
import moment from 'moment'; import moment from 'moment';
import {AppConfig} from '../shared/app.config'; import {AppConfig} from '../shared/app.config';
@ -40,13 +40,11 @@ export class WeatherService {
startDate.setDate(startDate.getDate() - daysBefore); startDate.setDate(startDate.getDate() - daysBefore);
startDate.setHours(0, 0, 0, 0); startDate.setHours(0, 0, 0, 0);
const startDateString = moment(startDate).local().format('YYYY-MM-DD[T]HH:mm:ss'); const startDateString = moment(startDate).local().format('YYYY-MM-DD[T]HH:mm:ss');
console.log(startDateString);
const endDate = new Date(); const endDate = new Date();
endDate.setDate(endDate.getDate() + daysAfter); endDate.setDate(endDate.getDate() + daysAfter);
endDate.setHours(23, 0, 0, 0); endDate.setHours(23, 0, 0, 0);
const endDateString = moment(endDate).local().format('YYYY-MM-DD[T]HH:mm:ss'); const endDateString = moment(endDate).local().format('YYYY-MM-DD[T]HH:mm:ss');
console.log(endDateString);
return this.getWeatherRange(centroid, startDateString, endDateString); return this.getWeatherRange(centroid, startDateString, endDateString);
} }
@ -70,7 +68,6 @@ export class WeatherService {
switchMap(h => { switchMap(h => {
return this.httpClient.get<any[]>(forecast) return this.httpClient.get<any[]>(forecast)
.pipe( .pipe(
tap(v => console.log(v)),
map(f => [...h, ...f.filter(fd => fd.time <= endDate)] )); map(f => [...h, ...f.filter(fd => fd.time <= endDate)] ));
}) })
); );