-
Notifications
You must be signed in to change notification settings - Fork 1
change default sorting in date range selection from monday to sunday #880
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
c6ea937
fafe5bc
b6e1c25
ea8f152
d399fab
0950e04
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,8 @@ import * as entryActions from '../../../time-clock/store/entry.actions'; | |
import {Store} from '@ngrx/store'; | ||
import {EntryState} from '../../../time-clock/store/entry.reducer'; | ||
import * as moment from 'moment'; | ||
import { DateAdapter } from '@angular/material/core'; | ||
|
||
|
||
|
||
@Component({ | ||
|
@@ -21,11 +23,13 @@ export class TimeRangeFormComponent implements OnInit, OnChanges { | |
private startDate = new FormControl(''); | ||
private endDate = new FormControl(''); | ||
|
||
constructor(private store: Store<EntryState>, private toastrService: ToastrService) { | ||
constructor(private store: Store<EntryState>, private toastrService: ToastrService, private date: DateAdapter<Date>) { | ||
this.reportForm = new FormGroup({ | ||
startDate: this.startDate, | ||
endDate: this.endDate | ||
}); | ||
date.getFirstDayOfWeek = () => 1; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. needs a test |
||
|
||
} | ||
ngOnInit(): void { | ||
this.setInitialDataOnScreen(); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,12 +8,16 @@ import { InputDateComponent } from '../../../shared/components/input-date/input- | |
import * as entryActions from '../../../time-clock/store/entry.actions'; | ||
import * as moment from 'moment'; | ||
import { SimpleChange } from '@angular/core'; | ||
import { DateAdapter } from '@angular/material/core'; | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove line break |
||
|
||
describe('Reports Page', () => { | ||
describe('TimeRangeFormComponent', () => { | ||
let component: TimeRangeFormComponent; | ||
let fixture: ComponentFixture<TimeRangeFormComponent>; | ||
let store: MockStore<EntryState>; | ||
let date: DateAdapter<Date>; | ||
|
||
const toastrServiceStub = { | ||
error: (message?: string, title?: string, override?: Partial<IndividualConfig>) => { } | ||
}; | ||
|
@@ -46,10 +50,12 @@ describe('Reports Page', () => { | |
declarations: [TimeRangeFormComponent, InputDateComponent], | ||
providers: [ | ||
provideMockStore({ initialState: state }), | ||
{ provide: ToastrService, useValue: toastrServiceStub } | ||
{ provide: ToastrService, useValue: toastrServiceStub }, | ||
{ provide: DateAdapter, useClass: DateAdapter } | ||
], | ||
}).compileComponents(); | ||
store = TestBed.inject(MockStore); | ||
date = TestBed.inject(DateAdapter); | ||
|
||
})); | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
|
||
export const environment = { | ||
production: false, | ||
timeTrackerApiUrl: 'http://localhost:7071/api', | ||
timeTrackerApiUrl: 'https://0390-2800-4f0-546-4680-b5ef-416e-decc-9774.ngrok.io/api', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. shouldn't this be localhost again? |
||
stackexchangeApiUrl: 'https://api.stackexchange.com', | ||
}; | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove line break |
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove line break