no longer show empty duration values

pull/4493/head
Jens Ulferts 9 years ago
parent f9573910de
commit b62262d8e8
  1. 18
      frontend/app/components/wp-display/field-types/wp-display-duration-field.module.ts

@ -30,11 +30,25 @@ import {DisplayField} from "../wp-display-field/wp-display-field.module";
export class DurationDisplayField extends DisplayField {
private WorkPackagesHelper:any;
private TimezoneService:any;
isManualRenderer = true;
constructor(public resource:HalResource,
public name:string,
public schema) {
super(resource, name, schema);
this.WorkPackagesHelper = this.$injector.get('WorkPackagesHelper');
this.TimezoneService = this.$injector.get('TimezoneService');
}
public get valueString() {
const WorkPackagesHelper:any = this.$injector.get('WorkPackagesHelper');
return this.WorkPackagesHelper.formatValue(this.value, 'Duration');
}
return WorkPackagesHelper.formatValue(this.value, 'Duration');
public isEmpty():boolean {
return this.TimezoneService.toHours(this.value) === 0;
}
}

Loading…
Cancel
Save