-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #581 from liimaorg/timepicker_fixup
Timepicker fixup
- Loading branch information
Showing
11 changed files
with
109 additions
and
157 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
/dist | ||
/tmp | ||
/out-tsc | ||
debug.log | ||
# Only exists if Bazel was run | ||
/bazel-out | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
AMW_angular/io/src/app/shared/date-time-picker/dae-time.model.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { TestBed } from '@angular/core/testing'; | ||
import * as moment from 'moment'; | ||
import { DateTimePickerComponent } from './date-time-picker.component'; | ||
import { DateTimeModel } from "./date-time.model"; | ||
|
||
describe('DateTimeModel', () => { | ||
it('should convert dates correctly', () => { | ||
var fixture = TestBed.createComponent(DateTimePickerComponent); | ||
var component = fixture.componentInstance; | ||
var testDate = '02.01.2017 12:00'; | ||
|
||
var m = moment(testDate, component.dateStringFormat); | ||
var dateTimeFromString = DateTimeModel.fromLocalString(testDate, component.dateStringFormat); | ||
var dateTimeFromEpoch = DateTimeModel.fromEpoch(m.valueOf()); | ||
|
||
expect(dateTimeFromString.day).toEqual(m.date()); | ||
expect(dateTimeFromString.month).toEqual(m.month() + 1); | ||
|
||
expect(dateTimeFromString).toEqual(dateTimeFromEpoch); | ||
|
||
expect(dateTimeFromString.toEpoch()).toEqual(m.valueOf()); | ||
}); | ||
}); |
11 changes: 9 additions & 2 deletions
11
AMW_angular/io/src/app/shared/date-time-picker/date-time-picker.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.