@@ -9,19 +9,19 @@ import {
99 ElementRef ,
1010 Renderer2 ,
1111} from '@angular/core' ;
12- import { FormBuilder , FormGroup } from '@angular/forms' ;
13- import { Store , select } from '@ngrx/store' ;
14- import { formatDate } from '@angular/common' ;
15-
16- import { Project , Activity } from '../../models' ;
17- import { ProjectState } from '../../../customer-management/components/projects/components/store/project.reducer' ;
18- import { TechnologyState } from '../../store/technology.reducers' ;
19- import { LoadActivities , ActivityState , allActivities } from '../../../activities-management/store' ;
20- import { getProjects } from '../../../customer-management/components/projects/components/store/project.selectors' ;
12+ import { FormBuilder , FormGroup } from '@angular/forms' ;
13+ import { Store , select } from '@ngrx/store' ;
14+ import { formatDate } from '@angular/common' ;
15+
16+ import { Project , Activity } from '../../models' ;
17+ import { ProjectState } from '../../../customer-management/components/projects/components/store/project.reducer' ;
18+ import { TechnologyState } from '../../store/technology.reducers' ;
19+ import { LoadActivities , ActivityState , allActivities } from '../../../activities-management/store' ;
20+ import { getProjects } from '../../../customer-management/components/projects/components/store/project.selectors' ;
2121import * as projectActions from '../../../customer-management/components/projects/components/store/project.actions' ;
22- import { EntryState } from '../../../time-clock/store/entry.reducer' ;
22+ import { EntryState } from '../../../time-clock/store/entry.reducer' ;
2323import * as entryActions from '../../../time-clock/store/entry.actions' ;
24- import { getUpdateError , getCreateError } from 'src/app/modules/time-clock/store/entry.selectors' ;
24+ import { getUpdateError , getCreateError } from 'src/app/modules/time-clock/store/entry.selectors' ;
2525type Merged = TechnologyState & ProjectState & ActivityState & EntryState ;
2626
2727@Component ( {
@@ -42,6 +42,7 @@ export class DetailsFieldsComponent implements OnChanges, OnInit {
4242 keyword = 'name' ;
4343 showlist : boolean ;
4444 errorDate : boolean ;
45+ errorEndDate : boolean ;
4546
4647 constructor ( private formBuilder : FormBuilder , private store : Store < Merged > ) {
4748 this . entryForm = this . formBuilder . group ( {
@@ -89,6 +90,7 @@ export class DetailsFieldsComponent implements OnChanges, OnInit {
8990 ngOnChanges ( ) : void {
9091 if ( this . entryToEdit ) {
9192 this . selectedTechnologies = this . entryToEdit . technologies ;
93+ this . errorEndDate = this . entryToEdit . end_date ? false : true ;
9294 this . entryForm . setValue ( {
9395 project_id : this . entryToEdit . project_id ,
9496 activity_id : this . entryToEdit . activity_id ,
@@ -156,6 +158,7 @@ export class DetailsFieldsComponent implements OnChanges, OnInit {
156158 close ( ) {
157159 this . entryForm . reset ( ) ;
158160 this . errorDate = false ;
161+ this . errorEndDate = false ;
159162 this . cleanForm ( ) ;
160163 }
161164
0 commit comments