Changeset 215616 in webkit
- Timestamp:
- Apr 21, 2017, 10:58:32 AM (9 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 11 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/js/intl-datetimeformat-expected.txt (modified) (1 diff)
-
LayoutTests/js/script-tests/intl-datetimeformat.js (modified) (1 diff)
-
Source/JavaScriptCore/ChangeLog (modified) (1 diff)
-
Source/JavaScriptCore/icu/unicode/udat.h (modified) (30 diffs)
-
Source/JavaScriptCore/icu/unicode/ufieldpositer.h (added)
-
Source/JavaScriptCore/icu/unicode/uvernum.h (modified) (9 diffs)
-
Source/JavaScriptCore/runtime/CommonIdentifiers.h (modified) (1 diff)
-
Source/JavaScriptCore/runtime/IntlDateTimeFormat.cpp (modified) (3 diffs)
-
Source/JavaScriptCore/runtime/IntlDateTimeFormat.h (modified) (3 diffs)
-
Source/JavaScriptCore/runtime/IntlDateTimeFormatPrototype.cpp (modified) (4 diffs)
-
Source/JavaScriptCore/runtime/IntlDateTimeFormatPrototype.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r215607 r215616 1 2017-04-21 Andy VanWagoner <thetalecrafter@gmail.com> 2 3 [INTL] Implement Intl.DateTimeFormat.prototype.formatToParts 4 https://bugs.webkit.org/show_bug.cgi?id=169458 5 6 Reviewed by JF Bastien. 7 8 Add tests for formatToParts 9 10 * js/intl-datetimeformat-expected.txt: 11 * js/script-tests/intl-datetimeformat.js: 12 1 13 2017-04-21 Timothy Horton <timothy_horton@apple.com> 2 14 -
trunk/LayoutTests/js/intl-datetimeformat-expected.txt
r215526 r215616 2156 2156 PASS var legacy = Object.create(Intl.DateTimeFormat.prototype);Intl.DateTimeFormat.call(legacy, 'en-u-nu-arab', { timeZone: 'America/Los_Angeles' }).format(1451099872641) is '١٢/٢٥/٢٠١٥' 2157 2157 PASS var incompat = {};Intl.DateTimeFormat.apply(incompat) is not incompat 2158 PASS Intl.DateTimeFormat.prototype.formatToParts is an instance of Function 2159 PASS Intl.DateTimeFormat.prototype.formatToParts.length is 0 2160 PASS Object.getOwnPropertyDescriptor(Intl.DateTimeFormat.prototype, 'formatToParts').writable is true 2161 PASS Object.getOwnPropertyDescriptor(Intl.DateTimeFormat.prototype, 'formatToParts').enumerable is false 2162 PASS Object.getOwnPropertyDescriptor(Intl.DateTimeFormat.prototype, 'formatToParts').configurable is true 2163 PASS Object.getOwnPropertyDescriptor(Intl.DateTimeFormat.prototype, 'formatToParts').get is undefined 2164 PASS Object.getOwnPropertyDescriptor(Intl.DateTimeFormat.prototype, 'formatToParts').set is undefined 2165 PASS new Intl.DateTimeFormat().formatToParts({}) threw exception RangeError: date value is not finite in DateTimeFormat formatToParts(). 2166 PASS new Intl.DateTimeFormat().formatToParts(NaN) threw exception RangeError: date value is not finite in DateTimeFormat formatToParts(). 2167 PASS new Intl.DateTimeFormat().formatToParts(Infinity) threw exception RangeError: date value is not finite in DateTimeFormat formatToParts(). 2168 PASS new Intl.DateTimeFormat().formatToParts(-Infinity) threw exception RangeError: date value is not finite in DateTimeFormat formatToParts(). 2169 PASS new Intl.DateTimeFormat().formatToParts(new Date(NaN)) threw exception RangeError: date value is not finite in DateTimeFormat formatToParts(). 2170 PASS JSON.stringify( 2171 Intl.DateTimeFormat("pt-BR", { 2172 hour: "numeric", minute: "numeric", second: "numeric", 2173 year: "numeric", month: "numeric", day: "numeric", 2174 timeZoneName: "short", era: "short", timeZone: "UTC" 2175 }).formatToParts(0).filter((part) => (part.type !== "literal")) 2176 ) is JSON.stringify([ 2177 {"type":"day","value":"1"}, 2178 {"type":"month","value":"1"}, 2179 {"type":"year","value":"1970"}, 2180 {"type":"era","value":"d.C."}, 2181 {"type":"hour","value":"00"}, 2182 {"type":"minute","value":"00"}, 2183 {"type":"second","value":"00"}, 2184 {"type":"timeZoneName","value":"GMT"} 2185 ]) 2186 PASS Intl.DateTimeFormat("ar", { weekday: "short", year: "numeric", month: "short", day: "numeric", hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts() is an instance of Array 2187 PASS Intl.DateTimeFormat("ar", { weekday: "short", year: "numeric", month: "short", day: "numeric" }).formatToParts() is an instance of Array 2188 PASS Intl.DateTimeFormat("ar", { year: "numeric", month: "long", day: "numeric" }).formatToParts() is an instance of Array 2189 PASS Intl.DateTimeFormat("ar", { year: "numeric", month: "long" }).formatToParts() is an instance of Array 2190 PASS Intl.DateTimeFormat("ar", { month: "long", day: "numeric" }).formatToParts() is an instance of Array 2191 PASS Intl.DateTimeFormat("ar", { hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts() is an instance of Array 2192 PASS Intl.DateTimeFormat("ar", { hour: "numeric", minute: "numeric" }).formatToParts() is an instance of Array 2193 PASS Intl.DateTimeFormat("ar-SA", { weekday: "short", year: "numeric", month: "short", day: "numeric", hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts() is an instance of Array 2194 PASS Intl.DateTimeFormat("ar-SA", { weekday: "short", year: "numeric", month: "short", day: "numeric" }).formatToParts() is an instance of Array 2195 PASS Intl.DateTimeFormat("ar-SA", { year: "numeric", month: "long", day: "numeric" }).formatToParts() is an instance of Array 2196 PASS Intl.DateTimeFormat("ar-SA", { year: "numeric", month: "long" }).formatToParts() is an instance of Array 2197 PASS Intl.DateTimeFormat("ar-SA", { month: "long", day: "numeric" }).formatToParts() is an instance of Array 2198 PASS Intl.DateTimeFormat("ar-SA", { hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts() is an instance of Array 2199 PASS Intl.DateTimeFormat("ar-SA", { hour: "numeric", minute: "numeric" }).formatToParts() is an instance of Array 2200 PASS Intl.DateTimeFormat("be", { weekday: "short", year: "numeric", month: "short", day: "numeric", hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts() is an instance of Array 2201 PASS Intl.DateTimeFormat("be", { weekday: "short", year: "numeric", month: "short", day: "numeric" }).formatToParts() is an instance of Array 2202 PASS Intl.DateTimeFormat("be", { year: "numeric", month: "long", day: "numeric" }).formatToParts() is an instance of Array 2203 PASS Intl.DateTimeFormat("be", { year: "numeric", month: "long" }).formatToParts() is an instance of Array 2204 PASS Intl.DateTimeFormat("be", { month: "long", day: "numeric" }).formatToParts() is an instance of Array 2205 PASS Intl.DateTimeFormat("be", { hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts() is an instance of Array 2206 PASS Intl.DateTimeFormat("be", { hour: "numeric", minute: "numeric" }).formatToParts() is an instance of Array 2207 PASS Intl.DateTimeFormat("ca", { weekday: "short", year: "numeric", month: "short", day: "numeric", hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts() is an instance of Array 2208 PASS Intl.DateTimeFormat("ca", { weekday: "short", year: "numeric", month: "short", day: "numeric" }).formatToParts() is an instance of Array 2209 PASS Intl.DateTimeFormat("ca", { year: "numeric", month: "long", day: "numeric" }).formatToParts() is an instance of Array 2210 PASS Intl.DateTimeFormat("ca", { year: "numeric", month: "long" }).formatToParts() is an instance of Array 2211 PASS Intl.DateTimeFormat("ca", { month: "long", day: "numeric" }).formatToParts() is an instance of Array 2212 PASS Intl.DateTimeFormat("ca", { hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts() is an instance of Array 2213 PASS Intl.DateTimeFormat("ca", { hour: "numeric", minute: "numeric" }).formatToParts() is an instance of Array 2214 PASS Intl.DateTimeFormat("cs", { weekday: "short", year: "numeric", month: "short", day: "numeric", hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts() is an instance of Array 2215 PASS Intl.DateTimeFormat("cs", { weekday: "short", year: "numeric", month: "short", day: "numeric" }).formatToParts() is an instance of Array 2216 PASS Intl.DateTimeFormat("cs", { year: "numeric", month: "long", day: "numeric" }).formatToParts() is an instance of Array 2217 PASS Intl.DateTimeFormat("cs", { year: "numeric", month: "long" }).formatToParts() is an instance of Array 2218 PASS Intl.DateTimeFormat("cs", { month: "long", day: "numeric" }).formatToParts() is an instance of Array 2219 PASS Intl.DateTimeFormat("cs", { hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts() is an instance of Array 2220 PASS Intl.DateTimeFormat("cs", { hour: "numeric", minute: "numeric" }).formatToParts() is an instance of Array 2221 PASS Intl.DateTimeFormat("da", { weekday: "short", year: "numeric", month: "short", day: "numeric", hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts() is an instance of Array 2222 PASS Intl.DateTimeFormat("da", { weekday: "short", year: "numeric", month: "short", day: "numeric" }).formatToParts() is an instance of Array 2223 PASS Intl.DateTimeFormat("da", { year: "numeric", month: "long", day: "numeric" }).formatToParts() is an instance of Array 2224 PASS Intl.DateTimeFormat("da", { year: "numeric", month: "long" }).formatToParts() is an instance of Array 2225 PASS Intl.DateTimeFormat("da", { month: "long", day: "numeric" }).formatToParts() is an instance of Array 2226 PASS Intl.DateTimeFormat("da", { hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts() is an instance of Array 2227 PASS Intl.DateTimeFormat("da", { hour: "numeric", minute: "numeric" }).formatToParts() is an instance of Array 2228 PASS Intl.DateTimeFormat("de", { weekday: "short", year: "numeric", month: "short", day: "numeric", hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts() is an instance of Array 2229 PASS Intl.DateTimeFormat("de", { weekday: "short", year: "numeric", month: "short", day: "numeric" }).formatToParts() is an instance of Array 2230 PASS Intl.DateTimeFormat("de", { year: "numeric", month: "long", day: "numeric" }).formatToParts() is an instance of Array 2231 PASS Intl.DateTimeFormat("de", { year: "numeric", month: "long" }).formatToParts() is an instance of Array 2232 PASS Intl.DateTimeFormat("de", { month: "long", day: "numeric" }).formatToParts() is an instance of Array 2233 PASS Intl.DateTimeFormat("de", { hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts() is an instance of Array 2234 PASS Intl.DateTimeFormat("de", { hour: "numeric", minute: "numeric" }).formatToParts() is an instance of Array 2235 PASS Intl.DateTimeFormat("de-CH", { weekday: "short", year: "numeric", month: "short", day: "numeric", hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts() is an instance of Array 2236 PASS Intl.DateTimeFormat("de-CH", { weekday: "short", year: "numeric", month: "short", day: "numeric" }).formatToParts() is an instance of Array 2237 PASS Intl.DateTimeFormat("de-CH", { year: "numeric", month: "long", day: "numeric" }).formatToParts() is an instance of Array 2238 PASS Intl.DateTimeFormat("de-CH", { year: "numeric", month: "long" }).formatToParts() is an instance of Array 2239 PASS Intl.DateTimeFormat("de-CH", { month: "long", day: "numeric" }).formatToParts() is an instance of Array 2240 PASS Intl.DateTimeFormat("de-CH", { hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts() is an instance of Array 2241 PASS Intl.DateTimeFormat("de-CH", { hour: "numeric", minute: "numeric" }).formatToParts() is an instance of Array 2242 PASS Intl.DateTimeFormat("en", { weekday: "short", year: "numeric", month: "short", day: "numeric", hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts() is an instance of Array 2243 PASS Intl.DateTimeFormat("en", { weekday: "short", year: "numeric", month: "short", day: "numeric" }).formatToParts() is an instance of Array 2244 PASS Intl.DateTimeFormat("en", { year: "numeric", month: "long", day: "numeric" }).formatToParts() is an instance of Array 2245 PASS Intl.DateTimeFormat("en", { year: "numeric", month: "long" }).formatToParts() is an instance of Array 2246 PASS Intl.DateTimeFormat("en", { month: "long", day: "numeric" }).formatToParts() is an instance of Array 2247 PASS Intl.DateTimeFormat("en", { hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts() is an instance of Array 2248 PASS Intl.DateTimeFormat("en", { hour: "numeric", minute: "numeric" }).formatToParts() is an instance of Array 2249 PASS Intl.DateTimeFormat("en-AU", { weekday: "short", year: "numeric", month: "short", day: "numeric", hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts() is an instance of Array 2250 PASS Intl.DateTimeFormat("en-AU", { weekday: "short", year: "numeric", month: "short", day: "numeric" }).formatToParts() is an instance of Array 2251 PASS Intl.DateTimeFormat("en-AU", { year: "numeric", month: "long", day: "numeric" }).formatToParts() is an instance of Array 2252 PASS Intl.DateTimeFormat("en-AU", { year: "numeric", month: "long" }).formatToParts() is an instance of Array 2253 PASS Intl.DateTimeFormat("en-AU", { month: "long", day: "numeric" }).formatToParts() is an instance of Array 2254 PASS Intl.DateTimeFormat("en-AU", { hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts() is an instance of Array 2255 PASS Intl.DateTimeFormat("en-AU", { hour: "numeric", minute: "numeric" }).formatToParts() is an instance of Array 2256 PASS Intl.DateTimeFormat("en-GB", { weekday: "short", year: "numeric", month: "short", day: "numeric", hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts() is an instance of Array 2257 PASS Intl.DateTimeFormat("en-GB", { weekday: "short", year: "numeric", month: "short", day: "numeric" }).formatToParts() is an instance of Array 2258 PASS Intl.DateTimeFormat("en-GB", { year: "numeric", month: "long", day: "numeric" }).formatToParts() is an instance of Array 2259 PASS Intl.DateTimeFormat("en-GB", { year: "numeric", month: "long" }).formatToParts() is an instance of Array 2260 PASS Intl.DateTimeFormat("en-GB", { month: "long", day: "numeric" }).formatToParts() is an instance of Array 2261 PASS Intl.DateTimeFormat("en-GB", { hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts() is an instance of Array 2262 PASS Intl.DateTimeFormat("en-GB", { hour: "numeric", minute: "numeric" }).formatToParts() is an instance of Array 2263 PASS Intl.DateTimeFormat("en-PH", { weekday: "short", year: "numeric", month: "short", day: "numeric", hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts() is an instance of Array 2264 PASS Intl.DateTimeFormat("en-PH", { weekday: "short", year: "numeric", month: "short", day: "numeric" }).formatToParts() is an instance of Array 2265 PASS Intl.DateTimeFormat("en-PH", { year: "numeric", month: "long", day: "numeric" }).formatToParts() is an instance of Array 2266 PASS Intl.DateTimeFormat("en-PH", { year: "numeric", month: "long" }).formatToParts() is an instance of Array 2267 PASS Intl.DateTimeFormat("en-PH", { month: "long", day: "numeric" }).formatToParts() is an instance of Array 2268 PASS Intl.DateTimeFormat("en-PH", { hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts() is an instance of Array 2269 PASS Intl.DateTimeFormat("en-PH", { hour: "numeric", minute: "numeric" }).formatToParts() is an instance of Array 2270 PASS Intl.DateTimeFormat("en-US", { weekday: "short", year: "numeric", month: "short", day: "numeric", hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts() is an instance of Array 2271 PASS Intl.DateTimeFormat("en-US", { weekday: "short", year: "numeric", month: "short", day: "numeric" }).formatToParts() is an instance of Array 2272 PASS Intl.DateTimeFormat("en-US", { year: "numeric", month: "long", day: "numeric" }).formatToParts() is an instance of Array 2273 PASS Intl.DateTimeFormat("en-US", { year: "numeric", month: "long" }).formatToParts() is an instance of Array 2274 PASS Intl.DateTimeFormat("en-US", { month: "long", day: "numeric" }).formatToParts() is an instance of Array 2275 PASS Intl.DateTimeFormat("en-US", { hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts() is an instance of Array 2276 PASS Intl.DateTimeFormat("en-US", { hour: "numeric", minute: "numeric" }).formatToParts() is an instance of Array 2277 PASS Intl.DateTimeFormat("el", { weekday: "short", year: "numeric", month: "short", day: "numeric", hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts() is an instance of Array 2278 PASS Intl.DateTimeFormat("el", { weekday: "short", year: "numeric", month: "short", day: "numeric" }).formatToParts() is an instance of Array 2279 PASS Intl.DateTimeFormat("el", { year: "numeric", month: "long", day: "numeric" }).formatToParts() is an instance of Array 2280 PASS Intl.DateTimeFormat("el", { year: "numeric", month: "long" }).formatToParts() is an instance of Array 2281 PASS Intl.DateTimeFormat("el", { month: "long", day: "numeric" }).formatToParts() is an instance of Array 2282 PASS Intl.DateTimeFormat("el", { hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts() is an instance of Array 2283 PASS Intl.DateTimeFormat("el", { hour: "numeric", minute: "numeric" }).formatToParts() is an instance of Array 2284 PASS Intl.DateTimeFormat("es", { weekday: "short", year: "numeric", month: "short", day: "numeric", hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts() is an instance of Array 2285 PASS Intl.DateTimeFormat("es", { weekday: "short", year: "numeric", month: "short", day: "numeric" }).formatToParts() is an instance of Array 2286 PASS Intl.DateTimeFormat("es", { year: "numeric", month: "long", day: "numeric" }).formatToParts() is an instance of Array 2287 PASS Intl.DateTimeFormat("es", { year: "numeric", month: "long" }).formatToParts() is an instance of Array 2288 PASS Intl.DateTimeFormat("es", { month: "long", day: "numeric" }).formatToParts() is an instance of Array 2289 PASS Intl.DateTimeFormat("es", { hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts() is an instance of Array 2290 PASS Intl.DateTimeFormat("es", { hour: "numeric", minute: "numeric" }).formatToParts() is an instance of Array 2291 PASS Intl.DateTimeFormat("es-MX", { weekday: "short", year: "numeric", month: "short", day: "numeric", hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts() is an instance of Array 2292 PASS Intl.DateTimeFormat("es-MX", { weekday: "short", year: "numeric", month: "short", day: "numeric" }).formatToParts() is an instance of Array 2293 PASS Intl.DateTimeFormat("es-MX", { year: "numeric", month: "long", day: "numeric" }).formatToParts() is an instance of Array 2294 PASS Intl.DateTimeFormat("es-MX", { year: "numeric", month: "long" }).formatToParts() is an instance of Array 2295 PASS Intl.DateTimeFormat("es-MX", { month: "long", day: "numeric" }).formatToParts() is an instance of Array 2296 PASS Intl.DateTimeFormat("es-MX", { hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts() is an instance of Array 2297 PASS Intl.DateTimeFormat("es-MX", { hour: "numeric", minute: "numeric" }).formatToParts() is an instance of Array 2298 PASS Intl.DateTimeFormat("es-PR", { weekday: "short", year: "numeric", month: "short", day: "numeric", hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts() is an instance of Array 2299 PASS Intl.DateTimeFormat("es-PR", { weekday: "short", year: "numeric", month: "short", day: "numeric" }).formatToParts() is an instance of Array 2300 PASS Intl.DateTimeFormat("es-PR", { year: "numeric", month: "long", day: "numeric" }).formatToParts() is an instance of Array 2301 PASS Intl.DateTimeFormat("es-PR", { year: "numeric", month: "long" }).formatToParts() is an instance of Array 2302 PASS Intl.DateTimeFormat("es-PR", { month: "long", day: "numeric" }).formatToParts() is an instance of Array 2303 PASS Intl.DateTimeFormat("es-PR", { hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts() is an instance of Array 2304 PASS Intl.DateTimeFormat("es-PR", { hour: "numeric", minute: "numeric" }).formatToParts() is an instance of Array 2305 PASS Intl.DateTimeFormat("fr", { weekday: "short", year: "numeric", month: "short", day: "numeric", hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts() is an instance of Array 2306 PASS Intl.DateTimeFormat("fr", { weekday: "short", year: "numeric", month: "short", day: "numeric" }).formatToParts() is an instance of Array 2307 PASS Intl.DateTimeFormat("fr", { year: "numeric", month: "long", day: "numeric" }).formatToParts() is an instance of Array 2308 PASS Intl.DateTimeFormat("fr", { year: "numeric", month: "long" }).formatToParts() is an instance of Array 2309 PASS Intl.DateTimeFormat("fr", { month: "long", day: "numeric" }).formatToParts() is an instance of Array 2310 PASS Intl.DateTimeFormat("fr", { hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts() is an instance of Array 2311 PASS Intl.DateTimeFormat("fr", { hour: "numeric", minute: "numeric" }).formatToParts() is an instance of Array 2312 PASS Intl.DateTimeFormat("fr-CA", { weekday: "short", year: "numeric", month: "short", day: "numeric", hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts() is an instance of Array 2313 PASS Intl.DateTimeFormat("fr-CA", { weekday: "short", year: "numeric", month: "short", day: "numeric" }).formatToParts() is an instance of Array 2314 PASS Intl.DateTimeFormat("fr-CA", { year: "numeric", month: "long", day: "numeric" }).formatToParts() is an instance of Array 2315 PASS Intl.DateTimeFormat("fr-CA", { year: "numeric", month: "long" }).formatToParts() is an instance of Array 2316 PASS Intl.DateTimeFormat("fr-CA", { month: "long", day: "numeric" }).formatToParts() is an instance of Array 2317 PASS Intl.DateTimeFormat("fr-CA", { hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts() is an instance of Array 2318 PASS Intl.DateTimeFormat("fr-CA", { hour: "numeric", minute: "numeric" }).formatToParts() is an instance of Array 2319 PASS Intl.DateTimeFormat("ga", { weekday: "short", year: "numeric", month: "short", day: "numeric", hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts() is an instance of Array 2320 PASS Intl.DateTimeFormat("ga", { weekday: "short", year: "numeric", month: "short", day: "numeric" }).formatToParts() is an instance of Array 2321 PASS Intl.DateTimeFormat("ga", { year: "numeric", month: "long", day: "numeric" }).formatToParts() is an instance of Array 2322 PASS Intl.DateTimeFormat("ga", { year: "numeric", month: "long" }).formatToParts() is an instance of Array 2323 PASS Intl.DateTimeFormat("ga", { month: "long", day: "numeric" }).formatToParts() is an instance of Array 2324 PASS Intl.DateTimeFormat("ga", { hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts() is an instance of Array 2325 PASS Intl.DateTimeFormat("ga", { hour: "numeric", minute: "numeric" }).formatToParts() is an instance of Array 2326 PASS Intl.DateTimeFormat("hi-IN", { weekday: "short", year: "numeric", month: "short", day: "numeric", hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts() is an instance of Array 2327 PASS Intl.DateTimeFormat("hi-IN", { weekday: "short", year: "numeric", month: "short", day: "numeric" }).formatToParts() is an instance of Array 2328 PASS Intl.DateTimeFormat("hi-IN", { year: "numeric", month: "long", day: "numeric" }).formatToParts() is an instance of Array 2329 PASS Intl.DateTimeFormat("hi-IN", { year: "numeric", month: "long" }).formatToParts() is an instance of Array 2330 PASS Intl.DateTimeFormat("hi-IN", { month: "long", day: "numeric" }).formatToParts() is an instance of Array 2331 PASS Intl.DateTimeFormat("hi-IN", { hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts() is an instance of Array 2332 PASS Intl.DateTimeFormat("hi-IN", { hour: "numeric", minute: "numeric" }).formatToParts() is an instance of Array 2333 PASS Intl.DateTimeFormat("is", { weekday: "short", year: "numeric", month: "short", day: "numeric", hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts() is an instance of Array 2334 PASS Intl.DateTimeFormat("is", { weekday: "short", year: "numeric", month: "short", day: "numeric" }).formatToParts() is an instance of Array 2335 PASS Intl.DateTimeFormat("is", { year: "numeric", month: "long", day: "numeric" }).formatToParts() is an instance of Array 2336 PASS Intl.DateTimeFormat("is", { year: "numeric", month: "long" }).formatToParts() is an instance of Array 2337 PASS Intl.DateTimeFormat("is", { month: "long", day: "numeric" }).formatToParts() is an instance of Array 2338 PASS Intl.DateTimeFormat("is", { hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts() is an instance of Array 2339 PASS Intl.DateTimeFormat("is", { hour: "numeric", minute: "numeric" }).formatToParts() is an instance of Array 2340 PASS Intl.DateTimeFormat("it", { weekday: "short", year: "numeric", month: "short", day: "numeric", hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts() is an instance of Array 2341 PASS Intl.DateTimeFormat("it", { weekday: "short", year: "numeric", month: "short", day: "numeric" }).formatToParts() is an instance of Array 2342 PASS Intl.DateTimeFormat("it", { year: "numeric", month: "long", day: "numeric" }).formatToParts() is an instance of Array 2343 PASS Intl.DateTimeFormat("it", { year: "numeric", month: "long" }).formatToParts() is an instance of Array 2344 PASS Intl.DateTimeFormat("it", { month: "long", day: "numeric" }).formatToParts() is an instance of Array 2345 PASS Intl.DateTimeFormat("it", { hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts() is an instance of Array 2346 PASS Intl.DateTimeFormat("it", { hour: "numeric", minute: "numeric" }).formatToParts() is an instance of Array 2347 PASS Intl.DateTimeFormat("iw", { weekday: "short", year: "numeric", month: "short", day: "numeric", hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts() is an instance of Array 2348 PASS Intl.DateTimeFormat("iw", { weekday: "short", year: "numeric", month: "short", day: "numeric" }).formatToParts() is an instance of Array 2349 PASS Intl.DateTimeFormat("iw", { year: "numeric", month: "long", day: "numeric" }).formatToParts() is an instance of Array 2350 PASS Intl.DateTimeFormat("iw", { year: "numeric", month: "long" }).formatToParts() is an instance of Array 2351 PASS Intl.DateTimeFormat("iw", { month: "long", day: "numeric" }).formatToParts() is an instance of Array 2352 PASS Intl.DateTimeFormat("iw", { hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts() is an instance of Array 2353 PASS Intl.DateTimeFormat("iw", { hour: "numeric", minute: "numeric" }).formatToParts() is an instance of Array 2354 PASS Intl.DateTimeFormat("ja", { weekday: "short", year: "numeric", month: "short", day: "numeric", hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts() is an instance of Array 2355 PASS Intl.DateTimeFormat("ja", { weekday: "short", year: "numeric", month: "short", day: "numeric" }).formatToParts() is an instance of Array 2356 PASS Intl.DateTimeFormat("ja", { year: "numeric", month: "long", day: "numeric" }).formatToParts() is an instance of Array 2357 PASS Intl.DateTimeFormat("ja", { year: "numeric", month: "long" }).formatToParts() is an instance of Array 2358 PASS Intl.DateTimeFormat("ja", { month: "long", day: "numeric" }).formatToParts() is an instance of Array 2359 PASS Intl.DateTimeFormat("ja", { hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts() is an instance of Array 2360 PASS Intl.DateTimeFormat("ja", { hour: "numeric", minute: "numeric" }).formatToParts() is an instance of Array 2361 PASS Intl.DateTimeFormat("ko-KR", { weekday: "short", year: "numeric", month: "short", day: "numeric", hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts() is an instance of Array 2362 PASS Intl.DateTimeFormat("ko-KR", { weekday: "short", year: "numeric", month: "short", day: "numeric" }).formatToParts() is an instance of Array 2363 PASS Intl.DateTimeFormat("ko-KR", { year: "numeric", month: "long", day: "numeric" }).formatToParts() is an instance of Array 2364 PASS Intl.DateTimeFormat("ko-KR", { year: "numeric", month: "long" }).formatToParts() is an instance of Array 2365 PASS Intl.DateTimeFormat("ko-KR", { month: "long", day: "numeric" }).formatToParts() is an instance of Array 2366 PASS Intl.DateTimeFormat("ko-KR", { hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts() is an instance of Array 2367 PASS Intl.DateTimeFormat("ko-KR", { hour: "numeric", minute: "numeric" }).formatToParts() is an instance of Array 2368 PASS Intl.DateTimeFormat("lt", { weekday: "short", year: "numeric", month: "short", day: "numeric", hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts() is an instance of Array 2369 PASS Intl.DateTimeFormat("lt", { weekday: "short", year: "numeric", month: "short", day: "numeric" }).formatToParts() is an instance of Array 2370 PASS Intl.DateTimeFormat("lt", { year: "numeric", month: "long", day: "numeric" }).formatToParts() is an instance of Array 2371 PASS Intl.DateTimeFormat("lt", { year: "numeric", month: "long" }).formatToParts() is an instance of Array 2372 PASS Intl.DateTimeFormat("lt", { month: "long", day: "numeric" }).formatToParts() is an instance of Array 2373 PASS Intl.DateTimeFormat("lt", { hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts() is an instance of Array 2374 PASS Intl.DateTimeFormat("lt", { hour: "numeric", minute: "numeric" }).formatToParts() is an instance of Array 2375 PASS Intl.DateTimeFormat("lv", { weekday: "short", year: "numeric", month: "short", day: "numeric", hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts() is an instance of Array 2376 PASS Intl.DateTimeFormat("lv", { weekday: "short", year: "numeric", month: "short", day: "numeric" }).formatToParts() is an instance of Array 2377 PASS Intl.DateTimeFormat("lv", { year: "numeric", month: "long", day: "numeric" }).formatToParts() is an instance of Array 2378 PASS Intl.DateTimeFormat("lv", { year: "numeric", month: "long" }).formatToParts() is an instance of Array 2379 PASS Intl.DateTimeFormat("lv", { month: "long", day: "numeric" }).formatToParts() is an instance of Array 2380 PASS Intl.DateTimeFormat("lv", { hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts() is an instance of Array 2381 PASS Intl.DateTimeFormat("lv", { hour: "numeric", minute: "numeric" }).formatToParts() is an instance of Array 2382 PASS Intl.DateTimeFormat("mk", { weekday: "short", year: "numeric", month: "short", day: "numeric", hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts() is an instance of Array 2383 PASS Intl.DateTimeFormat("mk", { weekday: "short", year: "numeric", month: "short", day: "numeric" }).formatToParts() is an instance of Array 2384 PASS Intl.DateTimeFormat("mk", { year: "numeric", month: "long", day: "numeric" }).formatToParts() is an instance of Array 2385 PASS Intl.DateTimeFormat("mk", { year: "numeric", month: "long" }).formatToParts() is an instance of Array 2386 PASS Intl.DateTimeFormat("mk", { month: "long", day: "numeric" }).formatToParts() is an instance of Array 2387 PASS Intl.DateTimeFormat("mk", { hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts() is an instance of Array 2388 PASS Intl.DateTimeFormat("mk", { hour: "numeric", minute: "numeric" }).formatToParts() is an instance of Array 2389 PASS Intl.DateTimeFormat("ms", { weekday: "short", year: "numeric", month: "short", day: "numeric", hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts() is an instance of Array 2390 PASS Intl.DateTimeFormat("ms", { weekday: "short", year: "numeric", month: "short", day: "numeric" }).formatToParts() is an instance of Array 2391 PASS Intl.DateTimeFormat("ms", { year: "numeric", month: "long", day: "numeric" }).formatToParts() is an instance of Array 2392 PASS Intl.DateTimeFormat("ms", { year: "numeric", month: "long" }).formatToParts() is an instance of Array 2393 PASS Intl.DateTimeFormat("ms", { month: "long", day: "numeric" }).formatToParts() is an instance of Array 2394 PASS Intl.DateTimeFormat("ms", { hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts() is an instance of Array 2395 PASS Intl.DateTimeFormat("ms", { hour: "numeric", minute: "numeric" }).formatToParts() is an instance of Array 2396 PASS Intl.DateTimeFormat("mt", { weekday: "short", year: "numeric", month: "short", day: "numeric", hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts() is an instance of Array 2397 PASS Intl.DateTimeFormat("mt", { weekday: "short", year: "numeric", month: "short", day: "numeric" }).formatToParts() is an instance of Array 2398 PASS Intl.DateTimeFormat("mt", { year: "numeric", month: "long", day: "numeric" }).formatToParts() is an instance of Array 2399 PASS Intl.DateTimeFormat("mt", { year: "numeric", month: "long" }).formatToParts() is an instance of Array 2400 PASS Intl.DateTimeFormat("mt", { month: "long", day: "numeric" }).formatToParts() is an instance of Array 2401 PASS Intl.DateTimeFormat("mt", { hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts() is an instance of Array 2402 PASS Intl.DateTimeFormat("mt", { hour: "numeric", minute: "numeric" }).formatToParts() is an instance of Array 2403 PASS Intl.DateTimeFormat("nb", { weekday: "short", year: "numeric", month: "short", day: "numeric", hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts() is an instance of Array 2404 PASS Intl.DateTimeFormat("nb", { weekday: "short", year: "numeric", month: "short", day: "numeric" }).formatToParts() is an instance of Array 2405 PASS Intl.DateTimeFormat("nb", { year: "numeric", month: "long", day: "numeric" }).formatToParts() is an instance of Array 2406 PASS Intl.DateTimeFormat("nb", { year: "numeric", month: "long" }).formatToParts() is an instance of Array 2407 PASS Intl.DateTimeFormat("nb", { month: "long", day: "numeric" }).formatToParts() is an instance of Array 2408 PASS Intl.DateTimeFormat("nb", { hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts() is an instance of Array 2409 PASS Intl.DateTimeFormat("nb", { hour: "numeric", minute: "numeric" }).formatToParts() is an instance of Array 2410 PASS Intl.DateTimeFormat("nl", { weekday: "short", year: "numeric", month: "short", day: "numeric", hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts() is an instance of Array 2411 PASS Intl.DateTimeFormat("nl", { weekday: "short", year: "numeric", month: "short", day: "numeric" }).formatToParts() is an instance of Array 2412 PASS Intl.DateTimeFormat("nl", { year: "numeric", month: "long", day: "numeric" }).formatToParts() is an instance of Array 2413 PASS Intl.DateTimeFormat("nl", { year: "numeric", month: "long" }).formatToParts() is an instance of Array 2414 PASS Intl.DateTimeFormat("nl", { month: "long", day: "numeric" }).formatToParts() is an instance of Array 2415 PASS Intl.DateTimeFormat("nl", { hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts() is an instance of Array 2416 PASS Intl.DateTimeFormat("nl", { hour: "numeric", minute: "numeric" }).formatToParts() is an instance of Array 2417 PASS Intl.DateTimeFormat("no", { weekday: "short", year: "numeric", month: "short", day: "numeric", hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts() is an instance of Array 2418 PASS Intl.DateTimeFormat("no", { weekday: "short", year: "numeric", month: "short", day: "numeric" }).formatToParts() is an instance of Array 2419 PASS Intl.DateTimeFormat("no", { year: "numeric", month: "long", day: "numeric" }).formatToParts() is an instance of Array 2420 PASS Intl.DateTimeFormat("no", { year: "numeric", month: "long" }).formatToParts() is an instance of Array 2421 PASS Intl.DateTimeFormat("no", { month: "long", day: "numeric" }).formatToParts() is an instance of Array 2422 PASS Intl.DateTimeFormat("no", { hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts() is an instance of Array 2423 PASS Intl.DateTimeFormat("no", { hour: "numeric", minute: "numeric" }).formatToParts() is an instance of Array 2424 PASS Intl.DateTimeFormat("pl", { weekday: "short", year: "numeric", month: "short", day: "numeric", hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts() is an instance of Array 2425 PASS Intl.DateTimeFormat("pl", { weekday: "short", year: "numeric", month: "short", day: "numeric" }).formatToParts() is an instance of Array 2426 PASS Intl.DateTimeFormat("pl", { year: "numeric", month: "long", day: "numeric" }).formatToParts() is an instance of Array 2427 PASS Intl.DateTimeFormat("pl", { year: "numeric", month: "long" }).formatToParts() is an instance of Array 2428 PASS Intl.DateTimeFormat("pl", { month: "long", day: "numeric" }).formatToParts() is an instance of Array 2429 PASS Intl.DateTimeFormat("pl", { hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts() is an instance of Array 2430 PASS Intl.DateTimeFormat("pl", { hour: "numeric", minute: "numeric" }).formatToParts() is an instance of Array 2431 PASS Intl.DateTimeFormat("pt", { weekday: "short", year: "numeric", month: "short", day: "numeric", hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts() is an instance of Array 2432 PASS Intl.DateTimeFormat("pt", { weekday: "short", year: "numeric", month: "short", day: "numeric" }).formatToParts() is an instance of Array 2433 PASS Intl.DateTimeFormat("pt", { year: "numeric", month: "long", day: "numeric" }).formatToParts() is an instance of Array 2434 PASS Intl.DateTimeFormat("pt", { year: "numeric", month: "long" }).formatToParts() is an instance of Array 2435 PASS Intl.DateTimeFormat("pt", { month: "long", day: "numeric" }).formatToParts() is an instance of Array 2436 PASS Intl.DateTimeFormat("pt", { hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts() is an instance of Array 2437 PASS Intl.DateTimeFormat("pt", { hour: "numeric", minute: "numeric" }).formatToParts() is an instance of Array 2438 PASS Intl.DateTimeFormat("pt-BR", { weekday: "short", year: "numeric", month: "short", day: "numeric", hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts() is an instance of Array 2439 PASS Intl.DateTimeFormat("pt-BR", { weekday: "short", year: "numeric", month: "short", day: "numeric" }).formatToParts() is an instance of Array 2440 PASS Intl.DateTimeFormat("pt-BR", { year: "numeric", month: "long", day: "numeric" }).formatToParts() is an instance of Array 2441 PASS Intl.DateTimeFormat("pt-BR", { year: "numeric", month: "long" }).formatToParts() is an instance of Array 2442 PASS Intl.DateTimeFormat("pt-BR", { month: "long", day: "numeric" }).formatToParts() is an instance of Array 2443 PASS Intl.DateTimeFormat("pt-BR", { hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts() is an instance of Array 2444 PASS Intl.DateTimeFormat("pt-BR", { hour: "numeric", minute: "numeric" }).formatToParts() is an instance of Array 2445 PASS Intl.DateTimeFormat("ro", { weekday: "short", year: "numeric", month: "short", day: "numeric", hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts() is an instance of Array 2446 PASS Intl.DateTimeFormat("ro", { weekday: "short", year: "numeric", month: "short", day: "numeric" }).formatToParts() is an instance of Array 2447 PASS Intl.DateTimeFormat("ro", { year: "numeric", month: "long", day: "numeric" }).formatToParts() is an instance of Array 2448 PASS Intl.DateTimeFormat("ro", { year: "numeric", month: "long" }).formatToParts() is an instance of Array 2449 PASS Intl.DateTimeFormat("ro", { month: "long", day: "numeric" }).formatToParts() is an instance of Array 2450 PASS Intl.DateTimeFormat("ro", { hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts() is an instance of Array 2451 PASS Intl.DateTimeFormat("ro", { hour: "numeric", minute: "numeric" }).formatToParts() is an instance of Array 2452 PASS Intl.DateTimeFormat("ru", { weekday: "short", year: "numeric", month: "short", day: "numeric", hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts() is an instance of Array 2453 PASS Intl.DateTimeFormat("ru", { weekday: "short", year: "numeric", month: "short", day: "numeric" }).formatToParts() is an instance of Array 2454 PASS Intl.DateTimeFormat("ru", { year: "numeric", month: "long", day: "numeric" }).formatToParts() is an instance of Array 2455 PASS Intl.DateTimeFormat("ru", { year: "numeric", month: "long" }).formatToParts() is an instance of Array 2456 PASS Intl.DateTimeFormat("ru", { month: "long", day: "numeric" }).formatToParts() is an instance of Array 2457 PASS Intl.DateTimeFormat("ru", { hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts() is an instance of Array 2458 PASS Intl.DateTimeFormat("ru", { hour: "numeric", minute: "numeric" }).formatToParts() is an instance of Array 2459 PASS Intl.DateTimeFormat("sk", { weekday: "short", year: "numeric", month: "short", day: "numeric", hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts() is an instance of Array 2460 PASS Intl.DateTimeFormat("sk", { weekday: "short", year: "numeric", month: "short", day: "numeric" }).formatToParts() is an instance of Array 2461 PASS Intl.DateTimeFormat("sk", { year: "numeric", month: "long", day: "numeric" }).formatToParts() is an instance of Array 2462 PASS Intl.DateTimeFormat("sk", { year: "numeric", month: "long" }).formatToParts() is an instance of Array 2463 PASS Intl.DateTimeFormat("sk", { month: "long", day: "numeric" }).formatToParts() is an instance of Array 2464 PASS Intl.DateTimeFormat("sk", { hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts() is an instance of Array 2465 PASS Intl.DateTimeFormat("sk", { hour: "numeric", minute: "numeric" }).formatToParts() is an instance of Array 2466 PASS Intl.DateTimeFormat("sl", { weekday: "short", year: "numeric", month: "short", day: "numeric", hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts() is an instance of Array 2467 PASS Intl.DateTimeFormat("sl", { weekday: "short", year: "numeric", month: "short", day: "numeric" }).formatToParts() is an instance of Array 2468 PASS Intl.DateTimeFormat("sl", { year: "numeric", month: "long", day: "numeric" }).formatToParts() is an instance of Array 2469 PASS Intl.DateTimeFormat("sl", { year: "numeric", month: "long" }).formatToParts() is an instance of Array 2470 PASS Intl.DateTimeFormat("sl", { month: "long", day: "numeric" }).formatToParts() is an instance of Array 2471 PASS Intl.DateTimeFormat("sl", { hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts() is an instance of Array 2472 PASS Intl.DateTimeFormat("sl", { hour: "numeric", minute: "numeric" }).formatToParts() is an instance of Array 2473 PASS Intl.DateTimeFormat("sr", { weekday: "short", year: "numeric", month: "short", day: "numeric", hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts() is an instance of Array 2474 PASS Intl.DateTimeFormat("sr", { weekday: "short", year: "numeric", month: "short", day: "numeric" }).formatToParts() is an instance of Array 2475 PASS Intl.DateTimeFormat("sr", { year: "numeric", month: "long", day: "numeric" }).formatToParts() is an instance of Array 2476 PASS Intl.DateTimeFormat("sr", { year: "numeric", month: "long" }).formatToParts() is an instance of Array 2477 PASS Intl.DateTimeFormat("sr", { month: "long", day: "numeric" }).formatToParts() is an instance of Array 2478 PASS Intl.DateTimeFormat("sr", { hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts() is an instance of Array 2479 PASS Intl.DateTimeFormat("sr", { hour: "numeric", minute: "numeric" }).formatToParts() is an instance of Array 2480 PASS Intl.DateTimeFormat("sv", { weekday: "short", year: "numeric", month: "short", day: "numeric", hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts() is an instance of Array 2481 PASS Intl.DateTimeFormat("sv", { weekday: "short", year: "numeric", month: "short", day: "numeric" }).formatToParts() is an instance of Array 2482 PASS Intl.DateTimeFormat("sv", { year: "numeric", month: "long", day: "numeric" }).formatToParts() is an instance of Array 2483 PASS Intl.DateTimeFormat("sv", { year: "numeric", month: "long" }).formatToParts() is an instance of Array 2484 PASS Intl.DateTimeFormat("sv", { month: "long", day: "numeric" }).formatToParts() is an instance of Array 2485 PASS Intl.DateTimeFormat("sv", { hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts() is an instance of Array 2486 PASS Intl.DateTimeFormat("sv", { hour: "numeric", minute: "numeric" }).formatToParts() is an instance of Array 2487 PASS Intl.DateTimeFormat("th", { weekday: "short", year: "numeric", month: "short", day: "numeric", hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts() is an instance of Array 2488 PASS Intl.DateTimeFormat("th", { weekday: "short", year: "numeric", month: "short", day: "numeric" }).formatToParts() is an instance of Array 2489 PASS Intl.DateTimeFormat("th", { year: "numeric", month: "long", day: "numeric" }).formatToParts() is an instance of Array 2490 PASS Intl.DateTimeFormat("th", { year: "numeric", month: "long" }).formatToParts() is an instance of Array 2491 PASS Intl.DateTimeFormat("th", { month: "long", day: "numeric" }).formatToParts() is an instance of Array 2492 PASS Intl.DateTimeFormat("th", { hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts() is an instance of Array 2493 PASS Intl.DateTimeFormat("th", { hour: "numeric", minute: "numeric" }).formatToParts() is an instance of Array 2494 PASS Intl.DateTimeFormat("tr", { weekday: "short", year: "numeric", month: "short", day: "numeric", hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts() is an instance of Array 2495 PASS Intl.DateTimeFormat("tr", { weekday: "short", year: "numeric", month: "short", day: "numeric" }).formatToParts() is an instance of Array 2496 PASS Intl.DateTimeFormat("tr", { year: "numeric", month: "long", day: "numeric" }).formatToParts() is an instance of Array 2497 PASS Intl.DateTimeFormat("tr", { year: "numeric", month: "long" }).formatToParts() is an instance of Array 2498 PASS Intl.DateTimeFormat("tr", { month: "long", day: "numeric" }).formatToParts() is an instance of Array 2499 PASS Intl.DateTimeFormat("tr", { hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts() is an instance of Array 2500 PASS Intl.DateTimeFormat("tr", { hour: "numeric", minute: "numeric" }).formatToParts() is an instance of Array 2501 PASS Intl.DateTimeFormat("uk", { weekday: "short", year: "numeric", month: "short", day: "numeric", hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts() is an instance of Array 2502 PASS Intl.DateTimeFormat("uk", { weekday: "short", year: "numeric", month: "short", day: "numeric" }).formatToParts() is an instance of Array 2503 PASS Intl.DateTimeFormat("uk", { year: "numeric", month: "long", day: "numeric" }).formatToParts() is an instance of Array 2504 PASS Intl.DateTimeFormat("uk", { year: "numeric", month: "long" }).formatToParts() is an instance of Array 2505 PASS Intl.DateTimeFormat("uk", { month: "long", day: "numeric" }).formatToParts() is an instance of Array 2506 PASS Intl.DateTimeFormat("uk", { hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts() is an instance of Array 2507 PASS Intl.DateTimeFormat("uk", { hour: "numeric", minute: "numeric" }).formatToParts() is an instance of Array 2508 PASS Intl.DateTimeFormat("vi", { weekday: "short", year: "numeric", month: "short", day: "numeric", hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts() is an instance of Array 2509 PASS Intl.DateTimeFormat("vi", { weekday: "short", year: "numeric", month: "short", day: "numeric" }).formatToParts() is an instance of Array 2510 PASS Intl.DateTimeFormat("vi", { year: "numeric", month: "long", day: "numeric" }).formatToParts() is an instance of Array 2511 PASS Intl.DateTimeFormat("vi", { year: "numeric", month: "long" }).formatToParts() is an instance of Array 2512 PASS Intl.DateTimeFormat("vi", { month: "long", day: "numeric" }).formatToParts() is an instance of Array 2513 PASS Intl.DateTimeFormat("vi", { hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts() is an instance of Array 2514 PASS Intl.DateTimeFormat("vi", { hour: "numeric", minute: "numeric" }).formatToParts() is an instance of Array 2515 PASS Intl.DateTimeFormat("zh", { weekday: "short", year: "numeric", month: "short", day: "numeric", hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts() is an instance of Array 2516 PASS Intl.DateTimeFormat("zh", { weekday: "short", year: "numeric", month: "short", day: "numeric" }).formatToParts() is an instance of Array 2517 PASS Intl.DateTimeFormat("zh", { year: "numeric", month: "long", day: "numeric" }).formatToParts() is an instance of Array 2518 PASS Intl.DateTimeFormat("zh", { year: "numeric", month: "long" }).formatToParts() is an instance of Array 2519 PASS Intl.DateTimeFormat("zh", { month: "long", day: "numeric" }).formatToParts() is an instance of Array 2520 PASS Intl.DateTimeFormat("zh", { hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts() is an instance of Array 2521 PASS Intl.DateTimeFormat("zh", { hour: "numeric", minute: "numeric" }).formatToParts() is an instance of Array 2522 PASS Intl.DateTimeFormat("zh-CN", { weekday: "short", year: "numeric", month: "short", day: "numeric", hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts() is an instance of Array 2523 PASS Intl.DateTimeFormat("zh-CN", { weekday: "short", year: "numeric", month: "short", day: "numeric" }).formatToParts() is an instance of Array 2524 PASS Intl.DateTimeFormat("zh-CN", { year: "numeric", month: "long", day: "numeric" }).formatToParts() is an instance of Array 2525 PASS Intl.DateTimeFormat("zh-CN", { year: "numeric", month: "long" }).formatToParts() is an instance of Array 2526 PASS Intl.DateTimeFormat("zh-CN", { month: "long", day: "numeric" }).formatToParts() is an instance of Array 2527 PASS Intl.DateTimeFormat("zh-CN", { hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts() is an instance of Array 2528 PASS Intl.DateTimeFormat("zh-CN", { hour: "numeric", minute: "numeric" }).formatToParts() is an instance of Array 2529 PASS Intl.DateTimeFormat("zh-Hant-HK", { weekday: "short", year: "numeric", month: "short", day: "numeric", hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts() is an instance of Array 2530 PASS Intl.DateTimeFormat("zh-Hant-HK", { weekday: "short", year: "numeric", month: "short", day: "numeric" }).formatToParts() is an instance of Array 2531 PASS Intl.DateTimeFormat("zh-Hant-HK", { year: "numeric", month: "long", day: "numeric" }).formatToParts() is an instance of Array 2532 PASS Intl.DateTimeFormat("zh-Hant-HK", { year: "numeric", month: "long" }).formatToParts() is an instance of Array 2533 PASS Intl.DateTimeFormat("zh-Hant-HK", { month: "long", day: "numeric" }).formatToParts() is an instance of Array 2534 PASS Intl.DateTimeFormat("zh-Hant-HK", { hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts() is an instance of Array 2535 PASS Intl.DateTimeFormat("zh-Hant-HK", { hour: "numeric", minute: "numeric" }).formatToParts() is an instance of Array 2536 PASS Intl.DateTimeFormat("zh-TW", { weekday: "short", year: "numeric", month: "short", day: "numeric", hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts() is an instance of Array 2537 PASS Intl.DateTimeFormat("zh-TW", { weekday: "short", year: "numeric", month: "short", day: "numeric" }).formatToParts() is an instance of Array 2538 PASS Intl.DateTimeFormat("zh-TW", { year: "numeric", month: "long", day: "numeric" }).formatToParts() is an instance of Array 2539 PASS Intl.DateTimeFormat("zh-TW", { year: "numeric", month: "long" }).formatToParts() is an instance of Array 2540 PASS Intl.DateTimeFormat("zh-TW", { month: "long", day: "numeric" }).formatToParts() is an instance of Array 2541 PASS Intl.DateTimeFormat("zh-TW", { hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts() is an instance of Array 2542 PASS Intl.DateTimeFormat("zh-TW", { hour: "numeric", minute: "numeric" }).formatToParts() is an instance of Array 2543 PASS JSON.stringify( 2544 Intl.DateTimeFormat('en-US', { 2545 hour: "numeric", minute: "numeric", second: "numeric", 2546 year: "numeric", month: "long", day: "numeric", weekday: "long", 2547 timeZoneName: "long", era: "long", timeZone: "UTC" 2548 }).formatToParts(0) 2549 ) is JSON.stringify([ 2550 {"type":"weekday","value":"Thursday"}, 2551 {"type":"literal","value":", "}, 2552 {"type":"month","value":"January"}, 2553 {"type":"literal","value":" "}, 2554 {"type":"day","value":"1"}, 2555 {"type":"literal","value":", "}, 2556 {"type":"year","value":"1970"}, 2557 {"type":"literal","value":" "}, 2558 {"type":"era","value":"Anno Domini"}, 2559 {"type":"literal","value":", "}, 2560 {"type":"hour","value":"12"}, 2561 {"type":"literal","value":":"}, 2562 {"type":"minute","value":"00"}, 2563 {"type":"literal","value":":"}, 2564 {"type":"second","value":"00"}, 2565 {"type":"literal","value":" "}, 2566 {"type":"dayPeriod","value":"AM"}, 2567 {"type":"literal","value":" "}, 2568 {"type":"timeZoneName","value":"GMT"} 2569 ]) 2158 2570 PASS successfullyParsed is true 2159 2571 -
trunk/LayoutTests/js/script-tests/intl-datetimeformat.js
r215526 r215616 515 515 shouldBe(legacyInit + "Intl.DateTimeFormat.call(legacy, 'en-u-nu-arab', { timeZone: 'America/Los_Angeles' }).format(1451099872641)", "'١٢/٢٥/٢٠١٥'"); 516 516 shouldNotBe("var incompat = {};Intl.DateTimeFormat.apply(incompat)", "incompat"); 517 518 // ECMA-402 4th edition 15.4 Intl.DateTimeFormat.prototype.formatToParts 519 shouldBeType("Intl.DateTimeFormat.prototype.formatToParts", "Function"); 520 shouldBe("Intl.DateTimeFormat.prototype.formatToParts.length", "0"); 521 shouldBeTrue("Object.getOwnPropertyDescriptor(Intl.DateTimeFormat.prototype, 'formatToParts').writable"); 522 shouldBeFalse("Object.getOwnPropertyDescriptor(Intl.DateTimeFormat.prototype, 'formatToParts').enumerable"); 523 shouldBeTrue("Object.getOwnPropertyDescriptor(Intl.DateTimeFormat.prototype, 'formatToParts').configurable"); 524 shouldBe("Object.getOwnPropertyDescriptor(Intl.DateTimeFormat.prototype, 'formatToParts').get", "undefined"); 525 shouldBe("Object.getOwnPropertyDescriptor(Intl.DateTimeFormat.prototype, 'formatToParts').set", "undefined"); 526 527 // Throws on non-finite or non-number 528 shouldThrow("new Intl.DateTimeFormat().formatToParts({})", "'RangeError: date value is not finite in DateTimeFormat formatToParts()'"); 529 shouldThrow("new Intl.DateTimeFormat().formatToParts(NaN)", "'RangeError: date value is not finite in DateTimeFormat formatToParts()'"); 530 shouldThrow("new Intl.DateTimeFormat().formatToParts(Infinity)", "'RangeError: date value is not finite in DateTimeFormat formatToParts()'"); 531 shouldThrow("new Intl.DateTimeFormat().formatToParts(-Infinity)", "'RangeError: date value is not finite in DateTimeFormat formatToParts()'"); 532 shouldThrow("new Intl.DateTimeFormat().formatToParts(new Date(NaN))", "'RangeError: date value is not finite in DateTimeFormat formatToParts()'"); 533 534 shouldBe(`JSON.stringify( 535 Intl.DateTimeFormat("pt-BR", { 536 hour: "numeric", minute: "numeric", second: "numeric", 537 year: "numeric", month: "numeric", day: "numeric", 538 timeZoneName: "short", era: "short", timeZone: "UTC" 539 }).formatToParts(0).filter((part) => (part.type !== "literal")) 540 )`, `JSON.stringify([ 541 {"type":"day","value":"1"}, 542 {"type":"month","value":"1"}, 543 {"type":"year","value":"1970"}, 544 {"type":"era","value":"d.C."}, 545 {"type":"hour","value":"00"}, 546 {"type":"minute","value":"00"}, 547 {"type":"second","value":"00"}, 548 {"type":"timeZoneName","value":"GMT"} 549 ])`); 550 551 for (let locale of localesSample) { 552 // The following subsets must be available for each locale: 553 // weekday, year, month, day, hour, minute, second 554 shouldBeType(`Intl.DateTimeFormat("${locale}", { weekday: "short", year: "numeric", month: "short", day: "numeric", hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts()`, "Array"); 555 // weekday, year, month, day 556 shouldBeType(`Intl.DateTimeFormat("${locale}", { weekday: "short", year: "numeric", month: "short", day: "numeric" }).formatToParts()`, "Array"); 557 // year, month, day 558 shouldBeType(`Intl.DateTimeFormat("${locale}", { year: "numeric", month: "long", day: "numeric" }).formatToParts()`, "Array"); 559 // year, month 560 shouldBeType(`Intl.DateTimeFormat("${locale}", { year: "numeric", month: "long" }).formatToParts()`, "Array"); 561 // month, day 562 shouldBeType(`Intl.DateTimeFormat("${locale}", { month: "long", day: "numeric" }).formatToParts()`, "Array"); 563 // hour, minute, second 564 shouldBeType(`Intl.DateTimeFormat("${locale}", { hour: "numeric", minute: "numeric", second: "numeric" }).formatToParts()`, "Array"); 565 // hour, minute 566 shouldBeType(`Intl.DateTimeFormat("${locale}", { hour: "numeric", minute: "numeric" }).formatToParts()`, "Array"); 567 } 568 569 // Exceed the 32 character default buffer size 570 shouldBe(`JSON.stringify( 571 Intl.DateTimeFormat('en-US', { 572 hour: "numeric", minute: "numeric", second: "numeric", 573 year: "numeric", month: "long", day: "numeric", weekday: "long", 574 timeZoneName: "long", era: "long", timeZone: "UTC" 575 }).formatToParts(0) 576 )`, `JSON.stringify([ 577 {"type":"weekday","value":"Thursday"}, 578 {"type":"literal","value":", "}, 579 {"type":"month","value":"January"}, 580 {"type":"literal","value":" "}, 581 {"type":"day","value":"1"}, 582 {"type":"literal","value":", "}, 583 {"type":"year","value":"1970"}, 584 {"type":"literal","value":" "}, 585 {"type":"era","value":"Anno Domini"}, 586 {"type":"literal","value":", "}, 587 {"type":"hour","value":"12"}, 588 {"type":"literal","value":":"}, 589 {"type":"minute","value":"00"}, 590 {"type":"literal","value":":"}, 591 {"type":"second","value":"00"}, 592 {"type":"literal","value":" "}, 593 {"type":"dayPeriod","value":"AM"}, 594 {"type":"literal","value":" "}, 595 {"type":"timeZoneName","value":"GMT"} 596 ])`) 597 -
trunk/Source/JavaScriptCore/ChangeLog
r215606 r215616 1 2017-04-21 Andy VanWagoner <thetalecrafter@gmail.com> 2 3 [INTL] Implement Intl.DateTimeFormat.prototype.formatToParts 4 https://bugs.webkit.org/show_bug.cgi?id=169458 5 6 Reviewed by JF Bastien. 7 8 Use udat_formatForFields to iterate through the parts of a formatted date string. 9 Make formatToParts and related functions dependent on ICU version >= 55. 10 11 * icu/unicode/udat.h: Update to 55.1. 12 * icu/unicode/ufieldpositer.h: Added from 55.1. 13 * icu/unicode/uvernum.h: Update to 55.1 14 * runtime/IntlDateTimeFormat.cpp: 15 (JSC::IntlDateTimeFormat::partTypeString): Convert UDateFormatField to string. 16 (JSC::IntlDateTimeFormat::formatToParts): Return parts of formatted date string. 17 * runtime/IntlDateTimeFormat.h: 18 * runtime/IntlDateTimeFormatPrototype.cpp: 19 (JSC::IntlDateTimeFormatPrototypeFuncFormatToParts): Add prototype function formatToParts. 20 1 21 2017-04-20 Konstantin Tokarev <annulen@yandex.ru> 2 22 -
trunk/Source/JavaScriptCore/icu/unicode/udat.h
r215526 r215616 1 1 /* 2 2 ******************************************************************************* 3 * Copyright (C) 1996-201 3, International Business Machines3 * Copyright (C) 1996-2015, International Business Machines 4 4 * Corporation and others. All Rights Reserved. 5 5 ******************************************************************************* … … 17 17 #include "unicode/unum.h" 18 18 #include "unicode/udisplaycontext.h" 19 #include "unicode/ufieldpositer.h" 19 20 /** 20 21 * \file … … 187 188 UDAT_PATTERN = -2, 188 189 190 #ifndef U_HIDE_INTERNAL_API 189 191 /** @internal alias to UDAT_PATTERN */ 190 192 UDAT_IGNORE = UDAT_PATTERN 193 #endif /* U_HIDE_INTERNAL_API */ 191 194 } UDateFormatStyle; 192 195 … … 198 201 */ 199 202 #define UDAT_YEAR "y" 200 #ifndef U_HIDE_DRAFT_API201 203 /** 202 204 * Constant for date skeleton with quarter. 203 * @ draftICU 51205 * @stable ICU 51 204 206 */ 205 207 #define UDAT_QUARTER "QQQQ" 206 208 /** 207 209 * Constant for date skeleton with abbreviated quarter. 208 * @ draftICU 51210 * @stable ICU 51 209 211 */ 210 212 #define UDAT_ABBR_QUARTER "QQQ" 211 #endif /* U_HIDE_DRAFT_API */212 213 /** 213 214 * Constant for date skeleton with year and quarter. … … 273 274 */ 274 275 #define UDAT_YEAR_NUM_MONTH_DAY "yMd" 275 #ifndef U_HIDE_DRAFT_API276 276 /** 277 277 * Constant for date skeleton with weekday. 278 * @ draftICU 51278 * @stable ICU 51 279 279 */ 280 280 #define UDAT_WEEKDAY "EEEE" 281 281 /** 282 282 * Constant for date skeleton with abbreviated weekday. 283 * @ draftICU 51283 * @stable ICU 51 284 284 */ 285 285 #define UDAT_ABBR_WEEKDAY "E" 286 #endif /* U_HIDE_DRAFT_API */287 286 /** 288 287 * Constant for date skeleton with year, month, weekday, and day. … … 347 346 */ 348 347 #define UDAT_HOUR "j" 349 #ifndef U_HIDE_DRAFT_API350 348 /** 351 349 * Constant for date skeleton with hour in 24-hour presentation. 352 * @ draftICU 51350 * @stable ICU 51 353 351 */ 354 352 #define UDAT_HOUR24 "H" 355 353 /** 356 354 * Constant for date skeleton with minute. 357 * @ draftICU 51355 * @stable ICU 51 358 356 */ 359 357 #define UDAT_MINUTE "m" 360 #endif /* U_HIDE_DRAFT_API */361 358 /** 362 359 * Constant for date skeleton with hour and minute, with the locale's preferred hour format (12 or 24). … … 371 368 */ 372 369 #define UDAT_HOUR24_MINUTE "Hm" 373 #ifndef U_HIDE_DRAFT_API374 370 /** 375 371 * Constant for date skeleton with second. 376 * @ draftICU 51372 * @stable ICU 51 377 373 */ 378 374 #define UDAT_SECOND "s" 379 #endif /* U_HIDE_DRAFT_API */380 375 /** 381 376 * Constant for date skeleton with hour, minute, and second, … … 401 396 /* Skeletons for time zones. */ 402 397 403 #ifndef U_HIDE_DRAFT_API404 398 /** 405 399 * Constant for <i>generic location format</i>, such as Los Angeles Time; … … 407 401 * @see <a href="http://unicode.org/reports/tr35/#Date_Format_Patterns">LDML Date Format Patterns</a> 408 402 * @see <a href="http://unicode.org/reports/tr35/#Time_Zone_Fallback">LDML Time Zone Fallback</a> 409 * @ draftICU 51403 * @stable ICU 51 410 404 */ 411 405 #define UDAT_LOCATION_TZ "VVVV" … … 415 409 * @see <a href="http://unicode.org/reports/tr35/#Date_Format_Patterns">LDML Date Format Patterns</a> 416 410 * @see <a href="http://unicode.org/reports/tr35/#Time_Zone_Fallback">LDML Time Zone Fallback</a> 417 * @ draftICU 51411 * @stable ICU 51 418 412 */ 419 413 #define UDAT_GENERIC_TZ "vvvv" … … 423 417 * @see <a href="http://unicode.org/reports/tr35/#Date_Format_Patterns">LDML Date Format Patterns</a> 424 418 * @see <a href="http://unicode.org/reports/tr35/#Time_Zone_Fallback">LDML Time Zone Fallback</a> 425 * @ draftICU 51419 * @stable ICU 51 426 420 */ 427 421 #define UDAT_ABBR_GENERIC_TZ "v" … … 431 425 * @see <a href="http://unicode.org/reports/tr35/#Date_Format_Patterns">LDML Date Format Patterns</a> 432 426 * @see <a href="http://unicode.org/reports/tr35/#Time_Zone_Fallback">LDML Time Zone Fallback</a> 433 * @ draftICU 51427 * @stable ICU 51 434 428 */ 435 429 #define UDAT_SPECIFIC_TZ "zzzz" … … 439 433 * @see <a href="http://unicode.org/reports/tr35/#Date_Format_Patterns">LDML Date Format Patterns</a> 440 434 * @see <a href="http://unicode.org/reports/tr35/#Time_Zone_Fallback">LDML Time Zone Fallback</a> 441 * @ draftICU 51435 * @stable ICU 51 442 436 */ 443 437 #define UDAT_ABBR_SPECIFIC_TZ "z" … … 447 441 * @see <a href="http://unicode.org/reports/tr35/#Date_Format_Patterns">LDML Date Format Patterns</a> 448 442 * @see <a href="http://unicode.org/reports/tr35/#Time_Zone_Fallback">LDML Time Zone Fallback</a> 449 * @ draftICU 51443 * @stable ICU 51 450 444 */ 451 445 #define UDAT_ABBR_UTC_TZ "ZZZZ" 452 #endif /* U_HIDE_DRAFT_API */453 446 454 447 /* deprecated skeleton constants */ … … 736 729 UDAT_YEAR_NAME_FIELD = 30, 737 730 738 #ifndef U_HIDE_DRAFT_API739 731 /** 740 732 * FieldPosition selector for 'O' field alignment, 741 733 * corresponding to the UCAL_ZONE_OFFSET and UCAL_DST_OFFSETfields. 742 734 * This displays the localized GMT format. 743 * @ draftICU 51735 * @stable ICU 51 744 736 */ 745 737 UDAT_TIMEZONE_LOCALIZED_GMT_OFFSET_FIELD = 31, … … 749 741 * corresponding to the UCAL_ZONE_OFFSET and UCAL_DST_OFFSETfields. 750 742 * This displays the ISO 8601 local time offset format or UTC indicator ("Z"). 751 * @ draftICU 51743 * @stable ICU 51 752 744 */ 753 745 UDAT_TIMEZONE_ISO_FIELD = 32, … … 755 747 /** 756 748 * FieldPosition selector for 'x' field alignment, 757 * corresponding to the UCAL_ZONE_OFFSET and UCAL_DST_OFFSET fields.749 * corresponding to the UCAL_ZONE_OFFSET and UCAL_DST_OFFSET fields. 758 750 * This displays the ISO 8601 local time offset format. 759 * @ draftICU 51751 * @stable ICU 51 760 752 */ 761 753 UDAT_TIMEZONE_ISO_LOCAL_FIELD = 33, 754 755 #ifndef U_HIDE_INTERNAL_API 756 /** 757 * FieldPosition and UFieldPosition selector for 'r' field alignment, 758 * no directly corresponding UCAL_ field. 759 * @internal ICU 53 760 */ 761 UDAT_RELATED_YEAR_FIELD = 34, 762 #endif /* U_HIDE_INTERNAL_API */ 763 764 #ifndef U_HIDE_DRAFT_API 765 /** 766 * FieldPosition and UFieldPosition selector for ':' time separator, 767 * no corresponding UCAL_ field. 768 * @draft ICU 55 769 */ 770 UDAT_TIME_SEPARATOR_FIELD = 35, 762 771 #endif /* U_HIDE_DRAFT_API */ 763 772 764 /**773 /** 765 774 * Number of FieldPosition and UFieldPosition selectors for 766 775 * DateFormat and UDateFormat. … … 770 779 * @stable ICU 3.0 771 780 */ 772 UDAT_FIELD_COUNT = 3 4781 UDAT_FIELD_COUNT = 36 773 782 774 783 } UDateFormatField; … … 838 847 /** 839 848 * DateFormat boolean attributes 840 * @internal ICU technology preview 849 * 850 * @stable ICU 53 841 851 */ 842 852 typedef enum UDateFormatBooleanAttribute { 843 /**853 /** 844 854 * indicates whether whitespace is allowed. Includes trailing dot tolerance. 845 * @ internal ICU technology preview846 */ 847 UDAT_PARSE_ALLOW_WHITESPACE ,855 * @stable ICU 53 856 */ 857 UDAT_PARSE_ALLOW_WHITESPACE = 0, 848 858 /** 849 859 * indicates tolerance of numeric data when String data may be assumed. eg: UDAT_YEAR_NAME_FIELD, 850 860 * UDAT_STANDALONE_MONTH_FIELD, UDAT_DAY_OF_WEEK_FIELD 851 * @internal ICU technology preview 852 */ 853 UDAT_PARSE_ALLOW_NUMERIC, 861 * @stable ICU 53 862 */ 863 UDAT_PARSE_ALLOW_NUMERIC = 1, 864 #ifndef U_HIDE_DRAFT_API 865 /** 866 * indicates tolerance of a partial literal match 867 * @draft ICU 53 868 */ 869 UDAT_PARSE_PARTIAL_MATCH = 2, 870 /** 871 * indicates tolerance of pattern mismatch between input data and specified format pattern. 872 * e.g. accepting "September" for a month pattern of MMM ("Sep") 873 * @draft ICU 53 874 */ 875 UDAT_PARSE_MULTIPLE_PATTERNS_FOR_MATCH = 3, 876 #endif /* U_HIDE_DRAFT_API */ 854 877 /** 855 878 * count boolean date format constants 856 * @ internal ICU technology preview857 */ 858 UDAT_BOOLEAN_ATTRIBUTE_COUNT 879 * @stable ICU 53 880 */ 881 UDAT_BOOLEAN_ATTRIBUTE_COUNT = 4 859 882 } UDateFormatBooleanAttribute; 860 883 861 #ifndef U_HIDE_INTERNAL_API862 884 /** 863 885 * Get a boolean attribute associated with a UDateFormat. … … 868 890 * @param status A pointer to an UErrorCode to receive any errors 869 891 * @return The value of attr. 870 * @ internal technology preview871 */ 872 U_ INTERNALUBool U_EXPORT2892 * @stable ICU 53 893 */ 894 U_STABLE UBool U_EXPORT2 873 895 udat_getBooleanAttribute(const UDateFormat* fmt, UDateFormatBooleanAttribute attr, UErrorCode* status); 874 896 … … 881 903 * @param newValue The new value of attr. 882 904 * @param status A pointer to an UErrorCode to receive any errors 883 * @internal ICU technology preview 884 */ 885 U_INTERNAL void U_EXPORT2 886 udat_setBooleanAttribute(UDateFormat *fmt, UDateFormatBooleanAttribute attr, UBool, UErrorCode* status); 887 888 #endif /* U_HIDE_INTERNAL_API */ 905 * @stable ICU 53 906 */ 907 U_STABLE void U_EXPORT2 908 udat_setBooleanAttribute(UDateFormat *fmt, UDateFormatBooleanAttribute attr, UBool newValue, UErrorCode* status); 889 909 890 910 … … 922 942 923 943 /** 924 * Format a date using a nUDateFormat.944 * Format a date using a UDateFormat. 925 945 * The date will be formatted using the conventions specified in {@link #udat_open } 926 946 * @param format The formatter to use … … 946 966 UFieldPosition* position, 947 967 UErrorCode* status); 968 969 #ifndef U_HIDE_DRAFT_API 970 /** 971 * Format a date using an UDateFormat. 972 * The date will be formatted using the conventions specified in {@link #udat_open } 973 * @param format The formatter to use 974 * @param calendar The calendar to format. The calendar instance might be 975 * mutated if fields are not yet fully calculated, though 976 * the function won't change the logical date and time held 977 * by the instance. 978 * @param result A pointer to a buffer to receive the formatted number. 979 * @param capacity The maximum size of result. 980 * @param position A pointer to a UFieldPosition. On input, position->field 981 * is read. On output, position->beginIndex and position->endIndex indicate 982 * the beginning and ending indices of field number position->field, if such 983 * a field exists. This parameter may be NULL, in which case no field 984 * position data is returned. 985 * @param status A pointer to an UErrorCode to receive any errors 986 * @return The total buffer size needed; if greater than resultLength, the output was truncated. 987 * @see udat_format 988 * @see udat_parseCalendar 989 * @see UFieldPosition 990 * @draft ICU 55 991 */ 992 U_DRAFT int32_t U_EXPORT2 993 udat_formatCalendar( const UDateFormat* format, 994 UCalendar* calendar, 995 UChar* result, 996 int32_t capacity, 997 UFieldPosition* position, 998 UErrorCode* status); 999 1000 /** 1001 * Format a date using a UDateFormat. 1002 * The date will be formatted using the conventions specified in {@link #udat_open} 1003 * @param format 1004 * The formatter to use 1005 * @param dateToFormat 1006 * The date to format 1007 * @param result 1008 * A pointer to a buffer to receive the formatted number. 1009 * @param resultLength 1010 * The maximum size of result. 1011 * @param fpositer 1012 * A pointer to a UFieldPositionIterator created by {@link #ufieldpositer_open} 1013 * (may be NULL if field position information is not needed). Any 1014 * iteration information already present in the UFieldPositionIterator 1015 * will be deleted, and the iterator will be reset to apply to the 1016 * fields in the formatted string created by this function call; the 1017 * field values provided by {@link #ufieldpositer_next} will be from the 1018 * UDateFormatField enum. 1019 * @param status 1020 * A pointer to a UErrorCode to receive any errors 1021 * @return 1022 * The total buffer size needed; if greater than resultLength, the output was truncated. 1023 * @see udat_parse 1024 * @see UFieldPositionIterator 1025 * @draft ICU 55 1026 */ 1027 U_DRAFT int32_t U_EXPORT2 1028 udat_formatForFields( const UDateFormat* format, 1029 UDate dateToFormat, 1030 UChar* result, 1031 int32_t resultLength, 1032 UFieldPositionIterator* fpositer, 1033 UErrorCode* status); 1034 1035 /** 1036 * Format a date using a UDateFormat. 1037 * The date will be formatted using the conventions specified in {@link #udat_open } 1038 * @param format 1039 * The formatter to use 1040 * @param calendar 1041 * The calendar to format. The calendar instance might be mutated if fields 1042 * are not yet fully calculated, though the function won't change the logical 1043 * date and time held by the instance. 1044 * @param result 1045 * A pointer to a buffer to receive the formatted number. 1046 * @param capacity 1047 * The maximum size of result. 1048 * @param fpositer 1049 * A pointer to a UFieldPositionIterator created by {@link #ufieldpositer_open} 1050 * (may be NULL if field position information is not needed). Any 1051 * iteration information already present in the UFieldPositionIterator 1052 * will be deleted, and the iterator will be reset to apply to the 1053 * fields in the formatted string created by this function call; the 1054 * field values provided by {@link #ufieldpositer_next} will be from the 1055 * UDateFormatField enum. 1056 * @param status 1057 * A pointer to a UErrorCode to receive any errors 1058 * @return 1059 * The total buffer size needed; if greater than resultLength, the output was truncated. 1060 * @see udat_format 1061 * @see udat_parseCalendar 1062 * @see UFieldPositionIterator 1063 * @draft ICU 55 1064 */ 1065 U_DRAFT int32_t U_EXPORT2 1066 udat_formatCalendarForFields( const UDateFormat* format, 1067 UCalendar* calendar, 1068 UChar* result, 1069 int32_t capacity, 1070 UFieldPositionIterator* fpositer, 1071 UErrorCode* status); 1072 1073 #endif /* U_HIDE_DRAFT_API */ 948 1074 949 1075 /** … … 1070 1196 udat_getNumberFormat(const UDateFormat* fmt); 1071 1197 1198 #ifndef U_HIDE_DRAFT_API 1199 /** 1200 * Get the UNumberFormat for specific field associated with an UDateFormat. 1201 * For example: 'y' for year and 'M' for month 1202 * @param fmt The formatter to query. 1203 * @param field the field to query 1204 * @return A pointer to the UNumberFormat used by fmt to format field numbers. 1205 * @see udat_setNumberFormatForField 1206 * @draft ICU 54 1207 */ 1208 U_DRAFT const UNumberFormat* U_EXPORT2 1209 udat_getNumberFormatForField(const UDateFormat* fmt, UChar field); 1210 1211 /** 1212 * Set the UNumberFormat for specific field associated with an UDateFormat. 1213 * It can be a single field like: "y"(year) or "M"(month) 1214 * It can be several field combined together: "yM"(year and month) 1215 * Note: 1216 * 1 symbol field is enough for multiple symbol field (so "y" will override "yy", "yyy") 1217 * If the field is not numeric, then override has no effect (like "MMM" will use abbreviation, not numerical field) 1218 * 1219 * @param fields the fields to set 1220 * @param fmt The formatter to set. 1221 * @param numberFormatToSet A pointer to the UNumberFormat to be used by fmt to format numbers. 1222 * @param status error code passed around (memory allocation or invalid fields) 1223 * @see udat_getNumberFormatForField 1224 * @draft ICU 54 1225 */ 1226 U_DRAFT void U_EXPORT2 1227 udat_adoptNumberFormatForFields( UDateFormat* fmt, 1228 const UChar* fields, 1229 UNumberFormat* numberFormatToSet, 1230 UErrorCode* status); 1231 #endif /* U_HIDE_DRAFT_API */ 1232 1072 1233 /** 1073 1234 * Set the UNumberFormat associated with an UDateFormat. 1074 1235 * A UDateFormat uses a UNumberFormat to format numbers within a date, 1075 1236 * for example the day number. 1237 * This method also clears per field NumberFormat instances previously 1238 * set by {@see udat_setNumberFormatForField} 1076 1239 * @param fmt The formatter to set. 1077 1240 * @param numberFormatToSet A pointer to the UNumberFormat to be used by fmt to format numbers. 1078 1241 * @see udat_getNumberFormat 1242 * @see udat_setNumberFormatForField 1079 1243 * @stable ICU 2.0 1080 1244 */ … … 1082 1246 udat_setNumberFormat( UDateFormat* fmt, 1083 1247 const UNumberFormat* numberFormatToSet); 1248 1249 #ifndef U_HIDE_DRAFT_API 1250 /** 1251 * Adopt the UNumberFormat associated with an UDateFormat. 1252 * A UDateFormat uses a UNumberFormat to format numbers within a date, 1253 * for example the day number. 1254 * @param fmt The formatter to set. 1255 * @param numberFormatToAdopt A pointer to the UNumberFormat to be used by fmt to format numbers. 1256 * @see udat_getNumberFormat 1257 * @draft ICU 54 1258 */ 1259 U_DRAFT void U_EXPORT2 1260 udat_adoptNumberFormat( UDateFormat* fmt, 1261 UNumberFormat* numberFormatToAdopt); 1262 #endif /* U_HIDE_DRAFT_API */ 1084 1263 1085 1264 /** … … 1218 1397 UDAT_STANDALONE_QUARTERS, 1219 1398 UDAT_STANDALONE_SHORT_QUARTERS, 1220 #ifndef U_HIDE_DRAFT_API1221 1399 /** 1222 1400 * The CLDR-style short weekday names, e.g. "Su", Mo", etc. … … 1224 1402 * above, which actually get the CLDR-style *abbreviated* versions of the 1225 1403 * corresponding names. 1226 * @ draftICU 511404 * @stable ICU 51 1227 1405 */ 1228 1406 UDAT_SHORTER_WEEKDAYS, 1229 1407 /** 1230 1408 * Standalone version of UDAT_SHORTER_WEEKDAYS. 1231 * @ draftICU 511409 * @stable ICU 51 1232 1410 */ 1233 1411 UDAT_STANDALONE_SHORTER_WEEKDAYS 1412 #ifndef U_HIDE_DRAFT_API 1413 , 1414 /** 1415 * Cyclic year names (only supported for some calendars, and only for FORMAT usage; 1416 * udat_setSymbols not supported for UDAT_CYCLIC_YEARS_WIDE) 1417 * @draft ICU 54 1418 */ 1419 UDAT_CYCLIC_YEARS_WIDE, 1420 /** 1421 * Cyclic year names (only supported for some calendars, and only for FORMAT usage) 1422 * @draft ICU 54 1423 */ 1424 UDAT_CYCLIC_YEARS_ABBREVIATED, 1425 /** 1426 * Cyclic year names (only supported for some calendars, and only for FORMAT usage; 1427 * udat_setSymbols not supported for UDAT_CYCLIC_YEARS_NARROW) 1428 * @draft ICU 54 1429 */ 1430 UDAT_CYCLIC_YEARS_NARROW, 1431 /** 1432 * Calendar zodiac names (only supported for some calendars, and only for FORMAT usage; 1433 * udat_setSymbols not supported for UDAT_ZODIAC_NAMES_WIDE) 1434 * @draft ICU 54 1435 */ 1436 UDAT_ZODIAC_NAMES_WIDE, 1437 /** 1438 * Calendar zodiac names (only supported for some calendars, and only for FORMAT usage) 1439 * @draft ICU 54 1440 */ 1441 UDAT_ZODIAC_NAMES_ABBREVIATED, 1442 /** 1443 * Calendar zodiac names (only supported for some calendars, and only for FORMAT usage; 1444 * udat_setSymbols not supported for UDAT_ZODIAC_NAMES_NARROW) 1445 * @draft ICU 54 1446 */ 1447 UDAT_ZODIAC_NAMES_NARROW 1234 1448 #endif /* U_HIDE_DRAFT_API */ 1235 1449 } UDateFormatSymbolType; … … 1319 1533 UErrorCode* status); 1320 1534 1321 #ifndef U_HIDE_DRAFT_API1322 1535 /** 1323 1536 * Set a particular UDisplayContext value in the formatter, such as … … 1326 1539 * @param value The UDisplayContext value to set. 1327 1540 * @param status A pointer to an UErrorCode to receive any errors 1328 * @ draftICU 511541 * @stable ICU 51 1329 1542 */ 1330 1543 U_DRAFT void U_EXPORT2 … … 1338 1551 * @param status A pointer to an UErrorCode to receive any errors 1339 1552 * @return The UDisplayContextValue for the specified type. 1340 * @draft ICU 51 1341 */ 1342 U_DRAFT UDisplayContext U_EXPORT2 1343 udat_getContext(UDateFormat* fmt, UDisplayContextType type, UErrorCode* status); 1344 1345 #endif /* U_HIDE_DRAFT_API */ 1553 * @stable ICU 53 1554 */ 1555 U_STABLE UDisplayContext U_EXPORT2 1556 udat_getContext(const UDateFormat* fmt, UDisplayContextType type, UErrorCode* status); 1346 1557 1347 1558 #ifndef U_HIDE_INTERNAL_API -
trunk/Source/JavaScriptCore/icu/unicode/uvernum.h
r196492 r215616 1 1 /* 2 2 ******************************************************************************* 3 * Copyright (C) 2000-201 3, International Business Machines3 * Copyright (C) 2000-2015, International Business Machines 4 4 * Corporation and others. All Rights Reserved. 5 5 ******************************************************************************* … … 52 52 */ 53 53 #define U_COPYRIGHT_STRING \ 54 " Copyright (C) 201 3, International Business Machines Corporation and others. All Rights Reserved. "54 " Copyright (C) 2015, International Business Machines Corporation and others. All Rights Reserved. " 55 55 56 56 /** The current ICU major version as an integer. … … 58 58 * @stable ICU 2.4 59 59 */ 60 #define U_ICU_VERSION_MAJOR_NUM 5 260 #define U_ICU_VERSION_MAJOR_NUM 55 61 61 62 62 /** The current ICU minor version as an integer. … … 84 84 * @stable ICU 2.6 85 85 */ 86 #define U_ICU_VERSION_SUFFIX _5 286 #define U_ICU_VERSION_SUFFIX _55 87 87 88 88 /** … … 119 119 * @stable ICU 2.4 120 120 */ 121 #define U_ICU_VERSION "5 2.1"121 #define U_ICU_VERSION "55.1" 122 122 123 123 /** The current ICU library major/minor version as a string without dots, for library name suffixes. … … 125 125 * @stable ICU 2.6 126 126 */ 127 #define U_ICU_VERSION_SHORT "5 2"127 #define U_ICU_VERSION_SHORT "55" 128 128 129 129 #ifndef U_HIDE_INTERNAL_API … … 131 131 * @internal ICU 4.4 Internal Use Only 132 132 **/ 133 #define U_ICU_DATA_VERSION "5 2.1"133 #define U_ICU_DATA_VERSION "55.1" 134 134 #endif /* U_HIDE_INTERNAL_API */ 135 135 … … 147 147 * @stable ICU 2.4 148 148 */ 149 #define UCOL_RUNTIME_VERSION 7149 #define UCOL_RUNTIME_VERSION 9 150 150 151 151 /** … … 156 156 * @stable ICU 2.4 157 157 */ 158 #define UCOL_BUILDER_VERSION 8158 #define UCOL_BUILDER_VERSION 9 159 159 160 #ifndef U_HIDE_DEPRECATED_API 160 161 /** 161 * This is the version of collation tailorings. 162 * This value may change in subsequent releases of ICU. 163 * @stable ICU 2.4 162 * Constant 1. 163 * This was intended to be the version of collation tailorings, 164 * but instead the tailoring data carries a version number. 165 * @deprecated ICU 54 164 166 */ 165 167 #define UCOL_TAILORINGS_VERSION 1 168 #endif /* U_HIDE_DEPRECATED_API */ 166 169 167 170 #endif -
trunk/Source/JavaScriptCore/runtime/CommonIdentifiers.h
r215429 r215616 212 212 macro(forEach) \ 213 213 macro(formatMatcher) \ 214 macro(formatToParts) \ 214 215 macro(forward) \ 215 216 macro(frames) \ -
trunk/Source/JavaScriptCore/runtime/IntlDateTimeFormat.cpp
r215526 r215616 42 42 #include <wtf/text/StringBuilder.h> 43 43 44 #if JSC_ICU_HAS_UFIELDPOSITER 45 #include <unicode/ufieldpositer.h> 46 #endif 47 44 48 namespace JSC { 45 49 … … 55 59 udat_close(dateFormat); 56 60 } 61 62 #if JSC_ICU_HAS_UFIELDPOSITER 63 void IntlDateTimeFormat::UFieldPositionIteratorDeleter::operator()(UFieldPositionIterator* iterator) const 64 { 65 if (iterator) 66 ufieldpositer_close(iterator); 67 } 68 #endif 57 69 58 70 IntlDateTimeFormat* IntlDateTimeFormat::create(VM& vm, Structure* structure) … … 892 904 } 893 905 906 #if JSC_ICU_HAS_UFIELDPOSITER 907 const char* IntlDateTimeFormat::partTypeString(UDateFormatField field) 908 { 909 switch (field) { 910 case UDAT_ERA_FIELD: 911 return "era"; 912 case UDAT_YEAR_FIELD: 913 case UDAT_YEAR_NAME_FIELD: 914 case UDAT_EXTENDED_YEAR_FIELD: 915 return "year"; 916 case UDAT_MONTH_FIELD: 917 case UDAT_STANDALONE_MONTH_FIELD: 918 return "month"; 919 case UDAT_DATE_FIELD: 920 return "day"; 921 case UDAT_HOUR_OF_DAY1_FIELD: 922 case UDAT_HOUR_OF_DAY0_FIELD: 923 case UDAT_HOUR1_FIELD: 924 case UDAT_HOUR0_FIELD: 925 return "hour"; 926 case UDAT_MINUTE_FIELD: 927 return "minute"; 928 case UDAT_SECOND_FIELD: 929 case UDAT_FRACTIONAL_SECOND_FIELD: 930 return "second"; 931 case UDAT_DAY_OF_WEEK_FIELD: 932 case UDAT_DOW_LOCAL_FIELD: 933 case UDAT_STANDALONE_DAY_FIELD: 934 return "weekday"; 935 case UDAT_AM_PM_FIELD: 936 return "dayPeriod"; 937 case UDAT_TIMEZONE_FIELD: 938 case UDAT_TIMEZONE_RFC_FIELD: 939 case UDAT_TIMEZONE_GENERIC_FIELD: 940 case UDAT_TIMEZONE_SPECIAL_FIELD: 941 case UDAT_TIMEZONE_LOCALIZED_GMT_OFFSET_FIELD: 942 case UDAT_TIMEZONE_ISO_FIELD: 943 case UDAT_TIMEZONE_ISO_LOCAL_FIELD: 944 return "timeZoneName"; 945 // These should not show up because there is no way to specify them in DateTimeFormat options. 946 // If they do, they don't fit well into any of known part types, so consider it a "literal". 947 case UDAT_DAY_OF_YEAR_FIELD: 948 case UDAT_DAY_OF_WEEK_IN_MONTH_FIELD: 949 case UDAT_WEEK_OF_YEAR_FIELD: 950 case UDAT_WEEK_OF_MONTH_FIELD: 951 case UDAT_YEAR_WOY_FIELD: 952 case UDAT_JULIAN_DAY_FIELD: 953 case UDAT_MILLISECONDS_IN_DAY_FIELD: 954 case UDAT_QUARTER_FIELD: 955 case UDAT_STANDALONE_QUARTER_FIELD: 956 case UDAT_RELATED_YEAR_FIELD: 957 case UDAT_TIME_SEPARATOR_FIELD: 958 case UDAT_FIELD_COUNT: 959 return "literal"; 960 } 961 // Any newer additions to the UDateFormatField enum should just be considered a "literal" part. 962 return "literal"; 963 } 964 965 966 JSValue IntlDateTimeFormat::formatToParts(ExecState& exec, double value) 967 { 968 VM& vm = exec.vm(); 969 auto scope = DECLARE_THROW_SCOPE(vm); 970 971 // 12.1.8 FormatDateTimeToParts (ECMA-402 4.0) 972 // https://tc39.github.io/ecma402/#sec-formatdatetimetoparts 973 974 if (!std::isfinite(value)) 975 return throwRangeError(&exec, scope, ASCIILiteral("date value is not finite in DateTimeFormat formatToParts()")); 976 977 UErrorCode status = U_ZERO_ERROR; 978 auto fields = std::unique_ptr<UFieldPositionIterator, UFieldPositionIteratorDeleter>(ufieldpositer_open(&status)); 979 if (U_FAILURE(status)) 980 return throwTypeError(&exec, scope, ASCIILiteral("failed to open field position iterator")); 981 982 status = U_ZERO_ERROR; 983 Vector<UChar, 32> result(32); 984 auto resultLength = udat_formatForFields(m_dateFormat.get(), value, result.data(), result.size(), fields.get(), &status); 985 if (status == U_BUFFER_OVERFLOW_ERROR) { 986 status = U_ZERO_ERROR; 987 result.grow(resultLength); 988 udat_formatForFields(m_dateFormat.get(), value, result.data(), resultLength, fields.get(), &status); 989 } 990 if (U_FAILURE(status)) 991 return throwTypeError(&exec, scope, ASCIILiteral("failed to format date value")); 992 993 JSGlobalObject* globalObject = exec.jsCallee()->globalObject(); 994 JSArray* parts = JSArray::tryCreate(vm, globalObject->arrayStructureForIndexingTypeDuringAllocation(ArrayWithContiguous), 0); 995 if (!parts) 996 return throwOutOfMemoryError(&exec, scope); 997 998 auto resultString = String(result.data(), resultLength); 999 auto typePropertyName = Identifier::fromString(&vm, "type"); 1000 auto literalString = jsString(&exec, ASCIILiteral("literal")); 1001 1002 int32_t previousEndIndex = 0; 1003 int32_t beginIndex = 0; 1004 int32_t endIndex = 0; 1005 while (previousEndIndex < resultLength) { 1006 auto fieldType = ufieldpositer_next(fields.get(), &beginIndex, &endIndex); 1007 if (fieldType < 0) 1008 beginIndex = endIndex = resultLength; 1009 1010 if (previousEndIndex < beginIndex) { 1011 auto value = jsString(&exec, resultString.substring(previousEndIndex, beginIndex - previousEndIndex)); 1012 JSObject* part = constructEmptyObject(&exec); 1013 part->putDirect(vm, typePropertyName, literalString); 1014 part->putDirect(vm, vm.propertyNames->value, value); 1015 parts->push(&exec, part); 1016 } 1017 previousEndIndex = endIndex; 1018 1019 if (fieldType >= 0) { 1020 auto type = jsString(&exec, partTypeString(UDateFormatField(fieldType))); 1021 auto value = jsString(&exec, resultString.substring(beginIndex, endIndex - beginIndex)); 1022 JSObject* part = constructEmptyObject(&exec); 1023 part->putDirect(vm, typePropertyName, type); 1024 part->putDirect(vm, vm.propertyNames->value, value); 1025 parts->push(&exec, part); 1026 } 1027 } 1028 1029 1030 return parts; 1031 } 1032 #endif 1033 894 1034 } // namespace JSC 895 1035 -
trunk/Source/JavaScriptCore/runtime/IntlDateTimeFormat.h
r215526 r215616 30 30 #include "JSDestructibleObject.h" 31 31 #include <unicode/udat.h> 32 #include <unicode/uvernum.h> 33 34 #if U_ICU_VERSION_MAJOR_NUM >= 55 35 #define JSC_ICU_HAS_UFIELDPOSITER 1 36 #endif 32 37 33 38 namespace JSC { … … 47 52 void initializeDateTimeFormat(ExecState&, JSValue locales, JSValue options); 48 53 JSValue format(ExecState&, double value); 54 #if JSC_ICU_HAS_UFIELDPOSITER 55 JSValue formatToParts(ExecState&, double value); 56 #endif 49 57 JSObject* resolvedOptions(ExecState&); 50 58 … … 102 110 Second m_second { Second::None }; 103 111 TimeZoneName m_timeZoneName { TimeZoneName::None }; 112 113 #if JSC_ICU_HAS_UFIELDPOSITER 114 struct UFieldPositionIteratorDeleter { 115 void operator()(UFieldPositionIterator*) const; 116 }; 117 118 static const char* partTypeString(UDateFormatField); 119 #endif 104 120 }; 105 121 -
trunk/Source/JavaScriptCore/runtime/IntlDateTimeFormatPrototype.cpp
r215526 r215616 42 42 43 43 static EncodedJSValue JSC_HOST_CALL IntlDateTimeFormatPrototypeGetterFormat(ExecState*); 44 #if JSC_ICU_HAS_UFIELDPOSITER 45 static EncodedJSValue JSC_HOST_CALL IntlDateTimeFormatPrototypeFuncFormatToParts(ExecState*); 46 #endif 44 47 static EncodedJSValue JSC_HOST_CALL IntlDateTimeFormatPrototypeFuncResolvedOptions(ExecState*); 45 48 … … 59 62 */ 60 63 61 IntlDateTimeFormatPrototype* IntlDateTimeFormatPrototype::create(VM& vm, JSGlobalObject* , Structure* structure)64 IntlDateTimeFormatPrototype* IntlDateTimeFormatPrototype::create(VM& vm, JSGlobalObject* globalObject, Structure* structure) 62 65 { 63 66 IntlDateTimeFormatPrototype* object = new (NotNull, allocateCell<IntlDateTimeFormatPrototype>(vm.heap)) IntlDateTimeFormatPrototype(vm, structure); 64 object->finishCreation(vm, structure);67 object->finishCreation(vm, globalObject, structure); 65 68 return object; 66 69 } … … 76 79 } 77 80 78 void IntlDateTimeFormatPrototype::finishCreation(VM& vm, Structure*)81 void IntlDateTimeFormatPrototype::finishCreation(VM& vm, JSGlobalObject* globalObject, Structure*) 79 82 { 80 83 Base::finishCreation(vm); 84 #if JSC_ICU_HAS_UFIELDPOSITER 85 JSFunction* formatToPartsFunction = JSFunction::create(vm, globalObject, 0, vm.propertyNames->formatToParts.string(), IntlDateTimeFormatPrototypeFuncFormatToParts); 86 putDirectWithoutTransition(vm, vm.propertyNames->formatToParts, formatToPartsFunction, DontEnum); 87 #else 88 UNUSED_PARAM(globalObject); 89 #endif 81 90 } 82 91 … … 148 157 } 149 158 159 #if JSC_ICU_HAS_UFIELDPOSITER 160 EncodedJSValue JSC_HOST_CALL IntlDateTimeFormatPrototypeFuncFormatToParts(ExecState* state) 161 { 162 VM& vm = state->vm(); 163 auto scope = DECLARE_THROW_SCOPE(vm); 164 165 // 15.4 Intl.DateTimeFormat.prototype.formatToParts (ECMA-402 4.0) 166 // https://tc39.github.io/ecma402/#sec-Intl.DateTimeFormat.prototype.formatToParts 167 168 IntlDateTimeFormat* dateTimeFormat = jsDynamicCast<IntlDateTimeFormat*>(vm, state->thisValue()); 169 if (!dateTimeFormat) 170 return JSValue::encode(throwTypeError(state, scope, ASCIILiteral("Intl.DateTimeFormat.prototype.formatToParts called on value that's not an object initialized as a DateTimeFormat"))); 171 172 JSValue date = state->argument(0); 173 double value; 174 175 if (date.isUndefined()) 176 value = JSValue::decode(dateNow(state)).toNumber(state); 177 else { 178 value = date.toNumber(state); 179 RETURN_IF_EXCEPTION(scope, encodedJSValue()); 180 } 181 182 scope.release(); 183 return JSValue::encode(dateTimeFormat->formatToParts(*state, value)); 184 } 185 #endif 186 150 187 EncodedJSValue JSC_HOST_CALL IntlDateTimeFormatPrototypeFuncResolvedOptions(ExecState* state) 151 188 { -
trunk/Source/JavaScriptCore/runtime/IntlDateTimeFormatPrototype.h
r215349 r215616 44 44 45 45 protected: 46 void finishCreation(VM&, Structure*);46 void finishCreation(VM&, JSGlobalObject*, Structure*); 47 47 48 48 private:
Note:
See TracChangeset
for help on using the changeset viewer.