123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173 |
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd">
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <title>Test DateTextBox</title>
- <script type="text/javascript" src="../../../dojo/dojo.js"
- djConfig="isDebug: true, extraLocale: ['zh-cn','fr-fr','ja-jp','ar-eg','ru-ru','hi-in','en-us']"></script>
- <script type="text/javascript" src="../../../dojo/currency.js"></script>
- <script type="text/javascript" src="../../../dojo/number.js"></script>
- <script type="text/javascript">
- dojo.require("dijit.form.NumberTextBox");
- dojo.require("dijit.form.CurrencyTextBox");
- dojo.require("dijit.form.DateTextBox");
- dojo.require("dijit.form.ValidationTextBox");
- dojo.require("dojo.date.locale");
- dojo.require("dojo.date.stamp");
- dojo.require("dojo.parser"); // scan page for widgets and instantiate them
- dojo.require("doh.runner");
- </script>
- <script src="test_i18n.js"></script>
- <script type="text/javascript">
- dojo.addOnLoad(function(){
- doh.register("t", getAllTestCases());
- doh.run();
- });
- </script>
- <style type="text/css">
- @import "../../../dojo/resources/dojo.css";
- @import "../../themes/tundra/tundra.css";
- @import "../css/dijitTests.css";
- .title {
- background-color:#ddd;
- }
- .hint {
- background-color:#eee;
- }
- .testExample {
- background-color:#fbfbfb;
- padding:1em;
- margin-bottom:1em;
- border:1px solid #bfbfbf;
- }
- .dojoTitlePaneLabel label {
- font-weight:bold;
- }
- td {white-space:nowrap}
- </style>
- <script>
- function gen4DateFormat(testCases, language, locale, date, short, shortCmt, medium, mediumCmt, long, longCmt, full, fullCmt) {
- testCases.push({
- attrs: {constraints: language.indexOf("hi") == 0 ? "{formatLength:'short', localeDigit: true}" : "{formatLength:'short'}", lang: language},
- desc: "Locale: <b>" + locale + "</b> Format: <b>Short</b>",
- value: date,
- expValue: short,
- comment: shortCmt
- });
- testCases.push({
- attrs: {constraints: language.indexOf("hi") == 0 ? "{formatLength:'medium', localeDigit: true}" : "{formatLength:'medium'}", lang: language},
- desc: "Locale: <b>" + locale + "</b> Format: <b>Medium</b>",
- value: date,
- expValue: medium,
- comment: mediumCmt
- });
- testCases.push({
- attrs: {constraints: language.indexOf("hi") == 0 ? "{formatLength:'long', localeDigit: true}" : "{formatLength:'long'}", lang: language},
- desc: "Locale: <b>" + locale + "</b> Format: <b>Long</b>",
- value: date,
- expValue: long,
- comment: longCmt
- });
- testCases.push({
- attrs: {constraints: language.indexOf("hi") == 0 ? "{formatLength:'full', localeDigit: true}" : "{formatLength:'full'}", lang: language},
- desc: "Locale: <b>" + locale + "</b> Format: <b>Full</b>",
- value: date,
- expValue: full,
- comment: fullCmt
- });
- }
- </script>
- </head>
- <body class="tundra">
- <h1 class="testTitle">Dijit TextBox Globalization Test for Date</h1>
- <!-- <h2 class="testTitle">Press the following button to start all test after this page is loaded.</h2>
- <button id="startButton" onclick="startTest()">Start Test</button>-->
- <p>
- Before start this test, make sure the <b>dojo/cldr/nls</b> contains the data for "zh-cn", "fr-fr", "ja-jp", "ru-ru", "hi-in", "en-us" and "ar-eg". If not, convert these CLDR data and put them there.
- </p>
- <script>
- (function() {
- var testCases;
- testCases = new Array();
- gen4DateFormat(testCases, "ru-ru", "ru_RU", "2005-07-31",
- "31.07.05", "", "31.07.2005", "", "31 июля 2005 г.", "Failed in Firefox. <a href='currency.html#cmt_1'>See #1 (currency.html).</a>", "31 июля 2005 г.", "Failed in Firefox. <a href='currency.html#cmt_1'>See #1 (currency.html).</a>");
- gen4DateFormat(testCases, "zh-cn", "zh_CN", "2005-07-31",
- "05-7-31", "", "2005-7-31", "", "2005年7月31日", "", "2005年7月31日星期日", "");
- gen4DateFormat(testCases, "en-us", "en_US", "2005-07-31",
- "7/31/05", "", "Jul 31, 2005", "", "July 31, 2005", "", "Sunday, July 31, 2005", "");
- gen4DateFormat(testCases, "fr-fr", "fr_FR", "2005-07-31",
- "31/07/05", "", "31 juil. 05", "", "31 juillet 2005", "", "dimanche 31 juillet 2005", "");
- gen4DateFormat(testCases, "ja-jp", "ja_JP", "2005-07-31",
- "05/07/31", "", "2005/07/31", "", "2005年7月31日", "", "2005年7月31日日曜日", "");
- gen4DateFormat(testCases, "ar-eg", "ar_EG", "2005-07-31",
- "31/7/2005", "", "31/07/2005", "", "31 يوليو, 2005", "", "الأحد, 31 يوليو, 2005", "");
- gen4DateFormat(testCases, "hi-in", "hi_IN", "2005-07-31",
- "३१-७-०५", "<a href='currency.html#cmt_3'>See #3 (currency.html).</a>", "३१-०७-२००५", "<a href='currency.html#cmt_3'>See #3 (currency.html).</a>", "३१ जुलाई २००५", "<a href='currency.html#cmt_3'>See #3 (currency.html).</a>", "रविवार ३१ जुलाई २००५", "<a href='currency.html#cmt_3'>See #3 (currency.html).</a>");
- genFormatTestCases("Date Format", "dijit.form.DateTextBox", testCases);
- testCases = new Array();
- gen4DateFormat(testCases, "ru-ru", "ru_RU", new Date(2005, 6, 31),
- "31.07.05", "", "31.07.2005", "", "31 июля 2005 г.", "Failed in Firefox. <a href='currency.html#cmt_1'>See #1 (currency.html).</a>", "31 июля 2005 г.", "Failed in Firefox. <a href='currency.html#cmt_1'>See #1 (currency.html).</a>");
- gen4DateFormat(testCases, "zh-cn", "zh_CN", new Date(2005, 6, 31),
- "05-7-31", "", "2005-7-31", "", "2005年7月31日", "", "2005年7月31日星期日", "");
- gen4DateFormat(testCases, "en-us", "en_US", new Date(2005, 6, 31),
- "7/31/05", "", "Jul 31, 2005", "", "July 31, 2005", "", "Sunday, July 31, 2005", "");
- gen4DateFormat(testCases, "fr-fr", "fr_FR", new Date(2005, 6, 31),
- "31/07/05", "", "31 juil. 05", "", "31 juillet 2005", "", "dimanche 31 juillet 2005", "");
- gen4DateFormat(testCases, "ja-jp", "ja_JP", new Date(2005, 6, 31),
- "05/07/31", "", "2005/07/31", "", "2005年7月31日", "", "2005年7月31日日曜日", "");
- gen4DateFormat(testCases, "ar-eg", "ar_EG", new Date(2005, 6, 31),
- "31/7/2005", "", "31/07/2005", "", "31 يوليو, 2005", "", "الأحد, 31 يوليو, 2005", "");
- gen4DateFormat(testCases, "hi-in", "hi_IN", new Date(2005, 6, 31),
- "३१-७-०५", "<a href='currency.html#cmt_3'>See #3 (currency.html).</a>", "३१-०७-२००५", "<a href='currency.html#cmt_3'>See #3 (currency.html).</a>", "३१ जुलाई २००५", "<a href='currency.html#cmt_3'>See #3 (currency.html).</a>", "रविवार ३१ जुलाई २००५", "<a href='currency.html#cmt_3'>See #3 (currency.html).</a>");
- genValidateTestCases("Date Validate", "dijit.form.DateTextBox", testCases);
- dojo.parser.parse();
- })();
- </script>
- </body>
- </html>
- <!--
- testCases.push({
- attrs: {constraints: language.indexOf("hi") == 0 ? "{formatLength:'short', localeDigit: true}" : "{formatLength:'short'}", lang: language},
- desc: "Locale: <b>" + locale + "</b> Format: <b>Short</b>",
- value: date,
- expValue: short,
- comment: shortCmt
- });
- testCases.push({
- attrs: {constraints: language.indexOf("hi") == 0 ? "{formatLength:'medium', localeDigit: true}" : "{formatLength:'medium'}", lang: language},
- desc: "Locale: <b>" + locale + "</b> Format: <b>Medium</b>",
- value: date,
- expValue: medium,
- comment: mediumCmt
- });
- testCases.push({
- attrs: {constraints: language.indexOf("hi") == 0 ? "{formatLength:'long', localeDigit: true}" : "{formatLength:'long'}", lang: language},
- desc: "Locale: <b>" + locale + "</b> Format: <b>Long</b>",
- value: date,
- expValue: long,
- comment: longCmt
- });
- testCases.push({
- attrs: {constraints: language.indexOf("hi") == 0 ? "{formatLength:'full', localeDigit: true}" : "{formatLength:'full'}", lang: language},
- desc: "Locale: <b>" + locale + "</b> Format: <b>Full</b>",
- value: date,
- expValue: full,
- comment: fullCmt
- -->
|