|
|
@@ -35,6 +35,7 @@ export class UnitComponent implements OnInit, OnDestroy {
|
|
|
sensorTypes: SensorType[];
|
|
|
unitDescription: string;
|
|
|
subscription: Subscription[] = [];
|
|
|
+ showIntervalError: boolean = false;
|
|
|
|
|
|
constructor(
|
|
|
private activatedRoute: ActivatedRoute,
|
|
|
@@ -93,7 +94,14 @@ export class UnitComponent implements OnInit, OnDestroy {
|
|
|
* Shows get data button
|
|
|
*/
|
|
|
onDateChanged() {
|
|
|
- this.dateChanged = true;
|
|
|
+ if (moment(this.to).diff(moment(this.from), 'months') > 6){
|
|
|
+ this.dateChanged = false;
|
|
|
+ this.showIntervalError = true;
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ this.dateChanged = true;
|
|
|
+ this.showIntervalError = false;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|