Skip to content

Commit 341e86a

Browse files
update hashes
1 parent ccf7386 commit 341e86a

File tree

1 file changed

+33
-4
lines changed

1 file changed

+33
-4
lines changed

tests/resolvedoptions.html

+33-4
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@
109109
let constructor
110110
if ('collator' == k) {constructor = Intl.Collator(code).resolvedOptions()
111111
} else if ('datetimeformat' == k) {constructor = Intl.DateTimeFormat(code).resolvedOptions()
112+
} else if ('durationformat' == k) {constructor = new Intl.DurationFormat(code).resolvedOptions()
113+
} else if ('listformat' == k) {constructor = new Intl.ListFormat(code).resolvedOptions()
112114
} else if ('numberformat' == k) {constructor = new Intl.NumberFormat(code).resolvedOptions()
113115
} else if ('pluralrules' == k) {constructor = new Intl.PluralRules(code).resolvedOptions()
114116
} else if ('relativetimeformat' == k) {constructor = new Intl.RelativeTimeFormat(code).resolvedOptions()
@@ -145,16 +147,41 @@
145147
let oMax = {
146148
'collator': ['caseFirst','collation','ignorePunctuation','numeric','sensitivity','usage'],
147149
"datetimeformat": ['calendar','day','hourcycle','month','numberingSystem','year'],
150+
/* NOTE: displaynames: https://tc39.es/ecma402/#intl-displaynames-objects
151+
- four types: currency, language, region, script
152+
- e.g. new Intl.DisplayNames(code, {type: 'language'}).resolvedOptions()
153+
- second options parameter
154+
- fallback: default is code
155+
- style: default is long
156+
- languageDisplay (for use with type 'language'): default is dialect
157+
- so nothing is gained here as all codes are indentical
158+
- but we can use this API to get results per locale using 'of' e.g.
159+
> let l = new Intl.DisplayNames(code, {type: 'language'}).resolvedOptions()
160+
> s.of('en-US') = "American English" // code: en-US
161+
> s.of('en-US') = "anglais américain" // code: fr
162+
> and we can of course pass undefined as the code
163+
*/
164+
'durationformat': [ // creates 10 buckets on it's own
165+
'days','daysDisplay','hours','hoursDisplay','microseconds','microsecondsDisplay',
166+
'milliseconds','millisecondsDisplay','minutes','minutesDisplay','months','monthsDisplay',
167+
'nanoseconds','nanosecondsDisplay','numberingSystem','seconds','secondsDisplay',
168+
'style','weeks','weeksDisplay','years','yearsDisplay'
169+
],
170+
/* listformat: https://tc39.es/ecma402/#listformat-objects
171+
- options are defaults
172+
- style = long, type = conjunction
173+
- i.e user must set them
174+
*/
148175
'numberformat': [
149176
'maximumFractionDigits','minimumFractionDigits','minimumIntegerDigits',
150177
'roundingIncrement','roundingMode','roundingPriority','trailingZeroDisplay',
151-
'notation','numberingSystem','signDisplay','style','useGrouping'
178+
'notation','numberingSystem','signDisplay','style','useGrouping',
152179
],
153180
'pluralrules': [
154181
'maximumFractionDigits','minimumFractionDigits','minimumIntegerDigits','pluralCategories',
155182
'roundingIncrement','roundingMode','roundingPriority','trailingZeroDisplay','type'
156183
],
157-
'relativetimeformat': ['numberingSystem','nnumeric','style'],
184+
'relativetimeformat': ['numberingSystem','numeric','style'],
158185
'segmenter': ['granularity'],
159186
}
160187

@@ -222,8 +249,9 @@
222249
// notate new if 128+
223250
if (isVer > 127) {
224251
// results
225-
if (resultsHash == "d2088ade") { //FF134+
226-
} else if (resultsHash == "422c656d") { // FF128-133
252+
if (resultsHash == "5d643afe") { // FF134+ with Intl.DurationFormat enabled
253+
} else if (resultsHash == "4e1cb92a") { // FF134+ without Intl.DurationFormat
254+
} else if (resultsHash == "d39ce60e") { // FF128-133
227255
} else {resultsHash += ' '+ zNEW
228256
}
229257
// locales
@@ -292,6 +320,7 @@
292320
]
293321
list = list.concat(aListExtra)
294322
list = list.filter(function(item, position) {return list.indexOf(item) === position})
323+
//list = ["en,english"]
295324
legend()
296325
setBtn("all")
297326
setTimeout(function() {

0 commit comments

Comments
 (0)