iana-tz-json-generator-and-importer
Version:
Quickly get timezone names and metadata from the IANA into your application in the format you want.
8 lines (7 loc) • 361 B
text/typescript
export function extractGeographicAreaAndLocation(input: string): {geographicArea: string, location: string} {
const firstSlash = input.indexOf('/');
const geographicArea = input.slice(0, firstSlash);
// + 1 (don't actually copy the first slash)
const location = input.slice(firstSlash + 1, input.length);
return {geographicArea, location}
}