|
@@ -4,12 +4,7 @@ import angular from 'angular';
|
|
|
import moment from 'moment';
|
|
import moment from 'moment';
|
|
|
|
|
|
|
|
export class AddAnnotationModalCtrl {
|
|
export class AddAnnotationModalCtrl {
|
|
|
- annotationTimeFormat = 'YYYY-MM-DD HH:mm:ss';
|
|
|
|
|
- annotationTimeFrom: any;
|
|
|
|
|
- annotationTimeTo: any = null;
|
|
|
|
|
- annotationTitle: string;
|
|
|
|
|
- annotationTextFrom: string;
|
|
|
|
|
- annotationTextTo: string;
|
|
|
|
|
|
|
+ timeFormat = 'YYYY-MM-DD HH:mm:ss';
|
|
|
annotation: any;
|
|
annotation: any;
|
|
|
graphCtrl: any;
|
|
graphCtrl: any;
|
|
|
|
|
|
|
@@ -29,21 +24,20 @@ export class AddAnnotationModalCtrl {
|
|
|
text: ""
|
|
text: ""
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
- this.annotation.time = moment($scope.annotationTimeRange.from).format(this.annotationTimeFormat);
|
|
|
|
|
|
|
+ this.annotation.time = moment($scope.annotationTimeRange.from).format(this.timeFormat);
|
|
|
if ($scope.annotationTimeRange.to) {
|
|
if ($scope.annotationTimeRange.to) {
|
|
|
- this.annotation.timeTo = moment($scope.annotationTimeRange.to).format(this.annotationTimeFormat);
|
|
|
|
|
|
|
+ this.annotation.timeTo = moment($scope.annotationTimeRange.to).format(this.timeFormat);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
addAnnotation() {
|
|
addAnnotation() {
|
|
|
- this.annotation.time = moment(this.annotation.time, this.annotationTimeFormat).valueOf();
|
|
|
|
|
|
|
+ this.annotation.time = moment(this.annotation.time, this.timeFormat).valueOf();
|
|
|
if (this.annotation.timeTo) {
|
|
if (this.annotation.timeTo) {
|
|
|
- this.annotation.timeTo = moment(this.annotation.timeTo, this.annotationTimeFormat).valueOf();
|
|
|
|
|
|
|
+ this.annotation.timeTo = moment(this.annotation.timeTo, this.timeFormat).valueOf();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
this.graphCtrl.pushAnnotation(this.annotation)
|
|
this.graphCtrl.pushAnnotation(this.annotation)
|
|
|
.then(response => {
|
|
.then(response => {
|
|
|
- console.log(response);
|
|
|
|
|
this.close();
|
|
this.close();
|
|
|
})
|
|
})
|
|
|
.catch(error => {
|
|
.catch(error => {
|