-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added TimeZone.browser() and improved coverage
- Loading branch information
1 parent
09fcd85
commit 631b014
Showing
7 changed files
with
25 additions
and
6 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
export interface TimeZone | ||
import {ZoneId} from './ZoneId'; | ||
|
||
export abstract class TimeZone | ||
{ | ||
public static browser() | ||
{ | ||
return ZoneId.browser(); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
import {TimeZone} from './TimeZone'; | ||
|
||
export class ZoneOffset implements TimeZone | ||
export class ZoneOffset extends TimeZone | ||
{ | ||
private readonly nrOfSeconds: number; | ||
|
||
constructor(nrOfSeconds: number) | ||
{ | ||
super(); | ||
this.nrOfSeconds = nrOfSeconds; | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import {assert} from "chai"; | ||
import {TimeZone, ZoneId} from "../src"; | ||
|
||
describe('TimeZone', () => { | ||
describe('.browser()', () => { | ||
it('is the same as ZoneId.browser()', () => { | ||
assert.isTrue(ZoneId.browser().equals(TimeZone.browser())) | ||
}) | ||
}); | ||
}); |