diff --git a/src/app/modules/time-clock/components/entry-fields/entry-fields.component.ts b/src/app/modules/time-clock/components/entry-fields/entry-fields.component.ts index a8a762ffc..b799c4b6b 100644 --- a/src/app/modules/time-clock/components/entry-fields/entry-fields.component.ts +++ b/src/app/modules/time-clock/components/entry-fields/entry-fields.component.ts @@ -32,6 +32,8 @@ export class EntryFieldsComponent implements OnInit { newData; lastEntry; showTimeInbuttons = false; + month = new Date().getMonth(); + year = new Date().getFullYear(); constructor( private formBuilder: FormBuilder, @@ -50,7 +52,7 @@ export class EntryFieldsComponent implements OnInit { ngOnInit(): void { this.store.dispatch(new LoadActivities()); - this.store.dispatch(new entryActions.LoadEntries(12, 2020)); + this.store.dispatch(new entryActions.LoadEntries(this.month, this.year)); this.actionsSubject$ .pipe(filter((action: any) => action.type === ActivityManagementActionTypes.LOAD_ACTIVITIES_SUCCESS)) .subscribe((action) => { diff --git a/src/app/modules/time-clock/store/entry.effects.ts b/src/app/modules/time-clock/store/entry.effects.ts index ed98a5549..ea5973c4e 100644 --- a/src/app/modules/time-clock/store/entry.effects.ts +++ b/src/app/modules/time-clock/store/entry.effects.ts @@ -228,7 +228,7 @@ export class EntryEffects { ofType(actions.EntryActionTypes.UPDATE_CURRENT_OR_LAST_ENTRY), map((action: actions.UpdateCurrentOrLastEntry) => action.payload), switchMap((entry) => - this.entryService.loadEntries(new Date().getMonth() + 1).pipe( + this.entryService.loadEntries(new Date().getMonth() + 1, new Date().getFullYear()).pipe( map((entries) => { const lastEntry = entries[1]; const isStartTimeInLastEntry = moment(entry.start_date).isBefore(lastEntry.end_date);