diff --git a/frontend/app/components/wp-display/field-types/wp-display-duration-field.module.ts b/frontend/app/components/wp-display/field-types/wp-display-duration-field.module.ts index a42cc7ce6f..3995a4f67f 100644 --- a/frontend/app/components/wp-display/field-types/wp-display-duration-field.module.ts +++ b/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; } }