|
1 function test_full() { |
|
2 var date = new Date(); |
|
3 var scriptableDateServ = |
|
4 Components.classes["@mozilla.org/intl/scriptabledateformat;1"].createInstance(Components.interfaces.nsIScriptableDateFormat); |
|
5 |
|
6 var dateStrXpcom = scriptableDateServ.FormatDateTime("", |
|
7 scriptableDateServ.dateFormatLong, scriptableDateServ.timeFormatSeconds, |
|
8 date.getFullYear(), date.getMonth()+1, date.getDate(), date.getHours(), |
|
9 date.getMinutes(), date.getSeconds()); |
|
10 |
|
11 var dateStrJs = date.toLocaleString(); |
|
12 |
|
13 do_check_eq(dateStrXpcom, dateStrJs); |
|
14 |
|
15 } |
|
16 |
|
17 function test_kTimeFormatSeconds() { |
|
18 var date = new Date(); |
|
19 var scriptableDateServ = |
|
20 Components.classes["@mozilla.org/intl/scriptabledateformat;1"].createInstance(Components.interfaces.nsIScriptableDateFormat); |
|
21 |
|
22 var dateStrXpcom = scriptableDateServ.FormatDateTime("", |
|
23 scriptableDateServ.dateFormatLong, scriptableDateServ.timeFormatNone, |
|
24 date.getFullYear(), date.getMonth()+1, date.getDate(), date.getHours(), |
|
25 date.getMinutes(), date.getSeconds()); |
|
26 |
|
27 var dateStrJs = date.toLocaleDateString() |
|
28 |
|
29 do_check_eq(dateStrXpcom, dateStrJs); |
|
30 |
|
31 } |
|
32 |
|
33 function run_test() |
|
34 { |
|
35 // XXX test disabled due to bug 421790 |
|
36 return; |
|
37 test_full(); |
|
38 test_kTimeFormatSeconds(); |
|
39 } |