Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 799 lines (771 sloc) 29.74 kb
58240a95 » InfinitiesLoop
2010-06-02 Added ability to specify multiple cultures at once. Added readme. Upd…
1 <h1>Introduction</h1>
2 <p>
8faf8308 » eric-brechemier
2010-12-13 Reformatted comment lines to fit in 80 character width
3 This jQuery plugin enables complex culture-aware number and date parsing and
d06d4206 » eric-brechemier
2010-12-13 Fixed typo in first paragraph: hunderds->hundreds
4 formatting, including the raw culture information for hundreds of different
8faf8308 » eric-brechemier
2010-12-13 Reformatted comment lines to fit in 80 character width
5 languages and countries, as well as an extensible system for localization.
58240a95 » InfinitiesLoop
2010-06-02 Added ability to specify multiple cultures at once. Added readme. Upd…
6 </p>
7 <ul>
8 <li><a href="#why">Why Globalization</a></li>
9 <li><a href="#what">What is a Culture?</a></li>
10 <li><a href="#cultures">jQuery.cultures</a></li>
11 <li><a href="#culture">jQuery.culture</a></li>
12 <li><a href="#prefer">jQuery.preferCulture</a></li>
13 <li><a href="#find">jQuery.findClosestCulture</a></li>
14 <li><a href="#format">jQuery.format</a></li>
15 <li><a href="#parseInt">jQuery.parseInt</a></li>
16 <li><a href="#parseFloat">jQuery.parseFloat</a></li>
17 <li><a href="#parseDate">jQuery.parseDate</a></li>
18 <li><a href="#localize">jQuery.localize</a></li>
19 <li><a href="#extend">Utilizing and Extending Cultures</a></li>
20 <li><a href="#defining">Defining Culture Information</a></li>
21 <li><a href="#numbers">Number Formatting</a></li>
22 <li><a href="#dates">Date Formatting</a></li>
23 </ul>
24
eb5d9ca7 » InfinitiesLoop
2010-06-02 Try to get TOC working in github
25 <a name="why"></a>
58240a95 » InfinitiesLoop
2010-06-02 Added ability to specify multiple cultures at once. Added readme. Upd…
26 <h2 id="why">Why Globalization?</h2>
27 <p>
8faf8308 » eric-brechemier
2010-12-13 Reformatted comment lines to fit in 80 character width
28 Each language, and the countries that speak that language, have different
29 expectations when it comes to how numbers (including currency and percentages)
30 and dates should appear. Obviously, each language has different names for the
31 days of the week and the months of the year. But they also have different
5bd3edbc » eric-brechemier
2010-12-13 Added missing word in "Why Globalization?"
32 expectations for the structure of dates, such as what order the day, month and
33 year are in. In number formatting, not only does the character used to
7ccd449d » eric-brechemier
2010-12-13 Enhanced wording in "Why Globalization?"
34 deliniate number groupings and the decimal portion differ, but the placement of
35 those characters differ as well.
58240a95 » InfinitiesLoop
2010-06-02 Added ability to specify multiple cultures at once. Added readme. Upd…
36 </p>
37 <p>
8faf8308 » eric-brechemier
2010-12-13 Reformatted comment lines to fit in 80 character width
38 A user using an application should be able to read and write dates and numbers
39 in the format they are accustomed to. This plugin makes this possible,
9c6027c5 » eric-brechemier
2010-12-13 Enhanced wording in "Why Globalization?" (2nd paragraph)
40 providing an API to convert user-entered number and date strings -- in their
41 own format -- into actual numbers and dates, and conversely, to format numbers
42 and dates into that string format.
58240a95 » InfinitiesLoop
2010-06-02 Added ability to specify multiple cultures at once. Added readme. Upd…
43 </p>
44
814341df » InfinitiesLoop
2010-06-02 Fix TOC in readme on github
45 <a name="what"></a>
58240a95 » InfinitiesLoop
2010-06-02 Added ability to specify multiple cultures at once. Added readme. Upd…
46 <h2 id="what">What is a Culture?</h2>
47 <p>
8faf8308 » eric-brechemier
2010-12-13 Reformatted comment lines to fit in 80 character width
48 jQuery.glob.js defines roughly 350 cultures. Part of the reason for this large
2b9154d0 » eric-brechemier
2010-12-13 Enhanced wording in "What is a Culture?" (1st paragraph)
49 number, besides there being a lot of cultures in the world, is because for
8faf8308 » eric-brechemier
2010-12-13 Reformatted comment lines to fit in 80 character width
50 some languages, expectations differ amoung the countries that speak it.
51 English, for example, is an official language in dozens of countries. Despite
52 the language being English, the expected date formatting still greatly differs
53 between them.
58240a95 » InfinitiesLoop
2010-06-02 Added ability to specify multiple cultures at once. Added readme. Upd…
54 </p>
55 <p>
8faf8308 » eric-brechemier
2010-12-13 Reformatted comment lines to fit in 80 character width
56 So, it seems it is not useful to define cultures by their language alone. Nor
57 is it useful to define a culture by it's country alone, as many countries have
58 many official languages, spoken by sizable populations. Therefore, cultures are
59 defined as a combination of the language and the country speaking it. Each
60 culture is given a unique code that is a combination of an ISO 639 two-letter
61 lowercase culture code for the language, and a two-letter uppercase code for
62 the country or region. For example, "en-US" is the culture code for English, in
63 the United States.
58240a95 » InfinitiesLoop
2010-06-02 Added ability to specify multiple cultures at once. Added readme. Upd…
64 </p>
65 <p>
8faf8308 » eric-brechemier
2010-12-13 Reformatted comment lines to fit in 80 character width
66 Yet, it is perhaps unreasonable to expect application developers to cater to
67 every possible language/country combination perfectly. It is important then to
68 define so-called "neutral" cultures based on each language. This culture
69 defines the most likely accepted set of rules by anyone speaking that language,
70 whatever the country. Neutral cultures are defined only by their language code.
71 For example, "es" is the neutral culture for Spanish.
58240a95 » InfinitiesLoop
2010-06-02 Added ability to specify multiple cultures at once. Added readme. Upd…
72 </p>
73
814341df » InfinitiesLoop
2010-06-02 Fix TOC in readme on github
74 <a name="cultures"></a>
58240a95 » InfinitiesLoop
2010-06-02 Added ability to specify multiple cultures at once. Added readme. Upd…
75 <h2 id="cultures">jQuery.cultures</h2>
76 <p>
8faf8308 » eric-brechemier
2010-12-13 Reformatted comment lines to fit in 80 character width
77 A mapping of culture code to that culture. For example, jQuery.cultures.fr is
78 an object representing the complete culture definition for the neutral French
79 culture. Note that jQuery.glob.js alone only includes an English culture. To
80 get additional cultures, you must seperately reference one or more of the
81 culture scripts that come with it. See below on what fields are defined in
82 each culture.
58240a95 » InfinitiesLoop
2010-06-02 Added ability to specify multiple cultures at once. Added readme. Upd…
83 </p>
84
814341df » InfinitiesLoop
2010-06-02 Fix TOC in readme on github
85 <a name="culture"></a>
58240a95 » InfinitiesLoop
2010-06-02 Added ability to specify multiple cultures at once. Added readme. Upd…
86 <h2 id="culture">jQuery.culture</h2>
87 <p>
8faf8308 » eric-brechemier
2010-12-13 Reformatted comment lines to fit in 80 character width
88 This is set to the culture currently being used. This serves as the default
89 culture if no culture is specified on the various parsing and formatting
90 functions. For example, to change the current culture, set it to one of the
91 available cultures:
58240a95 » InfinitiesLoop
2010-06-02 Added ability to specify multiple cultures at once. Added readme. Upd…
92 <pre>
72df551f » InfinitiesLoop
2010-06-08 default culture is named default
93 jQuery.culture = jQuery.cultures["fr-FR"];
58240a95 » InfinitiesLoop
2010-06-02 Added ability to specify multiple cultures at once. Added readme. Upd…
94 </pre>
95 </p>
96
814341df » InfinitiesLoop
2010-06-02 Fix TOC in readme on github
97 <a name="prefer"></a>
58240a95 » InfinitiesLoop
2010-06-02 Added ability to specify multiple cultures at once. Added readme. Upd…
98 <h2 id="prefer">jQuery.preferCulture</h2>
99 <p>
8faf8308 » eric-brechemier
2010-12-13 Reformatted comment lines to fit in 80 character width
100 An application that supports globalization and/or localization will need to
101 have a way to determine the user's preference. Attempting to automatically
102 determine the appropriate culture is useful, but it is good practice to always
103 offer the user a choice, by whatever means.
58240a95 » InfinitiesLoop
2010-06-02 Added ability to specify multiple cultures at once. Added readme. Upd…
104 </p>
105 <p>
8faf8308 » eric-brechemier
2010-12-13 Reformatted comment lines to fit in 80 character width
106 Whatever your mechanism, it is likely you would have to correlate the user's
107 preferences with the list of cultures the app has specifically decided to
108 support. This API allows you to tell jQuery.glob.js what cultures the user
109 prefers, and select the best match given the culture scripts you have included.
58240a95 » InfinitiesLoop
2010-06-02 Added ability to specify multiple cultures at once. Added readme. Upd…
110 </p>
8faf8308 » eric-brechemier
2010-12-13 Reformatted comment lines to fit in 80 character width
111 <p>
112 If you pass an array, the first culture for which there is a match (that
113 culture's script has been referenced) will be used. If none match, the search
114 restarts using the corresponding neutral cultures. For example, if the
115 application has included only the neutral "fr" culture, any of these would
116 select it:
58240a95 » InfinitiesLoop
2010-06-02 Added ability to specify multiple cultures at once. Added readme. Upd…
117 <pre>
118 &lt;script src="jQuery.glob.fr.js" type="text/javascript">&lt;/script>
119 ...
120 jQuery.preferCulture("fr");
121 alert(jQuery.culture.name) // 'fr'
122
123 jQuery.preferCulture("fr-FR");
124 alert(jQuery.culture.name) // 'fr'
125
126 jQuery.preferCulture(["es-MX", "fr-FR"]);
127 alert(jQuery.culture.name) // 'fr'
128 </pre>
129
72df551f » InfinitiesLoop
2010-06-08 default culture is named default
130 In any case, if no match is found, the 'default' culture is selected.
58240a95 » InfinitiesLoop
2010-06-02 Added ability to specify multiple cultures at once. Added readme. Upd…
131 </p>
d59ee1f8 » InfinitiesLoop
2010-06-10 Documented new quality setting support.
132 <p>
8faf8308 » eric-brechemier
2010-12-13 Reformatted comment lines to fit in 80 character width
133 Each culture string may also follow the pattern defined in
134 <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.4"
135 >RFC2616 sec 14.4</a>. That is, a culture name may include a 'quality' value
136 that indicates it preference.
d59ee1f8 » InfinitiesLoop
2010-06-10 Documented new quality setting support.
137
138 <pre>
139 jQuery.preferCulture("fr;q=0.4, es;q=0.5, he");
140 </pre>
8faf8308 » eric-brechemier
2010-12-13 Reformatted comment lines to fit in 80 character width
141 In this example, 'he' is given top priority (an unspecified quality is equal
142 to 1). If that language is not an exact match for any of the cultures available
143 on jQuery.cultures, then 'es' is the next highest priority with 0.5, etc. If
144 none of these match, just like with the array syntax, the search starts over
145 and the same rules are applied to the corresponding neutral language culture
146 for each. If still none match, the default 'en' culture is used.
d59ee1f8 » InfinitiesLoop
2010-06-10 Documented new quality setting support.
147 </p>
58240a95 » InfinitiesLoop
2010-06-02 Added ability to specify multiple cultures at once. Added readme. Upd…
148
814341df » InfinitiesLoop
2010-06-02 Fix TOC in readme on github
149 <a name="find"></a>
58240a95 » InfinitiesLoop
2010-06-02 Added ability to specify multiple cultures at once. Added readme. Upd…
150 <h2 id="find">jQuery.findClosestCulture</h2>
151 <p>
8faf8308 » eric-brechemier
2010-12-13 Reformatted comment lines to fit in 80 character width
152 Just like preferCulture, but it returns the matching culture, if any, rather
153 than setting jQuery.culture to it.
58240a95 » InfinitiesLoop
2010-06-02 Added ability to specify multiple cultures at once. Added readme. Upd…
154 </p>
155
814341df » InfinitiesLoop
2010-06-02 Fix TOC in readme on github
156 <a name="format"></a>
58240a95 » InfinitiesLoop
2010-06-02 Added ability to specify multiple cultures at once. Added readme. Upd…
157 <h2 id="format">jQuery.format(value, format, culture)</h2>
158 <p>
8faf8308 » eric-brechemier
2010-12-13 Reformatted comment lines to fit in 80 character width
159 Formats a date or number according to the given format string and the given
160 culture (or the current culture if not specified). See the section below on
161 number and date formatting tokens for details on the available formats.
58240a95 » InfinitiesLoop
2010-06-02 Added ability to specify multiple cultures at once. Added readme. Upd…
162 <pre>
8faf8308 » eric-brechemier
2010-12-13 Reformatted comment lines to fit in 80 character width
163 // assuming a culture with number grouping of 3 digits,
164 // using "," separator and "." decimal symbol.
58240a95 » InfinitiesLoop
2010-06-02 Added ability to specify multiple cultures at once. Added readme. Upd…
165 jQuery.format(1234.567, "n"); // "1,234.57"
166 jQuery.format(1234.567, "n1"); // "1,234.6"
167 jQuery.format(1234.567, "n0"); // "1,235"
168
169 // assuming a culture with "/" as the date separator symbol
170 jQuery.format(new Date(1955,10,5), "yyyy/MM/dd"); // 1955/11/05
171 jQuery.format(new Date(1955,10,5), "dddd MMMM d, yyyy"); // Saturday November 5, 1955
172 </pre>
173 </p>
174
814341df » InfinitiesLoop
2010-06-02 Fix TOC in readme on github
175 <a name="parseInt"></a>
58240a95 » InfinitiesLoop
2010-06-02 Added ability to specify multiple cultures at once. Added readme. Upd…
176 <h2 id="parseInt">jQuery.parseInt(value, radix, culture)</h2>
177 <p>
8faf8308 » eric-brechemier
2010-12-13 Reformatted comment lines to fit in 80 character width
178 Parses a string representing a whole number in the given the radix (10 by
179 default), taking into account any formatting rules followed by the given
180 culture (or the current culture, if not specified).
58240a95 » InfinitiesLoop
2010-06-02 Added ability to specify multiple cultures at once. Added readme. Upd…
181 <pre>
8faf8308 » eric-brechemier
2010-12-13 Reformatted comment lines to fit in 80 character width
182 // assuming a culture where "," is the group separator
183 // and "." is the decimal separator
58240a95 » InfinitiesLoop
2010-06-02 Added ability to specify multiple cultures at once. Added readme. Upd…
184 jQuery.parseInt("1,234.56"); // 1234
8faf8308 » eric-brechemier
2010-12-13 Reformatted comment lines to fit in 80 character width
185 // assuming a culture where "." is the group separator
186 // and "," is the decimal separator
58240a95 » InfinitiesLoop
2010-06-02 Added ability to specify multiple cultures at once. Added readme. Upd…
187 jQuery.parseInt("1.234,56"); // 1234
188 </pre>
189 </p>
190
814341df » InfinitiesLoop
2010-06-02 Fix TOC in readme on github
191 <a name="parseFloat"></a>
58240a95 » InfinitiesLoop
2010-06-02 Added ability to specify multiple cultures at once. Added readme. Upd…
192 <h2 id="parseFloat">jQuery.parseFloat(value, radix, culture)</h2>
193 <p>
8faf8308 » eric-brechemier
2010-12-13 Reformatted comment lines to fit in 80 character width
194 Parses a string representing a floating point number in the given the radix
195 (10 by default), taking into account any formatting rules followed by the given
196 culture (or the current culture, if not specified).
58240a95 » InfinitiesLoop
2010-06-02 Added ability to specify multiple cultures at once. Added readme. Upd…
197 </p>
198
2e4f0f0d » eric-brechemier
2010-12-13 Added missing HTML anchor for parseDate
199 <a name="parseDate"></a>
58240a95 » InfinitiesLoop
2010-06-02 Added ability to specify multiple cultures at once. Added readme. Upd…
200 <h2>jQuery.parseDate(value, formats, culture)</h2>
201 <p>
8faf8308 » eric-brechemier
2010-12-13 Reformatted comment lines to fit in 80 character width
202 Parses a string representing a date into a JavaScript Date object, taking into
203 account the given possible formats (or the given culture's set of default
204 formats if not given). As before, the current culture is used if one is not
205 specified.
58240a95 » InfinitiesLoop
2010-06-02 Added ability to specify multiple cultures at once. Added readme. Upd…
206 <pre>
207 jQuery.culture = jQuery.culture.en;
208 jQuery.parseDate("1/2/2003"); // Thu Jan 02 2003
209 jQuery.culture = jQuery.culture.fr;
210 jQuery.parseDate("1/2/2003"); // Sat Feb 01 2003
211 </pre>
212 </p>
213
814341df » InfinitiesLoop
2010-06-02 Fix TOC in readme on github
214 <a name="localize"></a>
58240a95 » InfinitiesLoop
2010-06-02 Added ability to specify multiple cultures at once. Added readme. Upd…
215 <h2 id="localize">jQuery.localize(key, culture, value)</h2>
216 <p>
8faf8308 » eric-brechemier
2010-12-13 Reformatted comment lines to fit in 80 character width
217 Gets or sets a localized value. This function allows you to extend the
218 information available to a particular culture, and to easily retrieve it
219 without worrying about finding the most appropriate culture. For example, to
220 define the word "translate" in French:
58240a95 » InfinitiesLoop
2010-06-02 Added ability to specify multiple cultures at once. Added readme. Upd…
221 <pre>
222 jQuery.localize("translate", "fr", "traduire");
223 </pre>
8faf8308 » eric-brechemier
2010-12-13 Reformatted comment lines to fit in 80 character width
224 The value may be any value you wish -- a string, number, object, etc. You can
225 then define a grouping of localized values common to a feature, plugin, or
226 application.
58240a95 » InfinitiesLoop
2010-06-02 Added ability to specify multiple cultures at once. Added readme. Upd…
227 <pre>
228 jQuery.localize("myplugin", "fr", {
229 foo: "foo",
230 bar: "bar"
231 });
232
233 var obj = jQuery.localize("myplugin", "fr");
234 alert(obj.foo); // "foo"
235 </pre>
8faf8308 » eric-brechemier
2010-12-13 Reformatted comment lines to fit in 80 character width
236 Note that localize() will find the closest match available per the same
237 semantics as the jQuery.findClosestCulture function. If there is no match, the
238 translation given is for the 'default' culture, if one was specified.
58240a95 » InfinitiesLoop
2010-06-02 Added ability to specify multiple cultures at once. Added readme. Upd…
239 <pre>
240 jQuery.localize("myplugin", "", {
099e13a7 » InfinitiesLoop
2010-06-08 Removed invariant culture. 'en' is the default now.
241 foo: "foo (en)",
242 bar: "bar (en)"
58240a95 » InfinitiesLoop
2010-06-02 Added ability to specify multiple cultures at once. Added readme. Upd…
243 });
244 jQuery.localize("myplugin", "fr", {
245 foo: "foo",
246 bar: "bar"
247 });
248
249 jQuery.culture = jQuery.cultures["fr"];
250 alert(jQuery.localize("myplugin").foo); // foo
251
252 jQuery.culture = jQuery.cultures["fr-FR"];
253 alert(jQuery.localize("myplugin").foo); // foo
254
255 jQuery.culture = jQuery.cultures["es-MX"];
256 jQuery.culture = jQuery.cultures["fr-FR"];
099e13a7 » InfinitiesLoop
2010-06-08 Removed invariant culture. 'en' is the default now.
257 alert(jQuery.localize("myplugin").foo); // foo (en)
58240a95 » InfinitiesLoop
2010-06-02 Added ability to specify multiple cultures at once. Added readme. Upd…
258 </pre>
8faf8308 » eric-brechemier
2010-12-13 Reformatted comment lines to fit in 80 character width
259 Also note that localize() does not require loading the culture information
260 script. You may use localize() for localization purposes without utilizing the
261 parsing and formatting functions which depend on the cultures. If you do use
262 both, it does not matter what order you include them in, either may be first
263 -- the jQuery.glob.&lt;code&gt;.js script, or your own script which uses
264 localize().
58240a95 » InfinitiesLoop
2010-06-02 Added ability to specify multiple cultures at once. Added readme. Upd…
265 </p>
266
814341df » InfinitiesLoop
2010-06-02 Fix TOC in readme on github
267 <a name="extend"></a>
58240a95 » InfinitiesLoop
2010-06-02 Added ability to specify multiple cultures at once. Added readme. Upd…
268 <h2 id="extend">Utilizing and Extending Cultures</h2>
269 <p>
8faf8308 » eric-brechemier
2010-12-13 Reformatted comment lines to fit in 80 character width
270 The culture information included with each culture is mostly necessary for the
271 parsing and formatting methods, but not all of it. For example, the the Native
272 and English names for each culture is given, as well as a boolean indicating
273 whether the language is right-to-left. This may be useful information for your
274 own purposes. You may also add to the culture information directly if so
275 desired. It is important to do so in a way that handles the fact that the
276 culture info may not be provided, may not be provided yet, or may already be
277 provided. Using jQuery's extend() method, it is possible to define a culture
278 in a way that both defines if it does not exist and adds to it if it does
279 exist.
58240a95 » InfinitiesLoop
2010-06-02 Added ability to specify multiple cultures at once. Added readme. Upd…
280 </p>
281 <p>
8faf8308 » eric-brechemier
2010-12-13 Reformatted comment lines to fit in 80 character width
282 As an example, in the U.S., the word "billion" means the number 1,000,000,000
283 (9 zeros). But in other countries, that number is "1000 million" or a
284 "milliard", and a billion is 1,000,000,000,000 (12 zeros). If you needed to
285 provide functionality to your app or custom plugin that needed to know how many
286 zeros are in a 'billion', you could extend the culture information as follows:
58240a95 » InfinitiesLoop
2010-06-02 Added ability to specify multiple cultures at once. Added readme. Upd…
287 <pre>
288 // define culture information without overwriting any existing values
289 jQuery.cultures.fr = jQuery.extend(true, {
290 numberFormat: {
291 billionZeros: 12
292 }
293 }, jQuery.cultures.fr);
294 </pre>
8faf8308 » eric-brechemier
2010-12-13 Reformatted comment lines to fit in 80 character width
295 Using this mechanism, the 'fr' culture will be created if it does not exist.
296 And if it does, the given values will be added to it, taking care not to
297 overwrite anything that is already defined (if you'd prefer to overwrite, you'd
298 switch the last two arguments). When the jQuery.glob.fr.js script is eventually
299 included, it too uses this technique, ensuring addition to the already-defined
300 culture information.
58240a95 » InfinitiesLoop
2010-06-02 Added ability to specify multiple cultures at once. Added readme. Upd…
301 </p>
302
814341df » InfinitiesLoop
2010-06-02 Fix TOC in readme on github
303 <a name="defining"></a>
58240a95 » InfinitiesLoop
2010-06-02 Added ability to specify multiple cultures at once. Added readme. Upd…
304 <h2 id="defining">Defining Culture Information</h2>
305 <p>
8faf8308 » eric-brechemier
2010-12-13 Reformatted comment lines to fit in 80 character width
306 Each culture is defined in its own script with the naming scheme
307 jQuery.glob.&lt;code&gt;.js (along with its minified version,
308 jQuery.glob.&lt;code&gt;.min.js). You may include any number of these scripts,
309 making them available in the jQuery.cultures mapping. Including one of these
310 scripts does NOT automatically make it the default culture selected with
311 jQuery.culture.
58240a95 » InfinitiesLoop
2010-06-02 Added ability to specify multiple cultures at once. Added readme. Upd…
312 </p>
313 <p>
8faf8308 » eric-brechemier
2010-12-13 Reformatted comment lines to fit in 80 character width
314 The default culture that comes with jQuery.glob.js is 'default', and heavily
315 commented, describing the purpose of each of the fields defined by a culture.
316 Note that every culture includes all of these fields, even if they are the same
317 as this culture. However, the script uses jQuery's $.extend to copy from this
318 culture, so looking at the raw scripts will only show you what is different in
319 that culture from 'default'. The 'default' culture is listed here along with
320 the comments:
58240a95 » InfinitiesLoop
2010-06-02 Added ability to specify multiple cultures at once. Added readme. Upd…
321 <pre>
72df551f » InfinitiesLoop
2010-06-08 default culture is named default
322 jQuery.cultures['default'] = {
8faf8308 » eric-brechemier
2010-12-13 Reformatted comment lines to fit in 80 character width
323 // A unique name for the culture in the form
324 // &lt;language code&gt;-&lt;country/region code&lt;
099e13a7 » InfinitiesLoop
2010-06-08 Removed invariant culture. 'en' is the default now.
325 name: "English",
58240a95 » InfinitiesLoop
2010-06-02 Added ability to specify multiple cultures at once. Added readme. Upd…
326 // the name of the culture in the english language
099e13a7 » InfinitiesLoop
2010-06-08 Removed invariant culture. 'en' is the default now.
327 englishName: "English",
58240a95 » InfinitiesLoop
2010-06-02 Added ability to specify multiple cultures at once. Added readme. Upd…
328 // the name of the culture in its own language
099e13a7 » InfinitiesLoop
2010-06-08 Removed invariant culture. 'en' is the default now.
329 nativeName: "English",
58240a95 » InfinitiesLoop
2010-06-02 Added ability to specify multiple cultures at once. Added readme. Upd…
330 // whether the culture uses right-to-left text
331 isRTL: false,
332 // 'language' is used for so-called "specific" cultures.
333 // For example, the culture "es-CL" means "Spanish, in Chili".
334 // It represents the Spanish-speaking culture as it is in Chili,
335 // which might have different formatting rules or even translations
336 // than Spanish in Spain. A "neutral" culture is one that is not
337 // specific to a region. For example, the culture "es" is the generic
338 // Spanish culture, which may be a more generalized version of the language
339 // that may or may not be what a specific culture expects.
340 // For a specific culture like "es-CL", the 'language' field refers to the
341 // neutral, generic culture information for the language it is using.
342 // This is not always a simple matter of the string before the dash.
343 // For example, the "zh-Hans" culture is netural (Simplified Chinese).
344 // And the 'zh-SG' culture is Simplified Chinese in Singapore, whose lanugage
345 // field is "zh-CHS", not "zh".
346 // This field should be used to navigate from a specific culture to it's
347 // more general, neutral culture. If a culture is already as general as it
348 // can get, the language may refer to itself.
099e13a7 » InfinitiesLoop
2010-06-08 Removed invariant culture. 'en' is the default now.
349 language: "en",
58240a95 » InfinitiesLoop
2010-06-02 Added ability to specify multiple cultures at once. Added readme. Upd…
350 // numberFormat defines general number formatting rules, like the digits in
351 // each grouping, the group separator, and how negative numbers are displayed.
352 numberFormat: {
353 // [negativePattern]
8faf8308 » eric-brechemier
2010-12-13 Reformatted comment lines to fit in 80 character width
354 // Note, numberFormat.pattern has no 'positivePattern' unlike percent
355 // and currency, but is still defined as an array for consistency with
356 // them.
357 // negativePattern: one of "(n)|-n|- n|n-|n -"
58240a95 » InfinitiesLoop
2010-06-02 Added ability to specify multiple cultures at once. Added readme. Upd…
358 pattern: ["-n"],
359 // number of decimal places normally shown
360 decimals: 2,
361 // string that separates number groups, as in 1,000,000
362 ',': ",",
8faf8308 » eric-brechemier
2010-12-13 Reformatted comment lines to fit in 80 character width
363 // string that separates a number from the fractional portion,
364 // as in 1.99
58240a95 » InfinitiesLoop
2010-06-02 Added ability to specify multiple cultures at once. Added readme. Upd…
365 '.': ".",
366 // array of numbers indicating the size of each number group.
367 groupSizes: [3],
368 // symbol used for positive numbers
369 '+': "+",
370 // symbol used for negative numbers
371 '-': "-",
372 percent: {
373 // [negativePattern, positivePattern]
374 // negativePattern: one of "-n %|-n%|-%n|%-n|%n-|n-%|n%-|-% n|n %-|% n-|% -n|n- %"
375 // positivePattern: one of "n %|n%|%n|% n"
376 pattern: ["-n %","n %"],
377 // number of decimal places normally shown
378 decimals: 2,
379 // array of numbers indicating the size of each number group.
380 groupSizes: [3],
381 // string that separates number groups, as in 1,000,000
382 ',': ",",
383 // string that separates a number from the fractional portion, as in 1.99
384 '.': ".",
385 // symbol used to represent a percentage
386 symbol: "%"
387 },
388 currency: {
389 // [negativePattern, positivePattern]
390 // negativePattern: one of "($n)|-$n|$-n|$n-|(n$)|-n$|n-$|n$-|-n $|-$ n|n $-|$ n-|$ -n|n- $|($ n)|(n $)"
391 // positivePattern: one of "$n|n$|$ n|n $"
392 pattern: ["($n)","$n"],
393 // number of decimal places normally shown
394 decimals: 2,
395 // array of numbers indicating the size of each number group.
396 groupSizes: [3],
397 // string that separates number groups, as in 1,000,000
398 ',': ",",
399 // string that separates a number from the fractional portion, as in 1.99
400 '.': ".",
401 // symbol used to represent currency
099e13a7 » InfinitiesLoop
2010-06-08 Removed invariant culture. 'en' is the default now.
402 symbol: "$"
58240a95 » InfinitiesLoop
2010-06-02 Added ability to specify multiple cultures at once. Added readme. Upd…
403 }
404 },
405 // calendars defines all the possible calendars used by this culture.
8faf8308 » eric-brechemier
2010-12-13 Reformatted comment lines to fit in 80 character width
406 // There should be at least one defined with name 'standard', and is the
407 // default calendar used by the culture.
408 // A calendar contains information about how dates are formatted,
409 // information about the calendar's eras, a standard set of the date
410 // formats, translations for day and month names, and if the calendar is
411 // not based on the Gregorian calendar, conversion functions to and from
412 // the Gregorian calendar.
58240a95 » InfinitiesLoop
2010-06-02 Added ability to specify multiple cultures at once. Added readme. Upd…
413 calendars: {
414 standard: {
415 // name that identifies the type of calendar this is
416 name: "Gregorian_USEnglish",
417 // separator of parts of a date (e.g. '/' in 11/05/1955)
418 '/': "/",
419 // separator of parts of a time (e.g. ':' in 05:44 PM)
420 ':': ":",
421 // the first day of the week (0 = Sunday, 1 = Monday, etc)
422 firstDay: 0,
10e570ff » InfinitiesLoop
2010-06-03 Use named fields for days and months versions. Updated readme and demo.
423 days: {
58240a95 » InfinitiesLoop
2010-06-02 Added ability to specify multiple cultures at once. Added readme. Upd…
424 // full day names
10e570ff » InfinitiesLoop
2010-06-03 Use named fields for days and months versions. Updated readme and demo.
425 names: ["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],
58240a95 » InfinitiesLoop
2010-06-02 Added ability to specify multiple cultures at once. Added readme. Upd…
426 // abbreviated day names
10e570ff » InfinitiesLoop
2010-06-03 Use named fields for days and months versions. Updated readme and demo.
427 namesAbbr: ["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],
58240a95 » InfinitiesLoop
2010-06-02 Added ability to specify multiple cultures at once. Added readme. Upd…
428 // shortest day names
10e570ff » InfinitiesLoop
2010-06-03 Use named fields for days and months versions. Updated readme and demo.
429 namesShort: ["Su","Mo","Tu","We","Th","Fr","Sa"]
430 },
58240a95 » InfinitiesLoop
2010-06-02 Added ability to specify multiple cultures at once. Added readme. Upd…
431 months: [
432 // full month names (13 months for lunar calendars -- 13th month should be "" if not lunar)
10e570ff » InfinitiesLoop
2010-06-03 Use named fields for days and months versions. Updated readme and demo.
433 names: ["January","February","March","April","May","June","July","August","September","October","November","December",""],
58240a95 » InfinitiesLoop
2010-06-02 Added ability to specify multiple cultures at once. Added readme. Upd…
434 // abbreviated month names
10e570ff » InfinitiesLoop
2010-06-03 Use named fields for days and months versions. Updated readme and demo.
435 namesAbbr: ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""]
58240a95 » InfinitiesLoop
2010-06-02 Added ability to specify multiple cultures at once. Added readme. Upd…
436 ],
437 // AM and PM designators in one of these forms:
438 // The usual view, and the upper and lower case versions
439 // [standard,lowercase,uppercase]
8faf8308 » eric-brechemier
2010-12-13 Reformatted comment lines to fit in 80 character width
440 // The culture does not use AM or PM (likely all standard date
441 // formats use 24 hour time)
58240a95 » InfinitiesLoop
2010-06-02 Added ability to specify multiple cultures at once. Added readme. Upd…
442 // null
443 AM: ["AM", "am", "AM"],
444 PM: ["PM", "pm", "PM"],
445 eras: [
446 // eras in reverse chronological order.
447 // name: the name of the era in this culture (e.g. A.D., C.E.)
8faf8308 » eric-brechemier
2010-12-13 Reformatted comment lines to fit in 80 character width
448 // start: when the era starts in ticks, null if it is the
449 // earliest supported era.
58240a95 » InfinitiesLoop
2010-06-02 Added ability to specify multiple cultures at once. Added readme. Upd…
450 // offset: offset in years from gregorian calendar
451 {"name":"A.D.","start":null,"offset":0}
452 ],
8faf8308 » eric-brechemier
2010-12-13 Reformatted comment lines to fit in 80 character width
453 // when a two digit year is given, it will never be parsed as a
454 // four digit year greater than this year (in the appropriate era
455 // for the culture)
456 // Set it as a full year (e.g. 2029) or use an offset format
457 // starting from the current year: "+19" would correspond to 2029
458 // if the current year 2010.
58240a95 » InfinitiesLoop
2010-06-02 Added ability to specify multiple cultures at once. Added readme. Upd…
459 twoDigitYearMax: 2029,
460 // set of predefined date and time patterns used by the culture
461 // these represent the format someone in this culture would expect
462 // to see given the portions of the date that are shown.
463 patterns: {
464 // short date pattern
099e13a7 » InfinitiesLoop
2010-06-08 Removed invariant culture. 'en' is the default now.
465 d: "M/d/yyyy",
58240a95 » InfinitiesLoop
2010-06-02 Added ability to specify multiple cultures at once. Added readme. Upd…
466 // long date pattern
099e13a7 » InfinitiesLoop
2010-06-08 Removed invariant culture. 'en' is the default now.
467 D: "dddd, MMMM dd, yyyy",
58240a95 » InfinitiesLoop
2010-06-02 Added ability to specify multiple cultures at once. Added readme. Upd…
468 // short time pattern
099e13a7 » InfinitiesLoop
2010-06-08 Removed invariant culture. 'en' is the default now.
469 t: "h:mm tt",
58240a95 » InfinitiesLoop
2010-06-02 Added ability to specify multiple cultures at once. Added readme. Upd…
470 // long time pattern
099e13a7 » InfinitiesLoop
2010-06-08 Removed invariant culture. 'en' is the default now.
471 T: "h:mm:ss tt",
58240a95 » InfinitiesLoop
2010-06-02 Added ability to specify multiple cultures at once. Added readme. Upd…
472 // long date, short time pattern
099e13a7 » InfinitiesLoop
2010-06-08 Removed invariant culture. 'en' is the default now.
473 f: "dddd, MMMM dd, yyyy h:mm tt",
58240a95 » InfinitiesLoop
2010-06-02 Added ability to specify multiple cultures at once. Added readme. Upd…
474 // long date, long time pattern
099e13a7 » InfinitiesLoop
2010-06-08 Removed invariant culture. 'en' is the default now.
475 F: "dddd, MMMM dd, yyyy h:mm:ss tt",
58240a95 » InfinitiesLoop
2010-06-02 Added ability to specify multiple cultures at once. Added readme. Upd…
476 // month/day pattern
477 M: "MMMM dd",
478 // month/year pattern
479 Y: "yyyy MMMM",
480 // S is a sortable format that does not vary by culture
481 S: "yyyy\u0027-\u0027MM\u0027-\u0027dd\u0027T\u0027HH\u0027:\u0027mm\u0027:\u0027ss"
482 }
483 // optional fields for each calendar:
484 /*
485 monthsGenitive:
486 Same as months but used when the day preceeds the month.
487 Omit if the culture has no genitive distinction in month names.
8faf8308 » eric-brechemier
2010-12-13 Reformatted comment lines to fit in 80 character width
488 For an explaination of genitive months, see
489 http://blogs.msdn.com/michkap/archive/2004/12/25/332259.aspx
58240a95 » InfinitiesLoop
2010-06-02 Added ability to specify multiple cultures at once. Added readme. Upd…
490 convert:
8faf8308 » eric-brechemier
2010-12-13 Reformatted comment lines to fit in 80 character width
491 Allows for the support of non-gregorian based calendars. This
492 convert object is used to to convert a date to and from a
493 gregorian calendar date to handle parsing and formatting.
58240a95 » InfinitiesLoop
2010-06-02 Added ability to specify multiple cultures at once. Added readme. Upd…
494 The two functions:
495 fromGregorian(date)
8faf8308 » eric-brechemier
2010-12-13 Reformatted comment lines to fit in 80 character width
496 Given the date as a parameter, return an array with
497 parts [year, month, day] corresponding to the
498 non-gregorian based year, month, and day for the
499 calendar.
58240a95 » InfinitiesLoop
2010-06-02 Added ability to specify multiple cultures at once. Added readme. Upd…
500 toGregorian(year, month, day)
8faf8308 » eric-brechemier
2010-12-13 Reformatted comment lines to fit in 80 character width
501 Given the non-gregorian year, month, and day, return a
502 new Date() object set to the corresponding date in the
503 gregorian calendar.
58240a95 » InfinitiesLoop
2010-06-02 Added ability to specify multiple cultures at once. Added readme. Upd…
504 */
505 }
506 }
507 }
508 </pre>
509 </p>
510 <p>
8faf8308 » eric-brechemier
2010-12-13 Reformatted comment lines to fit in 80 character width
511 Each culture can have several possible calendars. The calendar named "standard"
512 is the default calendar used by that culture. You may change the calendar in
513 use by setting the 'calendar' field. Take a look at the calendars defined by
514 each culture by looking at the script or enumerating its calendars collection.
58240a95 » InfinitiesLoop
2010-06-02 Added ability to specify multiple cultures at once. Added readme. Upd…
515 <pre>
516 // switch to a non-standard calendar
517 $.culture.calendar = $.culture.calendars.SomeOtherCalendar;
518 // back to the standard calendar
519 $.culture.calendar = $.culture.calendars.standard;
520 </pre>
521
522 </p>
523
814341df » InfinitiesLoop
2010-06-02 Fix TOC in readme on github
524 <a name="numbers"></a>
58240a95 » InfinitiesLoop
2010-06-02 Added ability to specify multiple cultures at once. Added readme. Upd…
525 <h2 id="numbers">Number Formatting</h2>
526 <p>
8faf8308 » eric-brechemier
2010-12-13 Reformatted comment lines to fit in 80 character width
527 When formatting a number with format(), the main purpose is to convert the
528 number into a human readable string using the culture's standard grouping and
529 decimal rules. The rules between cultures can vary a lot. For example, in some
530 cultures, the grouping of numbers is done unevenly. In the "te-IN" culture
531 (Telugu in India), groups have 3 digits and then 2 digits. The number 1000000
532 (one million) is written as "10,00,000". Some cultures do not group numbers at
533 all.
58240a95 » InfinitiesLoop
2010-06-02 Added ability to specify multiple cultures at once. Added readme. Upd…
534 </p>
535 <p>
536 There are four main types of number formatting:
537 <ul>
538 <li><strong>n</strong> for number</li>
539 <li><strong>d</strong> for decimal digits</li>
540 <li><strong>p</strong> for percentage</li>
541 <li><strong>c</strong> for currency</li>
542 </ul>
8faf8308 » eric-brechemier
2010-12-13 Reformatted comment lines to fit in 80 character width
543 Even within the same culture, the formatting rules can vary between these four
544 types of numbers. For example, the expected number of decimal places may differ
545 from the number format to the currency format. Each format token may also be
546 followed by a number. The number determines how many decimals places to display
547 for all the format types except decimal, for which it means the minimum number
548 of digits to display, zero padding it if necessary. Also note that the way
549 negative numbers are represented in each culture can vary, such as what the
550 negative sign is, and whether the negative sign appears before or after the
551 number. This is especially apparent with currency formatting, where many
552 cultures use parentheses instead of a negative sign.
58240a95 » InfinitiesLoop
2010-06-02 Added ability to specify multiple cultures at once. Added readme. Upd…
553 <pre>
554 // just for example -- will vary by culture
555 jQuery.format(123.45, "n"); // 123.45
556 jQuery.format(123.45, "n0"); // 123
557 jQuery.format(123.45, "n1"); // 123.5
558
559 jQuery.format(123.45, "d"); // 123
560 jQuery.format(12, "d3"); // 012
561
562 jQuery.format(123.45, "c"); // $123.45
563 jQuery.format(123.45, "c0"); // $123
564 jQuery.format(123.45, "c1"); // $123.5
565 jQuery.format(-123.45, "c"); // ($123.55)
566
567 jQuery.format(0.12345, "p"); // 12.35 %
568 jQuery.format(0.12345, "p0"); // 12 %
569 jQuery.format(0.12345, "p4"); // 12.3450 %
570 </pre>
571 Parsing with parseInt and parseFloat also accepts any of these formats.
572 </p>
573
814341df » InfinitiesLoop
2010-06-02 Fix TOC in readme on github
574 <a name="dates"></a>
58240a95 » InfinitiesLoop
2010-06-02 Added ability to specify multiple cultures at once. Added readme. Upd…
575 <h2 id="dates">Date Formatting</h2>
576 <p>
8faf8308 » eric-brechemier
2010-12-13 Reformatted comment lines to fit in 80 character width
577 Date formatting varies wildly by culture, not just in the spelling of month and
578 day names, and the date separator, but by the expected order of the various
579 date components, whether to use a 12 or 24 hour clock, and how months and days
580 are abbreivated. Many cultures even include "genitive" month names, which are
581 different from the typical names and are used only in certain cases.
58240a95 » InfinitiesLoop
2010-06-02 Added ability to specify multiple cultures at once. Added readme. Upd…
582 </p>
583 <p>
8faf8308 » eric-brechemier
2010-12-13 Reformatted comment lines to fit in 80 character width
584 Also, each culture has a set of "standard" or "typical" formats. For example,
585 in en-US, when displaying a date in its fullest form, it looks like
586 "Saturday, November 05, 1955". Note the non-abbreivated day and month name, the
587 zero padded date, and four digit year. So, jQuery.glob.js defines a certain set
588 of "standard" formatting strings for dates that are aliases to the specific
589 formats for the culture. See the 2nd table below for the meaning of each token
590 in the en-US examples.
58240a95 » InfinitiesLoop
2010-06-02 Added ability to specify multiple cultures at once. Added readme. Upd…
591 <table>
592 <tr>
593 <th>Token</th>
594 <th>Meaning</th>
595 <th>en-US (example)</th>
596 </tr>
597 <tr>
598 <td>f</td>
599 <td>Long Date, Short Time</td>
600 <td>dddd, MMMM dd, yyyy h:mm tt</td>
601 </tr>
602 <tr>
603 <td>F</td>
604 <td>Long Date, Long Time</td>
605 <td>dddd, MMMM dd, yyyy h:mm:ss tt</td>
606 </tr>
607 <tr>
608 <td>t</td>
609 <td>Short Time</td>
610 <td>h:mm tt</td>
611 </tr>
612 <tr>
613 <td>T</td>
614 <td>Long Time</td>
615 <td>h:mm:ss tt</td>
616 </tr>
617 <tr>
618 <td>d</td>
619 <td>Short Date</td>
620 <td>M/d/yyyy</td>
621 </tr>
622 <tr>
623 <td>D</td>
624 <td>Long Date</td>
625 <td>dddd, MMMM dd, yyyy</td>
626 </tr>
627 <tr>
628 <td>Y</td>
629 <td>Month/Year</td>
630 <td>MMMM, yyyy</td>
631 </tr>
632 <tr>
633 <td>M</td>
634 <td>Month/Day</td>
635 <td>yyyy MMMM</td>
636 </tr>
637 </table>
638 </p>
639 <p>
8faf8308 » eric-brechemier
2010-12-13 Reformatted comment lines to fit in 80 character width
640 In addition to these standard formats, there is the 'S' format. This is a
641 sortable format that is always the same for every culture:
642 <strong>yyyy'-'MM'-'dd'T'HH':'mm':'ss</strong>.
58240a95 » InfinitiesLoop
2010-06-02 Added ability to specify multiple cultures at once. Added readme. Upd…
643 </p>
644 <p>
8faf8308 » eric-brechemier
2010-12-13 Reformatted comment lines to fit in 80 character width
645 When more specific control is needed over the formatting, you may use any
646 format you wish by specifing the the following custom tokens:
58240a95 » InfinitiesLoop
2010-06-02 Added ability to specify multiple cultures at once. Added readme. Upd…
647 <table>
648 <tr>
649 <th>Token</th>
650 <th>Meaning</th>
651 <th>Example</th>
652 </tr>
653 <tr>
654 <td>d</td>
655 <td>Day of month (no leading zero)</td>
656 <td>5</td>
657 </tr>
658 <tr>
659 <td>dd</td>
660 <td>Day of month (leading zero)</td>
661 <td>05</td>
662 </tr>
663 <tr>
664 <td>ddd</td>
665 <td>Day name (abbreviated)</td>
666 <td>Sat</td>
667 </tr>
668 <tr>
669 <td>dddd</td>
670 <td>Day name (full)</td>
671 <td>Saturday</td>
672 </tr>
673 <tr>
674 <td>M</td>
675 <td>Month of year (no leading zero)</td>
676 <td>9</td>
677 </tr>
678 <tr>
679 <td>MM</td>
680 <td>Month of year (leading zero)</td>
681 <td>09</td>
682 </tr>
683 <tr>
684 <td>MMM</td>
685 <td>Month name (abbreivated)</td>
686 <td>Sept</td>
687 </tr>
688 <tr>
689 <td>MMMM</td>
690 <td>Month name (full)</td>
691 <td>September</td>
692 </tr>
693 <tr>
694 <td>yy</td>
695 <td>Year (two digits)</td>
696 <td>55</td>
697 </tr>
698 <tr>
699 <td>yyyy</td>
700 <td>Year (four digits)</td>
701 <td>1955</td>
702 </tr>
703 <tr>
704 <td>'literal'</td>
705 <td>Literal Text</td>
706 <td>'Hmmmm'...</td>
707 </tr>
708 <tr>
709 <td>\'</td>
710 <td>Single Quote</td>
711 <td>&nbsp;</td>
712 </tr>
713 <tr>
714 <td>m</td>
715 <td>Minutes (no leading zero)</td>
716 <td>9</td>
717 </tr>
718 <tr>
719 <td>mm</td>
720 <td>Minutes (leading zero)</td>
721 <td>09</td>
722 </tr>
723 <tr>
724 <td>h</td>
725 <td>Hours (leading zero)</td>
726 <td>6</td>
727 </tr>
728 <tr>
729 <td>hh</td>
730 <td>Hours (leading zero)</td>
731 <td>06</td>
732 </tr>
733 <tr>
734 <td>H</td>
735 <td>Hours (24 hour time, no leading zero)</td>
736 <td>5 (5am) 15 (3pm)</td>
737 </tr>
738 <tr>
739 <td>HH</td>
740 <td>Hours (24 hour time, leading zero)</td>
741 <td>05 (5am) 15 (3pm)</td>
742 </tr>
743 <tr>
744 <td>s</td>
745 <td>Seconds (no leading zero)</td>
746 <td>9</td>
747 </tr>
748 <tr>
749 <td>ss</td>
750 <td>Seconds (leading zero)</td>
751 <td>09</td>
752 </tr>
753 <tr>
754 <td>f</td>
755 <td>Deciseconds</td>
756 <td>1</td>
757 </tr>
758 <tr>
759 <td>ff</td>
760 <td>Centiseconds</td>
761 <td>11</td>
762 </tr>
763 <tr>
764 <td>fff</td>
765 <td>Milliseconds</td>
766 <td>111</td>
767 </tr>
768 <tr>
769 <td>t</td>
770 <td>AM/PM indicator (first letter)</td>
771 <td>A or P</td>
772 </tr>
773 <tr>
774 <td>tt</td>
775 <td>AM/PM indicator (full)</td>
776 <td>AM or PM</td>
777 </tr>
778 <tr>
779 <td>z</td>
780 <td>Timezone offset (hours only, no leading zero)</td>
781 <td>-8</td>
782 </tr>
783 <tr>
784 <td>zz</td>
785 <td>Timezone offset (hours only, leading zero)</td>
786 <td>-08</td>
787 </tr>
788 <tr>
789 <td>zzz</td>
790 <td>Timezone offset (full hours/minutes)</td>
791 <td>-08:00</td>
792 </tr>
793 <tr>
794 <td>g or gg</td>
795 <td>Era name</td>
796 <td>A.D.</td>
797 </tr>
798 </table>
799 </p>
800
Something went wrong with that request. Please try again.