-
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.
feat(extract-tz-data): move locationDisplayName into extract-tz-data …
…as it's generically useful
- Loading branch information
1 parent
601e704
commit 8356c4d
Showing
9 changed files
with
80 additions
and
66 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import {formatLocation} from './format-location'; | ||
|
||
describe('formatLocation', () => { | ||
it('should turn a location string into a location object', () => { | ||
expect(formatLocation('Sydney')) | ||
.toEqual('Sydney'); | ||
|
||
expect(formatLocation('Argentina/Tucuman')) | ||
.toEqual('Argentina - Tucuman'); | ||
|
||
expect(formatLocation('Cape_Verde')) | ||
.toEqual('Cape Verde'); | ||
}) | ||
}); |
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,6 @@ | ||
export function formatLocation(location: string): string { | ||
const displayName = location | ||
.replace('/', ' - ') | ||
.replace('_', ' '); | ||
return displayName | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
export interface GeographicAreaMap { | ||
[geographicArea: string]: { | ||
geographicAreaDisplayName: string, | ||
geographicArea: string; | ||
locationList: LocationListValue[] | ||
} | ||
} | ||
|
||
export interface LocationListValue { | ||
location: string, | ||
locationDisplayName: string | ||
} | ||
|
||
export interface GeographicAreaListValue { | ||
geographicArea: string, | ||
geographicAreaDisplayName: string | ||
} |