1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 package org.htmlunit.javascript.host.intl;
16
17 import org.apache.commons.lang3.CharUtils;
18 import org.htmlunit.WebDriverTestCase;
19 import org.htmlunit.junit.annotation.Alerts;
20 import org.htmlunit.junit.annotation.BuggyWebDriver;
21 import org.htmlunit.junit.annotation.HtmlUnitNYI;
22 import org.junit.jupiter.api.Test;
23 import org.opentest4j.AssertionFailedError;
24
25
26
27
28
29
30
31 public class DateTimeFormat2Test extends WebDriverTestCase {
32
33 private void test(final String... string) throws Exception {
34 final StringBuilder html = new StringBuilder(DOCTYPE_HTML
35 + "<html><head>\n"
36 + "<script>\n"
37 + LOG_TEXTAREA_FUNCTION
38 + " function test() {\n"
39 + " var date = new Date(Date.UTC(2013, 11, 20, 7, 0, 0));\n"
40 + " try {\n");
41 for (int i = 0; i < string.length - 1; i++) {
42 html.append(string[i]).append("\n");
43 }
44 html.append(
45 " log(" + string[string.length - 1] + ");\n"
46 + " } catch(e) { logEx(e) }\n"
47 + " }\n"
48 + "</script>\n"
49 + "</head><body onload='test()'>\n"
50 + LOG_TEXTAREA
51 + "</body></html>");
52
53 try {
54 loadPageVerifyTextArea2(html.toString());
55 }
56 catch (final AssertionFailedError e) {
57 final String msg = e.getMessage();
58 for (int i = 0; i < msg.length(); i++) {
59 final char c = msg.charAt(i);
60 if (CharUtils.isAscii(c)) {
61 System.out.print(c);
62 }
63 else {
64 System.out.print(CharUtils.unicodeEscaped(c));
65 }
66 }
67 System.out.println();
68 throw e;
69 }
70 }
71
72
73
74
75 @Test
76 @Alerts("[object Intl]")
77 public void intl() throws Exception {
78 test("Intl");
79 }
80
81
82
83
84 @Test
85 @Alerts("12/20/2013")
86 public void format_default() throws Exception {
87 test("new Intl.DateTimeFormat().format(date)");
88 }
89
90
91
92
93 @Test
94 @Alerts("H25/12/20")
95 public void format_ja_jp_u_ca_japanese() throws Exception {
96 test("new Intl.DateTimeFormat('ja-JP-u-ca-japanese').format(date)");
97 }
98
99
100
101
102
103
104 @Test
105 @Alerts("12/20/2013")
106 public void format_ban() throws Exception {
107 test("new Intl.DateTimeFormat('ban').format(date)");
108 }
109
110
111
112
113 @Test
114 @Alerts("20/12/2013")
115 public void format_id() throws Exception {
116 test("new Intl.DateTimeFormat('id').format(date)");
117 }
118
119
120
121
122
123
124 @Test
125 @Alerts("20/12/2013")
126 public void format_ban_id() throws Exception {
127 test("new Intl.DateTimeFormat(['ban', 'id']).format(date)");
128 }
129
130
131
132
133 @Test
134 @Alerts("Freitag, 20. Dezember 2013")
135 @HtmlUnitNYI(CHROME = "20.12.2013",
136 EDGE = "20.12.2013",
137 FF = "20.12.2013",
138 FF_ESR = "20.12.2013")
139 public void format_weekday_long() throws Exception {
140 test("var options = { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' };",
141 "new Intl.DateTimeFormat('de-DE', options).format(date)");
142 }
143
144
145
146
147 @Test
148 @Alerts("Freitag, 20. Dezember 2013 n. Chr. um 02:00:00")
149 @BuggyWebDriver(FF = "Freitag, 20. Dezember 2013 n. Chr. um 08:00:00",
150 FF_ESR = "Freitag, 20. Dezember 2013 n. Chr. um 08:00:00")
151 @HtmlUnitNYI(CHROME = "20.12.2013",
152 EDGE = "20.12.2013",
153 FF = "20.12.2013",
154 FF_ESR = "20.12.2013")
155 public void format_weekday_long_all() throws Exception {
156 test("var options = { weekday: 'long', era: 'long', year: 'numeric', month: 'long', day: 'numeric',"
157 + " hour: 'numeric', minute: 'numeric', second: 'numeric' };",
158 "new Intl.DateTimeFormat('de-DE', options).format(date)");
159 }
160
161
162
163
164 @Test
165 @Alerts("Freitag")
166 @HtmlUnitNYI(CHROME = "20.12.2013",
167 EDGE = "20.12.2013",
168 FF = "20.12.2013",
169 FF_ESR = "20.12.2013")
170 public void format_weekday_long_all_weekday() throws Exception {
171 test("var options = { weekday: 'long' };",
172 "new Intl.DateTimeFormat('de-DE', options).format(date)");
173 }
174
175
176
177
178 @Test
179 @Alerts("n. Chr. Freitag")
180 @HtmlUnitNYI(CHROME = "20.12.2013",
181 EDGE = "20.12.2013",
182 FF = "20.12.2013",
183 FF_ESR = "20.12.2013")
184 public void format_weekday_long_weekday_era() throws Exception {
185 test("var options = { weekday: 'long', era: 'long' };",
186 "new Intl.DateTimeFormat('de-DE', options).format(date)");
187 }
188
189
190
191
192 @Test
193 @Alerts("20.12.2013 n. Chr.")
194 @HtmlUnitNYI(CHROME = "20.12.2013",
195 EDGE = "20.12.2013",
196 FF = "20.12.2013",
197 FF_ESR = "20.12.2013")
198 public void format_weekday_long_era() throws Exception {
199 test("var options = { era: 'long' };",
200 "new Intl.DateTimeFormat('de-DE', options).format(date)");
201 }
202
203
204
205
206 @Test
207 @Alerts("2013 n. Chr. Freitag")
208 @HtmlUnitNYI(CHROME = "20.12.2013",
209 EDGE = "20.12.2013",
210 FF = "20.12.2013",
211 FF_ESR = "20.12.2013")
212 public void format_weekday_long_weekday_era_year() throws Exception {
213 test("var options = { weekday: 'long', era: 'long', year: 'numeric' };",
214 "new Intl.DateTimeFormat('de-DE', options).format(date)");
215 }
216
217
218
219
220 @Test
221 @Alerts("Dezember 2013 n. Chr. Freitag")
222 @HtmlUnitNYI(CHROME = "20.12.2013",
223 EDGE = "20.12.2013",
224 FF = "20.12.2013",
225 FF_ESR = "20.12.2013")
226 public void format_weekday_long_weekday_era_year_month() throws Exception {
227 test("var options = { weekday: 'long', era: 'long', year: 'numeric', month: 'long' };",
228 "new Intl.DateTimeFormat('de-DE', options).format(date)");
229 }
230
231
232
233
234 @Test
235 @Alerts(DEFAULT = "\u0627\u0644\u062c\u0645\u0639\u0629\u060c 20 \u062f\u064a\u0633\u0645\u0628\u0631 2013 "
236 + "\u0645\u064a\u0644\u0627\u062f\u064a \u0641\u064a 2:00:00 \u0635",
237 FF = "\u0627\u0644\u062c\u0645\u0639\u0629\u060c 20 \u062f\u064a\u0633\u0645\u0628\u0631 2013 "
238 + "\u0645\u064a\u0644\u0627\u062f\u064a \u0641\u064a 8:00:00 \u0635",
239 FF_ESR = "\u0627\u0644\u062c\u0645\u0639\u0629\u060c 20 \u062f\u064a\u0633\u0645\u0628\u0631 2013 "
240 + "\u0645\u064a\u0644\u0627\u062f\u064a \u0641\u064a 8:00:00 \u0635")
241 @HtmlUnitNYI(CHROME = "\u0662\u0660\u200f/\u0661\u0662\u200f/\u0662\u0660\u0661\u0663",
242 EDGE = "\u0662\u0660\u200f/\u0661\u0662\u200f/\u0662\u0660\u0661\u0663",
243 FF = "\u0662\u0660\u200f/\u0661\u0662\u200f/\u0662\u0660\u0661\u0663",
244 FF_ESR = "\u0662\u0660\u200f/\u0661\u0662\u200f/\u0662\u0660\u0661\u0663")
245 public void format_weekday_long_all_ar() throws Exception {
246 test("var options = { weekday: 'long', era: 'long', year: 'numeric', month: 'long', day: 'numeric',"
247 + " hour: 'numeric', minute: 'numeric', second: 'numeric' };",
248 "new Intl.DateTimeFormat('ar', options).format(date)");
249 }
250
251
252
253
254 @Test
255 @Alerts(CHROME = "Friday, December 20, 2013 at UTC",
256 EDGE = "Friday, December 20, 2013 at UTC",
257 FF = "Friday, December 20, 2013 at UTC",
258 FF_ESR = "Friday, December 20, 2013 at UTC")
259 @HtmlUnitNYI(CHROME = "12/20/2013",
260 EDGE = "12/20/2013",
261 FF = "12/20/2013",
262 FF_ESR = "12/20/2013")
263 public void format_utc_short() throws Exception {
264 test("var options = { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' };",
265 "options.timeZone = 'UTC';",
266 "options.timeZoneName = 'short';",
267 "new Intl.DateTimeFormat('en-US', options).format(date)");
268 }
269
270
271
272
273 @Test
274 @Alerts("2:00:00 am GMT-5")
275 @BuggyWebDriver(FF = "8:00:00 am GMT+1", FF_ESR = "8:00:00 am GMT+1")
276 @HtmlUnitNYI(CHROME = "20/12/2013",
277 EDGE = "20/12/2013",
278 FF = "20/12/2013",
279 FF_ESR = "20/12/2013")
280 public void format_detailed() throws Exception {
281 test("options = {",
282 " hour: 'numeric', minute: 'numeric', second: 'numeric',",
283 " timeZoneName: 'short'",
284 "};",
285 "new Intl.DateTimeFormat('en-AU', options).format(date)");
286 }
287
288
289
290
291 @Test
292 @Alerts("12/20/2013, 02:00:00")
293 @BuggyWebDriver(FF = "12/20/2013, 08:00:00", FF_ESR = "12/20/2013, 08:00:00")
294 @HtmlUnitNYI(CHROME = "12/20/2013",
295 EDGE = "12/20/2013",
296 FF = "12/20/2013",
297 FF_ESR = "12/20/2013")
298 public void format_detailed_24h() throws Exception {
299 test("var options = {",
300 " year: 'numeric', month: 'numeric', day: 'numeric',",
301 " hour: 'numeric', minute: 'numeric', second: 'numeric',",
302 " hour12: false",
303 "};",
304 "new Intl.DateTimeFormat('en-US', options).format(date)");
305 }
306
307
308
309
310 @Test
311 @Alerts("20\u200f/12\u200f/2013")
312 @HtmlUnitNYI(CHROME = "\u0662\u0660\u200f/\u0661\u0662\u200f/\u0662\u0660\u0661\u0663",
313 EDGE = "\u0662\u0660\u200f/\u0661\u0662\u200f/\u0662\u0660\u0661\u0663",
314 FF = "\u0662\u0660\u200f/\u0661\u0662\u200f/\u0662\u0660\u0661\u0663",
315 FF_ESR = "\u0662\u0660\u200f/\u0661\u0662\u200f/\u0662\u0660\u0661\u0663")
316 public void format_ar() throws Exception {
317 test("new Intl.DateTimeFormat('ar').format(date)");
318 }
319
320
321
322
323 @Test
324 @Alerts("20/12/2013")
325 @HtmlUnitNYI(CHROME = "\u0662\u0660\u200F/\u0661\u0662\u200F/\u0662\u0660\u0661\u0663",
326 EDGE = "\u0662\u0660\u200F/\u0661\u0662\u200F/\u0662\u0660\u0661\u0663",
327 FF = "\u0662\u0660\u200F/\u0661\u0662\u200F/\u0662\u0660\u0661\u0663",
328 FF_ESR = "\u0662\u0660\u200F/\u0661\u0662\u200F/\u0662\u0660\u0661\u0663")
329 public void format_ar_ae() throws Exception {
330 test("new Intl.DateTimeFormat('ar-AE').format(date)");
331 }
332
333
334
335
336 @Test
337 @Alerts("\u0662\u0660\u200F/\u0661\u0662\u200F/\u0662\u0660\u0661\u0663")
338 public void format_ar_bh() throws Exception {
339 test("new Intl.DateTimeFormat('ar-BH').format(date)");
340 }
341
342
343
344
345 @Test
346 @Alerts("20\u200F/12\u200F/2013")
347 public void format_ar_dz() throws Exception {
348 test("new Intl.DateTimeFormat('ar-DZ').format(date)");
349 }
350
351
352
353
354 @Test
355 @Alerts("\u0662\u0660\u200F/\u0661\u0662\u200F/\u0662\u0660\u0661\u0663")
356 public void format_ar_eg() throws Exception {
357 test("new Intl.DateTimeFormat('ar-EG').format(date)");
358 }
359
360
361
362
363 @Test
364 @Alerts("\u0662\u0660\u200F/\u0661\u0662\u200F/\u0662\u0660\u0661\u0663")
365 public void format_ar_iq() throws Exception {
366 test("new Intl.DateTimeFormat('ar-IQ').format(date)");
367 }
368
369
370
371
372 @Test
373 @Alerts("\u0662\u0660\u200F/\u0661\u0662\u200F/\u0662\u0660\u0661\u0663")
374 public void format_ar_jo() throws Exception {
375 test("new Intl.DateTimeFormat('ar-JO').format(date)");
376 }
377
378
379
380
381 @Test
382 @Alerts("\u0662\u0660\u200F/\u0661\u0662\u200F/\u0662\u0660\u0661\u0663")
383 public void format_ar_kw() throws Exception {
384 test("new Intl.DateTimeFormat('ar-KW').format(date)");
385 }
386
387
388
389
390 @Test
391 @Alerts("\u0662\u0660\u200F/\u0661\u0662\u200F/\u0662\u0660\u0661\u0663")
392 public void format_ar_lb() throws Exception {
393 test("new Intl.DateTimeFormat('ar-LB').format(date)");
394 }
395
396
397
398
399 @Test
400 @Alerts("20\u200F/12\u200F/2013")
401 public void format_ar_ly() throws Exception {
402 test("new Intl.DateTimeFormat('ar-LY').format(date)");
403 }
404
405
406
407
408 @Test
409 @Alerts("20\u200F/12\u200F/2013")
410 public void format_ar_ma() throws Exception {
411 test("new Intl.DateTimeFormat('ar-MA').format(date)");
412 }
413
414
415
416
417 @Test
418 @Alerts("\u0662\u0660\u200F/\u0661\u0662\u200F/\u0662\u0660\u0661\u0663")
419 public void format_ar_om() throws Exception {
420 test("new Intl.DateTimeFormat('ar-OM').format(date)");
421 }
422
423
424
425
426 @Test
427 @Alerts("\u0662\u0660\u200F/\u0661\u0662\u200F/\u0662\u0660\u0661\u0663")
428 public void format_ar_qa() throws Exception {
429 test("new Intl.DateTimeFormat('ar-QA').format(date)");
430 }
431
432
433
434
435 @Test
436 @Alerts("\u0662\u0660\u200f/\u0661\u0662\u200f/\u0662\u0660\u0661\u0663")
437 public void format_ar_sa() throws Exception {
438 test("new Intl.DateTimeFormat('ar-SA').format(date)");
439 }
440
441
442
443
444 @Test
445 @Alerts("\u0662\u0660\u200F/\u0661\u0662\u200F/\u0662\u0660\u0661\u0663")
446 public void format_ar_sd() throws Exception {
447 test("new Intl.DateTimeFormat('ar-SD').format(date)");
448 }
449
450
451
452
453 @Test
454 @Alerts("\u0662\u0660\u200F/\u0661\u0662\u200F/\u0662\u0660\u0661\u0663")
455 public void format_ar_sy() throws Exception {
456 test("new Intl.DateTimeFormat('ar-SY').format(date)");
457 }
458
459
460
461
462 @Test
463 @Alerts("20\u200F/12\u200F/2013")
464 public void format_ar_tn() throws Exception {
465 test("new Intl.DateTimeFormat('ar-TN').format(date)");
466 }
467
468
469
470
471 @Test
472 @Alerts("\u0662\u0660\u200F/\u0661\u0662\u200F/\u0662\u0660\u0661\u0663")
473 public void format_ar_ye() throws Exception {
474 test("new Intl.DateTimeFormat('ar-YE').format(date)");
475 }
476
477
478
479
480 @Test
481 @Alerts(DEFAULT = "20.12.2013",
482 CHROME = "12/20/2013",
483 EDGE = "12/20/2013")
484 public void format_be() throws Exception {
485 test("new Intl.DateTimeFormat('be').format(date)");
486 }
487
488
489
490
491 @Test
492 @Alerts(DEFAULT = "20.12.2013",
493 CHROME = "12/20/2013",
494 EDGE = "12/20/2013")
495 public void format_be_by() throws Exception {
496 test("new Intl.DateTimeFormat('be-BY').format(date)");
497 }
498
499
500
501
502 @Test
503 @Alerts("20.12.2013 \u0433.")
504 public void format_bg() throws Exception {
505 test("new Intl.DateTimeFormat('bg').format(date)");
506 }
507
508
509
510
511 @Test
512 @Alerts("20.12.2013 \u0433.")
513 public void format_bg_bg() throws Exception {
514 test("new Intl.DateTimeFormat('bg-BG').format(date)");
515 }
516
517
518
519
520 @Test
521 @Alerts("20/12/2013")
522 public void format_ca() throws Exception {
523 test("new Intl.DateTimeFormat('ca').format(date)");
524 }
525
526
527
528
529 @Test
530 @Alerts("20/12/2013")
531 public void format_ca_es() throws Exception {
532 test("new Intl.DateTimeFormat('ca-ES').format(date)");
533 }
534
535
536
537
538 @Test
539 @Alerts("20. 12. 2013")
540 public void format_cs() throws Exception {
541 test("new Intl.DateTimeFormat('cs').format(date)");
542 }
543
544
545
546
547 @Test
548 @Alerts("20. 12. 2013")
549 public void format_cs_cz() throws Exception {
550 test("new Intl.DateTimeFormat('cs-CZ').format(date)");
551 }
552
553
554
555
556 @Test
557 @Alerts("20.12.2013")
558 public void format_da() throws Exception {
559 test("new Intl.DateTimeFormat('da').format(date)");
560 }
561
562
563
564
565 @Test
566 @Alerts("20.12.2013")
567 public void format_da_dk() throws Exception {
568 test("new Intl.DateTimeFormat('da-DK').format(date)");
569 }
570
571
572
573
574 @Test
575 @Alerts("20.12.2013")
576 public void format_de() throws Exception {
577 test("new Intl.DateTimeFormat('de').format(date)");
578 }
579
580
581
582
583 @Test
584 @Alerts("20.12.2013")
585 public void format_de_at() throws Exception {
586 test("new Intl.DateTimeFormat('de-AT').format(date)");
587 }
588
589
590
591
592 @Test
593 @Alerts("20.12.2013")
594 public void format_de_ch() throws Exception {
595 test("new Intl.DateTimeFormat('de-CH').format(date)");
596 }
597
598
599
600
601 @Test
602 @Alerts("20.12.2013")
603 public void format_de_de() throws Exception {
604 test("new Intl.DateTimeFormat('de-DE').format(date)");
605 }
606
607
608
609
610 @Test
611 @Alerts("20.12.2013")
612 public void format_de_lu() throws Exception {
613 test("new Intl.DateTimeFormat('de-LU').format(date)");
614 }
615
616
617
618
619 @Test
620 @Alerts("20/12/2013")
621 public void format_el() throws Exception {
622 test("new Intl.DateTimeFormat('el').format(date)");
623 }
624
625
626
627
628 @Test
629 @Alerts("20/12/2013")
630 public void format_el_cy() throws Exception {
631 test("new Intl.DateTimeFormat('el-CY').format(date)");
632 }
633
634
635
636
637 @Test
638 @Alerts("20/12/2013")
639 public void format_el_gr() throws Exception {
640 test("new Intl.DateTimeFormat('el-GR').format(date)");
641 }
642
643
644
645
646 @Test
647 @Alerts("12/20/2013")
648 public void format_en() throws Exception {
649 test("new Intl.DateTimeFormat('en').format(date)");
650 }
651
652
653
654
655 @Test
656 @Alerts("20/12/2013")
657 public void format_en_au() throws Exception {
658 test("new Intl.DateTimeFormat('en-AU').format(date)");
659 }
660
661
662
663
664 @Test
665 @Alerts("2013-12-20")
666 public void format_en_ca() throws Exception {
667 test("new Intl.DateTimeFormat('en-CA').format(date)");
668 }
669
670
671
672
673 @Test
674 @Alerts("20/12/2013")
675 public void format_en_gb() throws Exception {
676 test("new Intl.DateTimeFormat('en-GB').format(date)");
677 }
678
679
680
681
682 @Test
683 @Alerts("20/12/2013")
684 public void format_en_ie() throws Exception {
685 test("new Intl.DateTimeFormat('en-IE').format(date)");
686 }
687
688
689
690
691 @Test
692 @Alerts("20/12/2013")
693 public void format_en_in() throws Exception {
694 test("new Intl.DateTimeFormat('en-IN').format(date)");
695 }
696
697
698
699
700 @Test
701 @Alerts("20/12/2013")
702 public void format_en_mt() throws Exception {
703 test("new Intl.DateTimeFormat('en-MT').format(date)");
704 }
705
706
707
708
709 @Test
710 @Alerts("20/12/2013")
711 public void format_en_nz() throws Exception {
712 test("new Intl.DateTimeFormat('en-NZ').format(date)");
713 }
714
715
716
717
718 @Test
719 @Alerts("12/20/2013")
720 public void format_en_ph() throws Exception {
721 test("new Intl.DateTimeFormat('en-PH').format(date)");
722 }
723
724
725
726
727 @Test
728 @Alerts("20/12/2013")
729 public void format_en_sg() throws Exception {
730 test("new Intl.DateTimeFormat('en-SG').format(date)");
731 }
732
733
734
735
736 @Test
737 @Alerts("12/20/2013")
738 public void format_en_us() throws Exception {
739 test("new Intl.DateTimeFormat('en-US').format(date)");
740 }
741
742
743
744
745 @Test
746 @Alerts("2013/12/20")
747 public void format_en_za() throws Exception {
748 test("new Intl.DateTimeFormat('en-ZA').format(date)");
749 }
750
751
752
753
754 @Test
755 @Alerts("20/12/2013")
756 public void format_es() throws Exception {
757 test("new Intl.DateTimeFormat('es').format(date)");
758 }
759
760
761
762
763 @Test
764 @Alerts("20/12/2013")
765 public void format_es_ar() throws Exception {
766 test("new Intl.DateTimeFormat('es-AR').format(date)");
767 }
768
769
770
771
772 @Test
773 @Alerts("20/12/2013")
774 public void format_es_bo() throws Exception {
775 test("new Intl.DateTimeFormat('es-BO').format(date)");
776 }
777
778
779
780
781 @Test
782 @Alerts("20-12-2013")
783 public void format_es_cl() throws Exception {
784 test("new Intl.DateTimeFormat('es-CL').format(date)");
785 }
786
787
788
789
790 @Test
791 @Alerts("20/12/2013")
792 public void format_es_co() throws Exception {
793 test("new Intl.DateTimeFormat('es-CO').format(date)");
794 }
795
796
797
798
799 @Test
800 @Alerts("20/12/2013")
801 public void format_es_cr() throws Exception {
802 test("new Intl.DateTimeFormat('es-CR').format(date)");
803 }
804
805
806
807
808 @Test
809 @Alerts("20/12/2013")
810 public void format_es_do() throws Exception {
811 test("new Intl.DateTimeFormat('es-DO').format(date)");
812 }
813
814
815
816
817 @Test
818 @Alerts("20/12/2013")
819 public void format_es_ec() throws Exception {
820 test("new Intl.DateTimeFormat('es-EC').format(date)");
821 }
822
823
824
825
826 @Test
827 @Alerts("20/12/2013")
828 public void format_es_es() throws Exception {
829 test("new Intl.DateTimeFormat('es-ES').format(date)");
830 }
831
832
833
834
835 @Test
836 @Alerts("20/12/2013")
837 public void format_es_gt() throws Exception {
838 test("new Intl.DateTimeFormat('es-GT').format(date)");
839 }
840
841
842
843
844 @Test
845 @Alerts("20/12/2013")
846 public void format_es_hn() throws Exception {
847 test("new Intl.DateTimeFormat('es-HN').format(date)");
848 }
849
850
851
852
853 @Test
854 @Alerts("20/12/2013")
855 public void format_es_mx() throws Exception {
856 test("new Intl.DateTimeFormat('es-MX').format(date)");
857 }
858
859
860
861
862 @Test
863 @Alerts("20/12/2013")
864 public void format_es_ni() throws Exception {
865 test("new Intl.DateTimeFormat('es-NI').format(date)");
866 }
867
868
869
870
871 @Test
872 @Alerts("12/20/2013")
873 public void format_es_pa() throws Exception {
874 test("new Intl.DateTimeFormat('es-PA').format(date)");
875 }
876
877
878
879
880 @Test
881 @Alerts("20/12/2013")
882 public void format_es_pe() throws Exception {
883 test("new Intl.DateTimeFormat('es-PE').format(date)");
884 }
885
886
887
888
889 @Test
890 @Alerts("12/20/2013")
891 public void format_es_pr() throws Exception {
892 test("new Intl.DateTimeFormat('es-PR').format(date)");
893 }
894
895
896
897
898 @Test
899 @Alerts("20/12/2013")
900 public void format_es_py() throws Exception {
901 test("new Intl.DateTimeFormat('es-PY').format(date)");
902 }
903
904
905
906
907 @Test
908 @Alerts("20/12/2013")
909 public void format_es_sv() throws Exception {
910 test("new Intl.DateTimeFormat('es-SV').format(date)");
911 }
912
913
914
915
916 @Test
917 @Alerts("20/12/2013")
918 public void format_es_us() throws Exception {
919 test("new Intl.DateTimeFormat('es-US').format(date)");
920 }
921
922
923
924
925 @Test
926 @Alerts("20/12/2013")
927 public void format_es_uy() throws Exception {
928 test("new Intl.DateTimeFormat('es-UY').format(date)");
929 }
930
931
932
933
934 @Test
935 @Alerts("20/12/2013")
936 public void format_es_ve() throws Exception {
937 test("new Intl.DateTimeFormat('es-VE').format(date)");
938 }
939
940
941
942
943 @Test
944 @Alerts("20.12.2013")
945 public void format_et() throws Exception {
946 test("new Intl.DateTimeFormat('et').format(date)");
947 }
948
949
950
951
952 @Test
953 @Alerts("20.12.2013")
954 public void format_et_ee() throws Exception {
955 test("new Intl.DateTimeFormat('et-EE').format(date)");
956 }
957
958
959
960
961 @Test
962 @Alerts("20.12.2013")
963 public void format_fi() throws Exception {
964 test("new Intl.DateTimeFormat('fi').format(date)");
965 }
966
967
968
969
970 @Test
971 @Alerts("20.12.2013")
972 public void format_fi_fi() throws Exception {
973 test("new Intl.DateTimeFormat('fi-FI').format(date)");
974 }
975
976
977
978
979 @Test
980 @Alerts("20/12/2013")
981 public void format_fr() throws Exception {
982 test("new Intl.DateTimeFormat('fr').format(date)");
983 }
984
985
986
987
988 @Test
989 @Alerts("20/12/2013")
990 public void format_fr_be() throws Exception {
991 test("new Intl.DateTimeFormat('fr-BE').format(date)");
992 }
993
994
995
996
997 @Test
998 @Alerts("2013-12-20")
999 public void format_fr_ca() throws Exception {
1000 test("new Intl.DateTimeFormat('fr-CA').format(date)");
1001 }
1002
1003
1004
1005
1006 @Test
1007 @Alerts("20.12.2013")
1008 public void format_fr_ch() throws Exception {
1009 test("new Intl.DateTimeFormat('fr-CH').format(date)");
1010 }
1011
1012
1013
1014
1015 @Test
1016 @Alerts("20/12/2013")
1017 public void format_fr_fr() throws Exception {
1018 test("new Intl.DateTimeFormat('fr-FR').format(date)");
1019 }
1020
1021
1022
1023
1024 @Test
1025 @Alerts("20/12/2013")
1026 public void format_fr_lu() throws Exception {
1027 test("new Intl.DateTimeFormat('fr-LU').format(date)");
1028 }
1029
1030
1031
1032
1033 @Test
1034 @Alerts(DEFAULT = "20/12/2013",
1035 CHROME = "12/20/2013",
1036 EDGE = "12/20/2013")
1037 public void format_ga() throws Exception {
1038 test("new Intl.DateTimeFormat('ga').format(date)");
1039 }
1040
1041
1042
1043
1044 @Test
1045 @Alerts(DEFAULT = "20/12/2013",
1046 CHROME = "12/20/2013",
1047 EDGE = "12/20/2013")
1048 public void format_ga_ie() throws Exception {
1049 test("new Intl.DateTimeFormat('ga-IE').format(date)");
1050 }
1051
1052
1053
1054
1055 @Test
1056 @Alerts("20/12/2013")
1057 public void format_hi_in() throws Exception {
1058 test("new Intl.DateTimeFormat('hi-IN').format(date)");
1059 }
1060
1061
1062
1063
1064 @Test
1065 @Alerts("20. 12. 2013.")
1066 public void format_hr() throws Exception {
1067 test("new Intl.DateTimeFormat('hr').format(date)");
1068 }
1069
1070
1071
1072
1073 @Test
1074 @Alerts("20. 12. 2013.")
1075 public void format_hr_hr() throws Exception {
1076 test("new Intl.DateTimeFormat('hr-HR').format(date)");
1077 }
1078
1079
1080
1081
1082 @Test
1083 @Alerts("2013. 12. 20.")
1084 public void format_hu() throws Exception {
1085 test("new Intl.DateTimeFormat('hu').format(date)");
1086 }
1087
1088
1089
1090
1091 @Test
1092 @Alerts("2013. 12. 20.")
1093 public void format_hu_hu() throws Exception {
1094 test("new Intl.DateTimeFormat('hu-HU').format(date)");
1095 }
1096
1097
1098
1099
1100 @Test
1101 @Alerts("20/12/2013")
1102 public void format_in() throws Exception {
1103 test("new Intl.DateTimeFormat('in').format(date)");
1104 }
1105
1106
1107
1108
1109 @Test
1110 @Alerts("20/12/2013")
1111 public void format_in_id() throws Exception {
1112 test("new Intl.DateTimeFormat('in-ID').format(date)");
1113 }
1114
1115
1116
1117
1118 @Test
1119 @Alerts(DEFAULT = "20.12.2013",
1120 CHROME = "12/20/2013",
1121 EDGE = "12/20/2013")
1122 public void format_is() throws Exception {
1123 test("new Intl.DateTimeFormat('is').format(date)");
1124 }
1125
1126
1127
1128
1129 @Test
1130 @Alerts(DEFAULT = "20.12.2013",
1131 CHROME = "12/20/2013",
1132 EDGE = "12/20/2013")
1133 public void format_is_is() throws Exception {
1134 test("new Intl.DateTimeFormat('is-IS').format(date)");
1135 }
1136
1137
1138
1139
1140 @Test
1141 @Alerts("20/12/2013")
1142 public void format_it() throws Exception {
1143 test("new Intl.DateTimeFormat('it').format(date)");
1144 }
1145
1146
1147
1148
1149 @Test
1150 @Alerts("20/12/2013")
1151 public void format_it_ch() throws Exception {
1152 test("new Intl.DateTimeFormat('it-CH').format(date)");
1153 }
1154
1155
1156
1157
1158 @Test
1159 @Alerts("20/12/2013")
1160 public void format_it_it() throws Exception {
1161 test("new Intl.DateTimeFormat('it-IT').format(date)");
1162 }
1163
1164
1165
1166
1167 @Test
1168 @Alerts("20.12.2013")
1169 public void format_iw() throws Exception {
1170 test("new Intl.DateTimeFormat('iw').format(date)");
1171 }
1172
1173
1174
1175
1176 @Test
1177 @Alerts("20.12.2013")
1178 public void format_iw_il() throws Exception {
1179 test("new Intl.DateTimeFormat('iw-IL').format(date)");
1180 }
1181
1182
1183
1184
1185 @Test
1186 @Alerts("2013/12/20")
1187 public void format_ja() throws Exception {
1188 test("new Intl.DateTimeFormat('ja').format(date)");
1189 }
1190
1191
1192
1193
1194 @Test
1195 @Alerts("2013/12/20")
1196 public void format_ja_jp() throws Exception {
1197 test("new Intl.DateTimeFormat('ja-JP').format(date)");
1198 }
1199
1200
1201
1202
1203 @Test
1204 @Alerts("2013. 12. 20.")
1205 public void format_ko() throws Exception {
1206 test("new Intl.DateTimeFormat('ko').format(date)");
1207 }
1208
1209
1210
1211
1212 @Test
1213 @Alerts("2013. 12. 20.")
1214 public void format_ko_kr() throws Exception {
1215 test("new Intl.DateTimeFormat('ko-KR').format(date)");
1216 }
1217
1218
1219
1220
1221 @Test
1222 @Alerts("2013-12-20")
1223 public void format_lt() throws Exception {
1224 test("new Intl.DateTimeFormat('lt').format(date)");
1225 }
1226
1227
1228
1229
1230 @Test
1231 @Alerts("2013-12-20")
1232 public void format_lt_lt() throws Exception {
1233 test("new Intl.DateTimeFormat('lt-LT').format(date)");
1234 }
1235
1236
1237
1238
1239 @Test
1240 @Alerts("20.12.2013.")
1241 public void format_lv() throws Exception {
1242 test("new Intl.DateTimeFormat('lv').format(date)");
1243 }
1244
1245
1246
1247
1248 @Test
1249 @Alerts("20.12.2013.")
1250 public void format_lv_lv() throws Exception {
1251 test("new Intl.DateTimeFormat('lv-LV').format(date)");
1252 }
1253
1254
1255
1256
1257 @Test
1258 @Alerts(DEFAULT = "12/20/2013",
1259 FF = "20.12.2013 \u0433.",
1260 FF_ESR = "20.12.2013 \u0433.")
1261 public void format_mk() throws Exception {
1262 test("new Intl.DateTimeFormat('mk').format(date)");
1263 }
1264
1265
1266
1267
1268 @Test
1269 @Alerts(DEFAULT = "12/20/2013",
1270 FF = "20.12.2013 \u0433.",
1271 FF_ESR = "20.12.2013 \u0433.")
1272 public void format_mk_mk() throws Exception {
1273 test("new Intl.DateTimeFormat('mk-MK').format(date)");
1274 }
1275
1276
1277
1278
1279 @Test
1280 @Alerts("20/12/2013")
1281 public void format_ms() throws Exception {
1282 test("new Intl.DateTimeFormat('ms').format(date)");
1283 }
1284
1285
1286
1287
1288 @Test
1289 @Alerts("20/12/2013")
1290 public void format_ms_my() throws Exception {
1291 test("new Intl.DateTimeFormat('ms-MY').format(date)");
1292 }
1293
1294
1295
1296
1297 @Test
1298 @Alerts("12/20/2013")
1299 public void format_mt() throws Exception {
1300 test("new Intl.DateTimeFormat('mt').format(date)");
1301 }
1302
1303
1304
1305
1306 @Test
1307 @Alerts("12/20/2013")
1308 public void format_mt_mt() throws Exception {
1309 test("new Intl.DateTimeFormat('mt-MT').format(date)");
1310 }
1311
1312
1313
1314
1315 @Test
1316 @Alerts("20-12-2013")
1317 public void format_nl() throws Exception {
1318 test("new Intl.DateTimeFormat('nl').format(date)");
1319 }
1320
1321
1322
1323
1324 @Test
1325 @Alerts("20/12/2013")
1326 public void format_nl_be() throws Exception {
1327 test("new Intl.DateTimeFormat('nl-BE').format(date)");
1328 }
1329
1330
1331
1332
1333 @Test
1334 @Alerts("20-12-2013")
1335 public void format_nl_nl() throws Exception {
1336 test("new Intl.DateTimeFormat('nl-NL').format(date)");
1337 }
1338
1339
1340
1341
1342 @Test
1343 @Alerts("20.12.2013")
1344 public void format_no() throws Exception {
1345 test("new Intl.DateTimeFormat('no').format(date)");
1346 }
1347
1348
1349
1350
1351 @Test
1352 @Alerts("20.12.2013")
1353 public void format_no_no() throws Exception {
1354 test("new Intl.DateTimeFormat('no-NO').format(date)");
1355 }
1356
1357
1358
1359
1360 @Test
1361 @Alerts("RangeError")
1362 public void format_no_no_ny() throws Exception {
1363 test("new Intl.DateTimeFormat('no-NO-NY').format(date)");
1364 }
1365
1366
1367
1368
1369 @Test
1370 @Alerts("20.12.2013")
1371 public void format_pl() throws Exception {
1372 test("new Intl.DateTimeFormat('pl').format(date)");
1373 }
1374
1375
1376
1377
1378 @Test
1379 @Alerts("20.12.2013")
1380 public void format_pl_pl() throws Exception {
1381 test("new Intl.DateTimeFormat('pl-PL').format(date)");
1382 }
1383
1384
1385
1386
1387 @Test
1388 @Alerts("20/12/2013")
1389 public void format_pt() throws Exception {
1390 test("new Intl.DateTimeFormat('pt').format(date)");
1391 }
1392
1393
1394
1395
1396 @Test
1397 @Alerts("20/12/2013")
1398 public void format_pt_br() throws Exception {
1399 test("new Intl.DateTimeFormat('pt-BR').format(date)");
1400 }
1401
1402
1403
1404
1405 @Test
1406 @Alerts("20/12/2013")
1407 public void format_pt_pt() throws Exception {
1408 test("new Intl.DateTimeFormat('pt-PT').format(date)");
1409 }
1410
1411
1412
1413
1414 @Test
1415 @Alerts("20.12.2013")
1416 public void format_ro() throws Exception {
1417 test("new Intl.DateTimeFormat('ro').format(date)");
1418 }
1419
1420
1421
1422
1423 @Test
1424 @Alerts("20.12.2013")
1425 public void format_ro_ro() throws Exception {
1426 test("new Intl.DateTimeFormat('ro-RO').format(date)");
1427 }
1428
1429
1430
1431
1432 @Test
1433 @Alerts("20.12.2013")
1434 public void format_ru() throws Exception {
1435 test("new Intl.DateTimeFormat('ru').format(date)");
1436 }
1437
1438
1439
1440
1441 @Test
1442 @Alerts("20.12.2013")
1443 public void format_ru_ru() throws Exception {
1444 test("new Intl.DateTimeFormat('ru-RU').format(date)");
1445 }
1446
1447
1448
1449
1450 @Test
1451 @Alerts("20. 12. 2013")
1452 public void format_sk() throws Exception {
1453 test("new Intl.DateTimeFormat('sk').format(date)");
1454 }
1455
1456
1457
1458
1459 @Test
1460 @Alerts("20. 12. 2013")
1461 public void format_sk_sk() throws Exception {
1462 test("new Intl.DateTimeFormat('sk-SK').format(date)");
1463 }
1464
1465
1466
1467
1468 @Test
1469 @Alerts("20. 12. 2013")
1470 public void format_sl() throws Exception {
1471 test("new Intl.DateTimeFormat('sl').format(date)");
1472 }
1473
1474
1475
1476
1477 @Test
1478 @Alerts("20. 12. 2013")
1479 public void format_sl_si() throws Exception {
1480 test("new Intl.DateTimeFormat('sl-SI').format(date)");
1481 }
1482
1483
1484
1485
1486 @Test
1487 @Alerts(DEFAULT = "20.12.2013",
1488 CHROME = "12/20/2013")
1489 public void format_sq() throws Exception {
1490 test("new Intl.DateTimeFormat('sq').format(date)");
1491 }
1492
1493
1494
1495
1496 @Test
1497 @Alerts(DEFAULT = "20.12.2013",
1498 CHROME = "12/20/2013")
1499 public void format_sq_al() throws Exception {
1500 test("new Intl.DateTimeFormat('sq-AL').format(date)");
1501 }
1502
1503
1504
1505
1506 @Test
1507 @Alerts("20. 12. 2013.")
1508 public void format_sr() throws Exception {
1509 test("new Intl.DateTimeFormat('sr').format(date)");
1510 }
1511
1512
1513
1514
1515 @Test
1516 @Alerts("20. 12. 2013.")
1517 public void format_sr_ba() throws Exception {
1518 test("new Intl.DateTimeFormat('sr-BA').format(date)");
1519 }
1520
1521
1522
1523
1524 @Test
1525 @Alerts("20. 12. 2013.")
1526 public void format_sr_cs() throws Exception {
1527 test("new Intl.DateTimeFormat('sr-CS').format(date)");
1528 }
1529
1530
1531
1532
1533 @Test
1534 @Alerts("20. 12. 2013.")
1535 public void format_sr_me() throws Exception {
1536 test("new Intl.DateTimeFormat('sr-ME').format(date)");
1537 }
1538
1539
1540
1541
1542 @Test
1543 @Alerts("20. 12. 2013.")
1544 public void format_sr_rs() throws Exception {
1545 test("new Intl.DateTimeFormat('sr-RS').format(date)");
1546 }
1547
1548
1549
1550
1551 @Test
1552 @Alerts("2013-12-20")
1553 public void format_sv() throws Exception {
1554 test("new Intl.DateTimeFormat('sv').format(date)");
1555 }
1556
1557
1558
1559
1560 @Test
1561 @Alerts("2013-12-20")
1562 public void format_sv_se() throws Exception {
1563 test("new Intl.DateTimeFormat('sv-SE').format(date)");
1564 }
1565
1566
1567
1568
1569 @Test
1570 @Alerts("20/12/2556")
1571 public void format_th() throws Exception {
1572 test("new Intl.DateTimeFormat('th').format(date)");
1573 }
1574
1575
1576
1577
1578 @Test
1579 @Alerts("20/12/2556")
1580 public void format_th_th() throws Exception {
1581 test("new Intl.DateTimeFormat('th-TH').format(date)");
1582 }
1583
1584
1585
1586
1587 @Test
1588 @Alerts("20.12.2013")
1589 public void format_tr() throws Exception {
1590 test("new Intl.DateTimeFormat('tr').format(date)");
1591 }
1592
1593
1594
1595
1596 @Test
1597 @Alerts("20.12.2013")
1598 public void format_tr_tr() throws Exception {
1599 test("new Intl.DateTimeFormat('tr-TR').format(date)");
1600 }
1601
1602
1603
1604
1605 @Test
1606 @Alerts("20.12.2013")
1607 public void format_uk() throws Exception {
1608 test("new Intl.DateTimeFormat('uk').format(date)");
1609 }
1610
1611
1612
1613
1614 @Test
1615 @Alerts("20.12.2013")
1616 public void format_uk_ua() throws Exception {
1617 test("new Intl.DateTimeFormat('uk-UA').format(date)");
1618 }
1619
1620
1621
1622
1623 @Test
1624 @Alerts("20/12/2013")
1625 public void format_vi() throws Exception {
1626 test("new Intl.DateTimeFormat('vi').format(date)");
1627 }
1628
1629
1630
1631
1632 @Test
1633 @Alerts("20/12/2013")
1634 public void format_vi_vn() throws Exception {
1635 test("new Intl.DateTimeFormat('vi-VN').format(date)");
1636 }
1637
1638
1639
1640
1641 @Test
1642 @Alerts("2013/12/20")
1643 public void format_zh() throws Exception {
1644 test("new Intl.DateTimeFormat('zh').format(date)");
1645 }
1646
1647
1648
1649
1650 @Test
1651 @Alerts("2013/12/20")
1652 public void format_zh_cn() throws Exception {
1653 test("new Intl.DateTimeFormat('zh-CN').format(date)");
1654 }
1655
1656
1657
1658
1659 @Test
1660 @Alerts("20/12/2013")
1661 public void format_zh_hk() throws Exception {
1662 test("new Intl.DateTimeFormat('zh-HK').format(date)");
1663 }
1664
1665
1666
1667
1668 @Test
1669 @Alerts("2013\u5E7412\u670820\u65E5")
1670 public void format_zh_sg() throws Exception {
1671 test("new Intl.DateTimeFormat('zh-SG').format(date)");
1672 }
1673
1674
1675
1676
1677 @Test
1678 @Alerts("2013/12/20")
1679 public void format_zh_tw() throws Exception {
1680 test("new Intl.DateTimeFormat('zh-TW').format(date)");
1681 }
1682 }