Skip to content

Commit

Permalink
Added timezones.
Browse files Browse the repository at this point in the history
  • Loading branch information
juanparati committed Apr 8, 2024
1 parent 49abc59 commit d43e8b5
Showing 1 changed file with 43 additions and 15 deletions.
58 changes: 43 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ This library provides the following ISOs and codes:
- [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) (Currency codes)
- [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) (Language codes)
- [International dialing codes](https://en.wikipedia.org/wiki/List_of_country_calling_codes)
- [Olson Timezones](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones)
- [Unicode flags](https://en.wikipedia.org/wiki/Regional_indicator_symbol)
- [European Union Members](https://european-union.europa.eu/principles-countries-history/country-profiles_en)

Expand Down Expand Up @@ -64,24 +65,32 @@ It returns something like this:
[
...
"AL"=> [
"alpha2" => "AL",
"alpha3" => "ALB",
"numeric" => "008",
"tld" => ".al",
"alpha2" => "ES",
"alpha3" => "ESP",
"numeric" => "724",
"tld" => ".es",
"currencies" => [
'ALL'
"EUR",
],
"languages" => [
"SQ",
"languages" => [
"ES",
"CA",
"GL",
"EU",
],
"continents" => [
"EU",
"EU",
],
"name" => "Albania",
"capital" => "Tirana",
"flag" => "🇦🇱",
"phone_code" => "355",
"eu_member" => false
"capital" => "Madrid",
"flag" => "🇪🇸",
"phone_code" => "34",
"eu_member" => true,
"name" => "Spain",
"timezones" => [
"Europe/Madrid",
"Africa/Ceuta",
"Atlantic/Canary",
]
]
...
];
Expand Down Expand Up @@ -218,6 +227,9 @@ It returns something like:
"languages" => [ …1],
"continents" => [ …1],
"name" => "Andorra",
"timezones" => [
"Europe/Andorra"
]
],
...
],
Expand Down Expand Up @@ -342,7 +354,12 @@ returns the following:
"capital" => "Lisboa",
"flag" => "🇵🇹",
"phone_code" => "351",
"eu_member" => true
"eu_member" => true,
"timezones" => [
"Europe/Lisbon",
"Atlantic/Azores",
"Atlantic/Madeira",
],
]

instead of:
Expand All @@ -365,7 +382,12 @@ instead of:
"capital" => "Lisboa",
"flag" => "🇵🇹",
"phone_code" => "351",
"eu_member" => true
"eu_member" => true,
"timezones" => [
"Europe/Lisbon",
"Atlantic/Azores",
"Atlantic/Madeira",
],
]

The node resolutions works with the others models like "currencies", "languages", etc.
Expand Down Expand Up @@ -396,6 +418,12 @@ $iso = new ISOCodes(new ISOCodes(defaultResolutions: [
]);
```

## Main language and timezone

- The more spoken language is displayed first in the list.
- The country capital timezone is displayed first in the list.


## Custom dataset and locales

It's possible to register custom datasets and locales during the ISOCodes instantiation.
Expand Down

0 comments on commit d43e8b5

Please sign in to comment.