Canadian City Timezones
Searchable timezones for all Canadian cities, towns, townships, villages, hamlets, and municipalities.
Usage
npm install canadian-city-timezones
; ;result.city // Lethbridgeresult.province // Albertaresult.timezone // America/Edmonton
API
Methods
findpredicate:boolean: Promise<TimezoneResult | null>
Returns the first matching result for the given predicate.
filterpredicate:boolean: AsyncGenerator<TimezoneResult>
Yields all matching results for the given predicate.
values: AsyncGenerator<TimezoneResult>
Yields all values.
Interfaces
TimezoneResult
{
city: string;
province: string;
timezone: string;
}
Development
Timezones are generated automatically by pulling the list of areas from gc.ca
and feeding them into mapbox.com
to get their coordinates, then getting the timezone using geo-tz
.