Skip to content

Commit 65d4d82

Browse files
committed
fix: TT-205 spaces and use constants
1 parent 1bd04fa commit 65d4d82

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

src/app/modules/shared/components/details-fields/details-fields.component.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@
9393
(ngModelChange)="onStartDateChange($event)"
9494
[max]="getCurrentDate()"
9595
onkeydown="return false"
96-
(click)="datepickerStartDate.opened? datepickerStartDate.close() : datepickerStartDate.open()"
97-
(dateInput)="start_date.setValue($event.value.format('YYYY-MM-DD')) "
96+
(click)="datepickerStartDate.opened ? datepickerStartDate.close() : datepickerStartDate.open()"
97+
(dateInput)="start_date.setValue($event.value.format('YYYY-MM-DD'))"
9898
[matDatepicker]="datepickerStartDate"
9999
/>
100100
<mat-datepicker #datepickerStartDate></mat-datepicker>
@@ -126,8 +126,8 @@
126126
required
127127
[max]="getCurrentDate()"
128128
onkeydown="return false"
129-
(click)="datepickerEndDate.opened? datepickerEndDate.close() : datepickerEndDate.open()"
130-
(dateInput)="end_date.setValue($event.value.format('YYYY-MM-DD')) "
129+
(click)="datepickerEndDate.opened ? datepickerEndDate.close() : datepickerEndDate.open()"
130+
(dateInput)="end_date.setValue($event.value.format('YYYY-MM-DD'))"
131131
[matDatepicker]="datepickerEndDate"
132132
/>
133133
<mat-datepicker #datepickerEndDate></mat-datepicker>

src/app/modules/shared/components/details-fields/details-fields.component.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -489,14 +489,14 @@ describe('DetailsFieldsComponent', () => {
489489
});
490490

491491
it('on get current date should return expected date', () => {
492-
const expectedDate = moment(new Date()).format('YYYY-MM-DD');
492+
const expectedDate = moment(new Date()).format(DATE_FORMAT_YEAR);
493493

494494
expect(component.getCurrentDate()).toEqual(expectedDate);
495495
});
496496

497497
it('on the input with id #start_date we could get the id and max value', () => {
498498
fixture.detectChanges();
499-
const expectedDate = moment(new Date()).format('YYYY-MM-DD');
499+
const expectedDate = moment(new Date()).format(DATE_FORMAT_YEAR);
500500
const startDateInput: HTMLInputElement = fixture.debugElement.
501501
nativeElement.querySelector(`input[id="start_date"],input[max="${component.getCurrentDate()}"]`);
502502

@@ -506,7 +506,7 @@ describe('DetailsFieldsComponent', () => {
506506

507507
it('on the input with id #end_date we could get the current Date ', () => {
508508
fixture.detectChanges();
509-
const expectedDate = moment(new Date()).format('YYYY-MM-DD');
509+
const expectedDate = moment(new Date()).format(DATE_FORMAT_YEAR);
510510
const endDateInput = fixture.debugElement.nativeElement.querySelector('[id=end_date]');
511511

512512
expect(endDateInput.id).toEqual('end_date');

src/app/modules/shared/components/details-fields/details-fields.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import { EntryActionTypes } from './../../../time-clock/store/entry.actions';
1818
import { SaveEntryEvent } from './save-entry-event';
1919
import { ProjectSelectedEvent } from './project-selected-event';
2020
import { get } from 'lodash';
21-
import { DATE_FORMAT } from 'src/environments/environment';
21+
import { DATE_FORMAT, DATE_FORMAT_YEAR } from 'src/environments/environment';
2222
import { TechnologiesComponent } from '../technologies/technologies.component';
2323

2424
type Merged = TechnologyState & ProjectState & ActivityState & EntryState;
@@ -192,7 +192,7 @@ export class DetailsFieldsComponent implements OnChanges, OnInit {
192192
}
193193

194194
getCurrentDate(): string {
195-
return moment(new Date()).format('YYYY-MM-DD');
195+
return moment(new Date()).format(DATE_FORMAT_YEAR);
196196
}
197197

198198
get project_id() {

0 commit comments

Comments
 (0)