module JosieHealth::Utils::TimezoneCity

Defined in:

timezone_city.cr

Constant Summary

TZ_MAP_DATA = {{ read_file("/home/josie/development/personal/josiedot/health/josie-health-utils/src/../data/tz_map.json") }}

Embed timezone data at compile time

Class Method Summary

Class Method Detail

def self.data : Array(Entry) #

Load timezone data (lazy loaded from embedded data, cached)


def self.find(city : String) : String | Nil #

Find exact timezone for a city (returns first match)


def self.lookup(query : String, limit : Int32 = 5) : Array(Match) #

Find timezone matches for a query string Returns top 5 matches sorted by relevance (population + match type)


def self.reload! #

Reload data (useful for testing)