Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix: TT-86 Change set hour in end_hour
  • Loading branch information
jase156 committed May 3, 2021
commit 9d7f8b3f1268a0b2dc2ba1aa2796f762b6abcfa7
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@
formControlName="end_hour"
id="end_hour"
class="timepicker-input"
[defaultTime]="'00:00'"
[class.timepicker-input--disabled]="!(project_id.value && project_name.value)"
></ngx-timepicker-field>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,9 @@ describe('DetailsFieldsComponent', () => {

component.onGoingToWorkOnThisChange({ currentTarget: { checked: false } });

expect(component.entryForm.patchValue).toHaveBeenCalledWith({ end_date: '2020-12-30', end_hour: '09:45', });
expect(component.entryForm.patchValue).toHaveBeenCalledWith(
{ end_date: '2020-12-30', end_hour: formatDate(new Date(), 'HH:mm', 'en'), }
);
});

it('when creating a new entry, then the new entry should be marked as not run', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ export class DetailsFieldsComponent implements OnChanges, OnInit {
if (!this.goingToWorkOnThis) {
this.entryForm.patchValue({
end_date: formatDate(get(this.entryToEdit, 'start_date', ''), DATE_FORMAT, 'en'),
end_hour: formatDate(get(this.entryToEdit, 'start_date', '00:00'), 'HH:mm', 'en'),
end_hour: formatDate(new Date(), 'HH:mm', 'en'),
});
}
this.shouldRestartEntry = !this.entryToEdit?.running && this.goingToWorkOnThis;
Expand Down