Changeset 243512 in webkit
- Timestamp:
- Mar 26, 2019, 12:18:46 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/js/intl-datetimeformat-expected.txt (modified) (2 diffs)
-
LayoutTests/js/script-tests/intl-datetimeformat.js (modified) (2 diffs)
-
Source/JavaScriptCore/ChangeLog (modified) (1 diff)
-
Source/JavaScriptCore/runtime/IntlDateTimeFormat.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r243506 r243512 1 2019-03-26 Andy VanWagoner <andy@vanwagoner.family> 2 3 Intl.DateTimeFormat should obey 2-digit hour 4 https://bugs.webkit.org/show_bug.cgi?id=195974 5 6 Reviewed by Keith Miller. 7 8 * js/intl-datetimeformat-expected.txt: 9 * js/script-tests/intl-datetimeformat.js: 10 1 11 2019-03-26 Dean Jackson <dino@apple.com> 2 12 -
trunk/LayoutTests/js/intl-datetimeformat-expected.txt
r234475 r243512 311 311 PASS Intl.DateTimeFormat('en', { hour:[] }) threw exception RangeError: hour must be "2-digit" or "numeric". 312 312 PASS Intl.DateTimeFormat('en').resolvedOptions().hour is undefined 313 PASS Intl.DateTimeFormat('en', { minute:'2-digit', hour:'2-digit' }).resolvedOptions().hour is ' numeric'313 PASS Intl.DateTimeFormat('en', { minute:'2-digit', hour:'2-digit' }).resolvedOptions().hour is '2-digit' 314 314 PASS Intl.DateTimeFormat('en', { minute:'2-digit', hour:'2-digit', timeZone: 'UTC' }).format(0) is '12:00 AM' 315 315 PASS Intl.DateTimeFormat('en', { minute:'2-digit', hour:'numeric' }).resolvedOptions().hour is 'numeric' … … 321 321 PASS Intl.DateTimeFormat('pt-BR', { minute:'2-digit', hour:'numeric' }).resolvedOptions().hourCycle is 'h23' 322 322 PASS Intl.DateTimeFormat('pt-BR', { minute:'2-digit', hour:'numeric' }).resolvedOptions().hour12 is false 323 PASS Intl.DateTimeFormat('pt-BR', { minute:'2-digit', hour:'numeric', timeZone: 'UTC' }).format(0) is '00:00' 323 PASS Intl.DateTimeFormat('pt-BR', { minute:'2-digit', hour:'numeric', timeZone: 'UTC' }).format(0) is '0:00' 324 PASS Intl.DateTimeFormat('ru', { minute:'2-digit', hour:'2-digit', hour12: false, timeZone: 'UTC' }).format(0) is '00:00' 325 PASS Intl.DateTimeFormat('ru', { minute:'2-digit', hour:'2-digit', hour12: true, timeZone: 'UTC' }).format(1e7) is '02:46 ДП' 324 326 PASS Intl.DateTimeFormat('en', { minute: { toString() { throw 'minute' } } }) threw exception minute. 325 327 PASS Intl.DateTimeFormat('en', { minute:null }) threw exception RangeError: minute must be "2-digit" or "numeric". -
trunk/LayoutTests/js/script-tests/intl-datetimeformat.js
r234475 r243512 424 424 shouldThrow("Intl.DateTimeFormat('en', { hour:[] })", '\'RangeError: hour must be "2-digit" or "numeric"\''); 425 425 shouldBe("Intl.DateTimeFormat('en').resolvedOptions().hour", "undefined"); 426 shouldBe("Intl.DateTimeFormat('en', { minute:'2-digit', hour:'2-digit' }).resolvedOptions().hour", "' numeric'");426 shouldBe("Intl.DateTimeFormat('en', { minute:'2-digit', hour:'2-digit' }).resolvedOptions().hour", "'2-digit'"); 427 427 shouldBe("Intl.DateTimeFormat('en', { minute:'2-digit', hour:'2-digit', timeZone: 'UTC' }).format(0)", "'12:00 AM'"); 428 428 shouldBe("Intl.DateTimeFormat('en', { minute:'2-digit', hour:'numeric' }).resolvedOptions().hour", "'numeric'"); … … 435 435 shouldBe("Intl.DateTimeFormat('pt-BR', { minute:'2-digit', hour:'numeric' }).resolvedOptions().hourCycle", "'h23'"); 436 436 shouldBe("Intl.DateTimeFormat('pt-BR', { minute:'2-digit', hour:'numeric' }).resolvedOptions().hour12", "false"); 437 shouldBe("Intl.DateTimeFormat('pt-BR', { minute:'2-digit', hour:'numeric', timeZone: 'UTC' }).format(0)", "'00:00'"); 437 shouldBe("Intl.DateTimeFormat('pt-BR', { minute:'2-digit', hour:'numeric', timeZone: 'UTC' }).format(0)", "'0:00'"); 438 shouldBe("Intl.DateTimeFormat('ru', { minute:'2-digit', hour:'2-digit', hour12: false, timeZone: 'UTC' }).format(0)", "'00:00'"); 439 shouldBe("Intl.DateTimeFormat('ru', { minute:'2-digit', hour:'2-digit', hour12: true, timeZone: 'UTC' }).format(1e7)", "'02:46 ДП'"); 438 440 439 441 shouldThrow("Intl.DateTimeFormat('en', { minute: { toString() { throw 'minute' } } })", "'minute'"); -
trunk/Source/JavaScriptCore/ChangeLog
r243467 r243512 1 2019-03-26 Andy VanWagoner <andy@vanwagoner.family> 2 3 Intl.DateTimeFormat should obey 2-digit hour 4 https://bugs.webkit.org/show_bug.cgi?id=195974 5 6 Reviewed by Keith Miller. 7 8 * runtime/IntlDateTimeFormat.cpp: 9 (JSC::IntlDateTimeFormat::initializeDateTimeFormat): 10 1 11 2019-03-25 Yusuke Suzuki <ysuzuki@apple.com> 2 12 -
trunk/Source/JavaScriptCore/runtime/IntlDateTimeFormat.cpp
r243311 r243512 634 634 Vector<UChar, 32> patternBuffer(32); 635 635 status = U_ZERO_ERROR; 636 auto patternLength = udatpg_getBestPattern (generator, skeletonView.upconvertedCharacters(), skeletonView.length(), patternBuffer.data(), patternBuffer.size(), &status);636 auto patternLength = udatpg_getBestPatternWithOptions(generator, skeletonView.upconvertedCharacters(), skeletonView.length(), UDATPG_MATCH_HOUR_FIELD_LENGTH, patternBuffer.data(), patternBuffer.size(), &status); 637 637 if (status == U_BUFFER_OVERFLOW_ERROR) { 638 638 status = U_ZERO_ERROR;
Note:
See TracChangeset
for help on using the changeset viewer.