timezone-soft 1.6.0 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +27 -1
- package/builds/timezone-soft.cjs +398 -213
- package/builds/timezone-soft.js +398 -213
- package/builds/timezone-soft.min.js +2 -2
- package/package.json +12 -9
package/README.md
CHANGED
|
@@ -84,7 +84,7 @@ Abbreviations can describe several places. For example:
|
|
|
84
84
|
|
|
85
85
|
```js
|
|
86
86
|
soft('IST').map(zone => zone.iana)
|
|
87
|
-
// ['Asia/Kolkata', '
|
|
87
|
+
// ['Asia/Kolkata', 'Asia/Jerusalem', 'Europe/Dublin', 'Asia/Colombo']
|
|
88
88
|
```
|
|
89
89
|
|
|
90
90
|
Explicit IANA IDs containing `/` are resolved case-insensitively through the pinned
|
|
@@ -108,6 +108,27 @@ Show all candidates when ambiguity matters, or ask for a city or IANA ID. The
|
|
|
108
108
|
library does not use the user's location to choose a result. Regression fixtures
|
|
109
109
|
cover the ordering of `CST`, `IST`, and `BST`.
|
|
110
110
|
|
|
111
|
+
## Combined lookup strings
|
|
112
|
+
|
|
113
|
+
When the whole string does not match, commas and parentheses split it into
|
|
114
|
+
additional lookups using the existing aliases:
|
|
115
|
+
|
|
116
|
+
```js
|
|
117
|
+
soft('Springfield, Missouri')[0].iana // 'America/Chicago' (matches Missouri)
|
|
118
|
+
soft('Springfield (Missouri)')[0].iana // 'America/Chicago'
|
|
119
|
+
soft('Toronto, Ontario, Canada')[0].iana // 'America/Toronto'
|
|
120
|
+
soft('CST China')[0].iana // 'Asia/Shanghai'
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
Recognized parts are intersected, preserving the first part's result order.
|
|
124
|
+
Unknown comma-separated or parenthesized parts are ignored; conflicting known
|
|
125
|
+
parts return `[]`. Without punctuation, both sides of a word-boundary split must
|
|
126
|
+
match, so `Springfield Missouri` still returns `[]` while `CST China` resolves.
|
|
127
|
+
|
|
128
|
+
These are alias fallbacks, not geographic validation. No additional city/country
|
|
129
|
+
dataset is stored: the Springfield examples resolve through `Missouri`, not through
|
|
130
|
+
a Springfield city record. Existing whole-string matches take precedence.
|
|
131
|
+
|
|
111
132
|
## UTC and GMT offsets
|
|
112
133
|
|
|
113
134
|
`UTC` (including lowercase or surrounding whitespace) resolves only to `Etc/UTC`,
|
|
@@ -188,6 +209,11 @@ if (zone) {
|
|
|
188
209
|
|
|
189
210
|
### See also
|
|
190
211
|
|
|
212
|
+
- [city-timezones](https://github.com/kevinroberts/city-timezones) — find IANA timezones by city, state, or country.
|
|
213
|
+
- [@vvo/tzdb](https://github.com/vvo/tzdb) — timezone data with friendly names and major cities for timezone selectors.
|
|
214
|
+
- [@coroboros/location-timezone](https://github.com/elysiumphase/node-location-timezone) — timezone lookups by city, country, or capital.
|
|
215
|
+
- [chrono-node](https://github.com/wanasit/chrono) — natural-language date parsing with timezone abbreviation support.
|
|
216
|
+
- [tz-lookup](https://github.com/darkskyapp/tz-lookup-oss) — approximate timezone lookup from latitude and longitude.
|
|
191
217
|
- [TimeZoneNames](https://github.com/mattjohnsonpint/TimeZoneNames) for .NET.
|
|
192
218
|
|
|
193
219
|
MIT, PRs welcome
|