Skip to content

Commit 03cb93d

Browse files
authored
Merge pull request ioet#393 from ioet/392-save-data-using-utc
fix: ioet#392 save data using utc
2 parents 8e06af0 + 6bcb666 commit 03cb93d

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/app/modules/time-clock/store/entry.actions.spec.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ describe('Actions for Entries', () => {
8888
it('LoadEntriesByTimeRange type is EntryActionTypes.LOAD_ENTRIES_BY_TIME_RANGE', () => {
8989
const yesterday = moment(new Date()).subtract(1, 'day');
9090
const today = moment(new Date());
91-
const pipe: DatePipe = new DatePipe('en');
9291
const timeRange: TimeEntriesTimeRange = {start_date: yesterday, end_date: today};
9392
const action = new actions.LoadEntriesByTimeRange(timeRange);
9493
expect(action.type).toEqual(actions.EntryActionTypes.LOAD_ENTRIES_BY_TIME_RANGE);

src/app/modules/time-entries/pages/time-entries.component.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ export class TimeEntriesComponent implements OnInit {
5757
}
5858

5959
doSave(entry) {
60+
entry.start_date = new Date(entry.start_date).toISOString();
61+
entry.end_date = new Date(entry.end_date).toISOString();
6062
if (this.entryId) {
6163
entry.id = this.entryId;
6264
this.store.dispatch(new entryActions.UpdateEntry(entry));

0 commit comments

Comments
 (0)