Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Initial commit

  • Loading branch information...
commit ba60889b874be5f02b72b368c31494c36cd12afb 0 parents
Cameron Dutro authored
Showing with 14,539 additions and 0 deletions.
  1. +1 −0  .gitignore
  2. +1 −0  CLDR_VERSION
  3. +177 −0 LICENSE
  4. +126 −0 README.md
  5. +1 −0  VERSION
  6. +39 −0 build.rb
  7. +415 −0 full/twitter_cldr_af.js
  8. +415 −0 full/twitter_cldr_ar.js
  9. +415 −0 full/twitter_cldr_ca.js
  10. +415 −0 full/twitter_cldr_cs.js
  11. +415 −0 full/twitter_cldr_da.js
  12. +415 −0 full/twitter_cldr_de.js
  13. +415 −0 full/twitter_cldr_el.js
  14. +415 −0 full/twitter_cldr_en.js
  15. +415 −0 full/twitter_cldr_es.js
  16. +415 −0 full/twitter_cldr_eu.js
  17. +415 −0 full/twitter_cldr_fa.js
  18. +415 −0 full/twitter_cldr_fi.js
  19. +415 −0 full/twitter_cldr_fil.js
  20. +415 −0 full/twitter_cldr_fr.js
  21. +415 −0 full/twitter_cldr_he.js
  22. +415 −0 full/twitter_cldr_hi.js
  23. +415 −0 full/twitter_cldr_hu.js
  24. +415 −0 full/twitter_cldr_id.js
  25. +415 −0 full/twitter_cldr_it.js
  26. +415 −0 full/twitter_cldr_ja.js
  27. +415 −0 full/twitter_cldr_ko.js
  28. +415 −0 full/twitter_cldr_msa.js
  29. +415 −0 full/twitter_cldr_nl.js
  30. +415 −0 full/twitter_cldr_no.js
  31. +415 −0 full/twitter_cldr_pl.js
  32. +415 −0 full/twitter_cldr_pt.js
  33. +415 −0 full/twitter_cldr_ru.js
  34. +415 −0 full/twitter_cldr_sv.js
  35. +415 −0 full/twitter_cldr_th.js
  36. +415 −0 full/twitter_cldr_tr.js
  37. +415 −0 full/twitter_cldr_uk.js
  38. +415 −0 full/twitter_cldr_ur.js
  39. +415 −0 full/twitter_cldr_zh-cn.js
  40. +415 −0 full/twitter_cldr_zh-tw.js
  41. +12 −0 min/twitter_cldr_af.min.js
  42. +12 −0 min/twitter_cldr_ar.min.js
  43. +12 −0 min/twitter_cldr_ca.min.js
  44. +12 −0 min/twitter_cldr_cs.min.js
  45. +12 −0 min/twitter_cldr_da.min.js
  46. +12 −0 min/twitter_cldr_de.min.js
  47. +12 −0 min/twitter_cldr_el.min.js
Sorry, we could not display the entire diff because it was too big.
1  .gitignore
@@ -0,0 +1 @@
+*.DS_Store
1  CLDR_VERSION
@@ -0,0 +1 @@
+21.0
177 LICENSE
@@ -0,0 +1,177 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
126 README.md
@@ -0,0 +1,126 @@
+## twitter-cldr-js
+
+TwitterCldr uses Unicode's Common Locale Data Repository (CLDR) to format certain types of text into their
+localized equivalents. At the moment, dates, times, time spans, and plural rules are supported by twitter-cldr-js. Check out [twitter-cldr-rb](http://github.com/twitter/twitter-cldr-rb) for the full-fledged Ruby version.
+
+### Generating the JavaScript
+
+The JavaScript files that make up twitter-cldr-js are automatically generated by twitter-cldr-rb. Detailed instructions on how to compile these files yourself can be found on the [twitter-cldr-rb Github page](http://github.com/twitter/twitter-cldr-rb).
+
+In addition, this repository contains a small Ruby script, `build.rb`, that can be used to export the JavaScript resources. You'll need to make sure you have Ruby, rubygems, and the twitter_cldr gem installed, then run the script:
+
+`OUTPUT_DIR=/path/to/desired/output/location ./build.rb`
+
+Not using `OUTPUT_DIR` will cause the files to be built in the current directory.
+
+### Requiring the Right File
+
+TwitterCLDR provides a single JavaScript file for each supported language under the `full` directory. Minified versions are available under the `min` directory. We've tried to keep the file sizes as small as possible to make TwitterCLDR a viable in-browser, client-side internationalization solution.
+
+Here's how you'd require the right file in HTML (Korean is used for these examples):
+
+```html
+<script src="min/twitter_cldr_ko.js"></script>
+```
+
+In Rails, you might do something like this:
+
+```erb
+<%= javascript_include_tag("#{Rails.env.development? "full" : "min"}/twitter_cldr_#{I18n.locale}.js") %>
+```
+
+### Dates and Times
+
+```javascript
+// include twitter_cldr_es.js for the Spanish DateTimeFormatter
+var fmt = new TwitterCldr.DateTimeFormatter();
+
+fmt.format(new Date(), {"type": "full"}); // "lunes, 12 de diciembre de 2011 21:44:57 UTC -0800"
+fmt.format(new Date(), {"type": "long"}); // "12 de diciembre de 201121:45:42 -08:00"
+fmt.format(new Date(), {"type": "medium"}); // "12/12/2011 21:46:09"
+fmt.format(new Date(), {"type": "short"}); // "12/12/11 21:47"
+
+fmt.format(new Date(), {"format": "date", "type": "full"}); // "lunes, 12 de diciembre de 2011"
+fmt.format(new Date(), {"format": "date", "type": "long"}); // "12 de diciembre de 2011"
+fmt.format(new Date(), {"format": "date", "type": "medium"}); // "12/12/2011"
+fmt.format(new Date(), {"format": "date", "type": "short"}); // "12/12/11"
+
+fmt.format(new Date(), {"format": "time", "type": "full"}); // "21:44:57 UTC -0800"
+fmt.format(new Date(), {"format": "time", "type": "long"}); // "21:45:42 -08:00"
+fmt.format(new Date(), {"format": "time", "type": "medium"}); // "21:46:09"
+fmt.format(new Date(), {"format": "time", "type": "short"}); // "21:47"
+```
+
+The CLDR data set only includes 4 specific date formats, full, long, medium, and short, so you'll have to choose amongst them for the one that best fits your needs. Yes, it's limiting, but the 4 formats get the job done most of the time :)
+
+#### Relative Dates and Times
+
+In addition to formatting full dates and times, TwitterCLDR supports relative time spans. It tries to guess the best time unit (eg. days, hours, minutes, etc) based on the length of time given. Indicate past or future by using negative or positive numbers respectively:
+
+```javascript
+// include twitter_cldr_en.js for the English TimespanFormatter
+var fmt = new TwitterCldr.TimespanFormatter();
+var then = Math.round(new Date(2012, 1, 1, 12, 0, 0).getTime() / 1000); // get seconds
+var now = Math.round(Date.now() / 1000); // get seconds
+
+fmt.format(then - now); // "6 months ago"
+fmt.format(then - now, {unit: "week"}); // "24 weeks ago"
+fmt.format(then - now, {unit: "year"}); // "0 years ago"
+fmt.format(then + now, {unit: "week"}); // "In 24 weeks"
+fmt.format(then + now, {unit: "year"}); // "In 0 years"
+```
+
+The `TimespanFormatter` can also handle time spans without a direction via the `direction: "none"` option. Directionless timespans can be combined with the `type` option:
+
+```javascript
+fmt.format(180, {direction: "none", type: "short"}); // "3 mins"
+fmt.format(180, {direction: "none", type: "abbreviated"}); // "3m"
+fmt.format(180, {direction: "none", type: "short", unit: "second"}); // "180 secs"
+```
+
+### Plural Rules
+
+Some languages, like English, have "countable" nouns. You probably know this concept better as "plural" and "singular", i.e. the difference between "strawberry" and "strawberries". Other languages, like Russian, have three plural forms: one (numbers ending in 1), few (numbers ending in 2, 3, or 4), and many (everything else). Still other languages like Japanese don't use countable nouns at all.
+
+TwitterCLDR makes it easy to find the plural rules for any numeric value:
+
+```javascript
+// include twitter_cldr_ru.js for access to Russian Plural rules
+TwitterCldr.PluralRules.rule_for(1); // "one"
+TwitterCldr.PluralRules.rule_for(2); // "few"
+TwitterCldr.PluralRules.rule_for(8); // "many"
+```
+
+Get all the rules for your language:
+
+```javascript
+TwitterCldr.PluralRules.all(); // ["one", "few", "many", "other"]
+```
+
+## Requirements
+
+There are no external requirements for these files, however running the JavaScript test suite that comes with twitter-cldr-rb requires qt to be installed.
+
+## Running Tests
+
+No tests specifically accompany these files, however a JavaScript test suite does exist as part of the twitter-cldr-rb project. Detailed instructions can be found on the twitter-cldr-rb Github page, but here's the quick version:
+
+1. Install qt (eg. `brew install qt`, `sudo apt-get install qt4`)
+2. Run `bundle`
+3. Run `bundle exec rake js:test`
+
+## Authors
+
+* Cameron C. Dutro: https://github.com/camertron
+* Portions taken from the ruby-cldr gem by Sven Fuchs: https://github.com/svenfuchs/ruby-cldr
+
+## Links
+* ruby-cldr gem: [https://github.com/svenfuchs/ruby-cldr](https://github.com/svenfuchs/ruby-cldr)
+* fast_gettext gem: [https://github.com/grosser/fast_gettext](https://github.com/grosser/fast_gettext)
+* CLDR homepage: [http://cldr.unicode.org/](http://cldr.unicode.org/)
+
+## License
+
+Copyright 2012 Twitter, Inc.
+
+Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0
1  VERSION
@@ -0,0 +1 @@
+1.6.2
39 build.rb
@@ -0,0 +1,39 @@
+#!/usr/bin/env ruby
+
+# This script builds and exports the JavaScript version of TwitterCLDR (http://github.com/twitter/twitter-cldr-rb).
+#
+# Run it like so:
+# OUTPUT_DIR=wherever/you/want ./build.rb
+#
+
+begin
+ require 'rubygems' unless ENV['NO_RUBYGEMS']
+rescue LoadError
+ puts "You need to have rubygems installed to continue. See: http://rubygems.org/pages/download/ for more info."
+end
+
+begin
+ require 'twitter_cldr'
+rescue LoadError
+ puts "You need to have the twitter_cldr gem installed. Run `gem install twitter_cldr`."
+end
+
+require 'fileutils'
+
+TwitterCldr.require_js
+
+if ENV["OUTPUT_DIR"]
+ build_dir = ENV["OUTPUT_DIR"]
+else
+ build_dir = Dir.pwd
+ puts "Building JavaScript files in the current directory."
+ puts "(Use the OUTPUT_DIR environment variable to override)"
+end
+
+$stdout.write("Building... ")
+$stdout.flush
+TwitterCldr::Js.output_dir = build_dir
+TwitterCldr::Js.make(:locales => TwitterCldr.supported_locales)
+TwitterCldr::Js.install
+
+puts "Done."
415 full/twitter_cldr_af.js
@@ -0,0 +1,415 @@
+/*
+// Copyright 2012 Twitter, Inc
+// http://www.apache.org/licenses/LICENSE-2.0
+
+// TwitterCLDR (JavaScript) v1.6.2
+// Authors: Cameron Dutro [@camertron]
+ Kirill Lashuk [@KL_7]
+ portions by Sven Fuchs [@svenfuchs]
+// Homepage: https://twitter.com
+// Description: Provides date, time, number, and list formatting functionality for various Twitter-supported locales in Javascript.
+*/
+
+var DateTimeFormatter, PluralRules, TimespanFormatter, TwitterCldr;
+
+TwitterCldr = {};
+
+TwitterCldr.PluralRules = PluralRules = (function() {
+
+ function PluralRules() {}
+
+ PluralRules.rules = {"keys": ["one","other"], "rule": function(n) { return (function() { if (n == 1) { return "one" } else { return "other" } })(); }};
+
+ PluralRules.all = function() {
+ return this.rules.keys;
+ };
+
+ PluralRules.rule_for = function(number) {
+ try {
+ return this.rules.rule(number);
+ } catch (error) {
+ return "other";
+ }
+ };
+
+ return PluralRules;
+
+})();
+
+TwitterCldr.TimespanFormatter = TimespanFormatter = (function() {
+
+ function TimespanFormatter() {
+ this.default_type = "default";
+ this.tokens = {"ago":{"second":{"default":{"one":[{"value":"1 sekonde gelede","type":"plaintext"}],"other":[{"value":"{0}","type":"placeholder"},{"value":" sekondes gelede","type":"plaintext"}]}},"minute":{"default":{"one":[{"value":"1 minuut gelede","type":"plaintext"}],"other":[{"value":"{0}","type":"placeholder"},{"value":" minute gelede","type":"plaintext"}]}},"hour":{"default":{"one":[{"value":"1 uur gelede","type":"plaintext"}],"other":[{"value":"{0}","type":"placeholder"},{"value":" uur gelede","type":"plaintext"}]}},"day":{"default":{"one":[{"value":"1 dag gelede","type":"plaintext"}],"other":[{"value":"{0}","type":"placeholder"},{"value":" dae gelede","type":"plaintext"}]}},"week":{"default":{"one":[{"value":"1 week gelede","type":"plaintext"}],"other":[{"value":"{0}","type":"placeholder"},{"value":" weke gelede","type":"plaintext"}]}},"month":{"default":{"one":[{"value":"1 maand gelede","type":"plaintext"}],"other":[{"value":"{0}","type":"placeholder"},{"value":" maande gelede","type":"plaintext"}]}},"year":{"default":{"one":[{"value":"1 jaar gelede","type":"plaintext"}],"other":[{"value":"{0}","type":"placeholder"},{"value":" jaar gelede","type":"plaintext"}]}}},"until":{"second":{"default":{"one":[{"value":"In 1 sekond","type":"plaintext"}],"other":[{"value":"In ","type":"plaintext"},{"value":"{0}","type":"placeholder"},{"value":" sekondes","type":"plaintext"}]}},"minute":{"default":{"one":[{"value":"In 1 minuut","type":"plaintext"}],"other":[{"value":"In ","type":"plaintext"},{"value":"{0}","type":"placeholder"},{"value":" minute","type":"plaintext"}]}},"hour":{"default":{"one":[{"value":"In 1 uur","type":"plaintext"}],"other":[{"value":"In ","type":"plaintext"},{"value":"{0}","type":"placeholder"},{"value":" uur","type":"plaintext"}]}},"day":{"default":{"one":[{"value":"In 1 dag","type":"plaintext"}],"other":[{"value":"In ","type":"plaintext"},{"value":"{0}","type":"placeholder"},{"value":" dae","type":"plaintext"}]}},"week":{"default":{"one":[{"value":"In 1 week","type":"plaintext"}],"other":[{"value":"In ","type":"plaintext"},{"value":"{0}","type":"placeholder"},{"value":" weke","type":"plaintext"}]}},"month":{"default":{"one":[{"value":"In 1 maand","type":"plaintext"}],"other":[{"value":"In ","type":"plaintext"},{"value":"{0}","type":"placeholder"},{"value":" maande","type":"plaintext"}]}},"year":{"default":{"one":[{"value":"In 1 jaar","type":"plaintext"}],"other":[{"value":"In ","type":"plaintext"},{"value":"{0}","type":"placeholder"},{"value":" jaar","type":"plaintext"}]}}},"none":{"second":{"default":{"one":[{"value":"1 sekonde","type":"plaintext"}],"other":[{"value":"{0}","type":"placeholder"},{"value":" sekondes","type":"plaintext"}]},"short":{"one":[{"value":"1 sek","type":"plaintext"}],"other":[{"value":"{0}","type":"placeholder"},{"value":" sek","type":"plaintext"}]},"abbreviated":{"one":[{"value":"{0}","type":"placeholder"},{"value":"s","type":"plaintext"}],"other":[{"value":"{0}","type":"placeholder"},{"value":"s","type":"plaintext"}]}},"minute":{"default":{"one":[{"value":"1 minuut","type":"plaintext"}],"other":[{"value":"{0}","type":"placeholder"},{"value":" minute","type":"plaintext"}]},"short":{"one":[{"value":"1 min","type":"plaintext"}],"other":[{"value":"{0}","type":"placeholder"},{"value":" min","type":"plaintext"}]},"abbreviated":{"one":[{"value":"{0}","type":"placeholder"},{"value":"m","type":"plaintext"}],"other":[{"value":"{0}","type":"placeholder"},{"value":"m","type":"plaintext"}]}},"hour":{"default":{"one":[{"value":"1 uur","type":"plaintext"}],"other":[{"value":"{0}","type":"placeholder"},{"value":" uur","type":"plaintext"}]},"short":{"one":[{"value":"1 uur","type":"plaintext"}],"other":[{"value":"{0}","type":"placeholder"},{"value":" uur","type":"plaintext"}]},"abbreviated":{"one":[{"value":"{0}","type":"placeholder"},{"value":"h","type":"plaintext"}],"other":[{"value":"{0}","type":"placeholder"},{"value":"h","type":"plaintext"}]}},"day":{"default":{"one":[{"value":"{0}","type":"placeholder"},{"value":" dag","type":"plaintext"}],"other":[{"value":"{0}","type":"placeholder"},{"value":" dae","type":"plaintext"}]},"short":{"one":[{"value":"1 dag","type":"plaintext"}],"other":[{"value":"{0}","type":"placeholder"},{"value":" dae","type":"plaintext"}]},"abbreviated":{"one":[{"value":"{0}","type":"placeholder"},{"value":"d","type":"plaintext"}],"other":[{"value":"{0}","type":"placeholder"},{"value":"d","type":"plaintext"}]}},"week":{"default":{"one":[{"value":"1 week","type":"plaintext"}],"other":[{"value":"{0}","type":"placeholder"},{"value":" weke","type":"plaintext"}]},"short":{"one":[{"value":"1 week","type":"plaintext"}],"other":[{"value":"{0}","type":"placeholder"},{"value":" weke","type":"plaintext"}]}},"month":{"default":{"one":[{"value":"1 maand","type":"plaintext"}],"other":[{"value":"{0}","type":"placeholder"},{"value":" maande","type":"plaintext"}]},"short":{"one":[{"value":"1 mnd","type":"plaintext"}],"other":[{"value":"{0}","type":"placeholder"},{"value":" mnde","type":"plaintext"}]}},"year":{"default":{"one":[{"value":"1 jaar","type":"plaintext"}],"other":[{"value":"{0}","type":"placeholder"},{"value":" jaar","type":"plaintext"}]},"short":{"one":[{"value":"1 jr","type":"plaintext"}],"other":[{"value":"{0}","type":"placeholder"},{"value":" jr","type":"plaintext"}]}}}};
+ this.time_in_seconds = {
+ "second": 1,
+ "minute": 60,
+ "hour": 3600,
+ "day": 86400,
+ "week": 604800,
+ "month": 2629743.83,
+ "year": 31556926
+ };
+ }
+
+ TimespanFormatter.prototype.format = function(seconds, options) {
+ var number, strings, token;
+ if (options == null) {
+ options = {};
+ }
+ options["direction"] || (options["direction"] = (seconds < 0 ? "ago" : "until"));
+ if (options["unit"] === null || options["unit"] === void 0) {
+ options["unit"] = this.calculate_unit(Math.abs(seconds));
+ }
+ options["type"] || (options["type"] = this.default_type);
+ options["number"] = this.calculate_time(Math.abs(seconds), options["unit"]);
+ number = this.calculate_time(Math.abs(seconds), options["unit"]);
+ options["rule"] = TwitterCldr.PluralRules.rule_for(number);
+ strings = (function() {
+ var _i, _len, _ref, _results;
+ _ref = this.tokens[options["direction"]][options["unit"]][options["type"]][options["rule"]];
+ _results = [];
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
+ token = _ref[_i];
+ _results.push(token.value);
+ }
+ return _results;
+ }).call(this);
+ return strings.join("").replace(/\{[0-9]\}/, number.toString());
+ };
+
+ TimespanFormatter.prototype.calculate_unit = function(seconds) {
+ if (seconds < 30) {
+ return "second";
+ } else if (seconds < 2670) {
+ return "minute";
+ } else if (seconds < 86369) {
+ return "hour";
+ } else if (seconds < 604800) {
+ return "day";
+ } else if (seconds < 2591969) {
+ return "week";
+ } else if (seconds < 31556926) {
+ return "month";
+ } else {
+ return "year";
+ }
+ };
+
+ TimespanFormatter.prototype.calculate_time = function(seconds, unit) {
+ return Math.round(seconds / this.time_in_seconds[unit]);
+ };
+
+ return TimespanFormatter;
+
+})();
+
+TwitterCldr.DateTimeFormatter = DateTimeFormatter = (function() {
+
+ function DateTimeFormatter() {
+ this.tokens = {"date_time":{"default":[{"value":"dd","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"MMM","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"y","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"h","type":"pattern"},{"value":":","type":"plaintext"},{"value":"mm","type":"pattern"},{"value":":","type":"plaintext"},{"value":"ss","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"a","type":"pattern"}],"full":[{"value":"EEEE","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"dd","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"MMMM","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"y","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"h","type":"pattern"},{"value":":","type":"plaintext"},{"value":"mm","type":"pattern"},{"value":":","type":"plaintext"},{"value":"ss","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"a","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"zzzz","type":"pattern"}],"long":[{"value":"dd","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"MMMM","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"y","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"h","type":"pattern"},{"value":":","type":"plaintext"},{"value":"mm","type":"pattern"},{"value":":","type":"plaintext"},{"value":"ss","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"a","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"z","type":"pattern"}],"medium":[{"value":"dd","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"MMM","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"y","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"h","type":"pattern"},{"value":":","type":"plaintext"},{"value":"mm","type":"pattern"},{"value":":","type":"plaintext"},{"value":"ss","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"a","type":"pattern"}],"short":[{"value":"yyyy","type":"pattern"},{"value":"-","type":"plaintext"},{"value":"MM","type":"pattern"},{"value":"-","type":"plaintext"},{"value":"dd","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"h","type":"pattern"},{"value":":","type":"plaintext"},{"value":"mm","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"a","type":"pattern"}]},"time":{"default":[{"value":"h","type":"pattern"},{"value":":","type":"plaintext"},{"value":"mm","type":"pattern"},{"value":":","type":"plaintext"},{"value":"ss","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"a","type":"pattern"}],"full":[{"value":"h","type":"pattern"},{"value":":","type":"plaintext"},{"value":"mm","type":"pattern"},{"value":":","type":"plaintext"},{"value":"ss","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"a","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"zzzz","type":"pattern"}],"long":[{"value":"h","type":"pattern"},{"value":":","type":"plaintext"},{"value":"mm","type":"pattern"},{"value":":","type":"plaintext"},{"value":"ss","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"a","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"z","type":"pattern"}],"medium":[{"value":"h","type":"pattern"},{"value":":","type":"plaintext"},{"value":"mm","type":"pattern"},{"value":":","type":"plaintext"},{"value":"ss","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"a","type":"pattern"}],"short":[{"value":"h","type":"pattern"},{"value":":","type":"plaintext"},{"value":"mm","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"a","type":"pattern"}]},"date":{"default":[{"value":"dd","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"MMM","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"y","type":"pattern"}],"full":[{"value":"EEEE","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"dd","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"MMMM","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"y","type":"pattern"}],"long":[{"value":"dd","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"MMMM","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"y","type":"pattern"}],"medium":[{"value":"dd","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"MMM","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"y","type":"pattern"}],"short":[{"value":"yyyy","type":"pattern"},{"value":"-","type":"plaintext"},{"value":"MM","type":"pattern"},{"value":"-","type":"plaintext"},{"value":"dd","type":"pattern"}]}};
+ this.calendar = {"days":{"format":{"abbreviated":{"fri":"Vr","mon":"Ma","sat":"Sa","sun":"So","thu":"Do","tue":"Di","wed":"Wo"},"narrow":{"fri":"V","mon":"M","sat":"S","sun":"S","thu":"D","tue":"D","wed":"W"},"wide":{"fri":"Vrydag","mon":"Maandag","sat":"Saterdag","sun":"Sondag","thu":"Donderdag","tue":"Dinsdag","wed":"Woensdag"}},"stand-alone":{"abbreviated":{"fri":"Vr","mon":"Ma","sat":"Sa","sun":"So","thu":"Do","tue":"Di","wed":"Wo"},"narrow":{"fri":"V","mon":"M","sat":"S","sun":"S","thu":"D","tue":"D","wed":"W"},"wide":{"fri":"Vrydag","mon":"Maandag","sat":"Saterdag","sun":"Sondag","thu":"Donderdag","tue":"Dinsdag","wed":"Woensdag"}}},"eras":{"abbr":{"0":"v.C.","1":"n.C."},"name":{"0":"voor Christus","1":"na Christus"},"narrow":{"0":""}},"fields":{"day":"Dag","dayperiod":"AM/PM","era":"Era","hour":"Uur","minute":"Minuut","month":"Maand","second":"Sekonde","week":"Week","weekday":"Weeksdag","year":"Jaar","zone":"Tydsone"},"formats":{"date":{"default":{"pattern":"dd MMM y"},"full":{"pattern":"EEEE dd MMMM y"},"long":{"pattern":"dd MMMM y"},"medium":{"pattern":"dd MMM y"},"short":{"pattern":"yyyy-MM-dd"}},"datetime":{"default":{"pattern":"{{date}} {{time}}"},"full":{"pattern":"{{date}} {{time}}"},"long":{"pattern":"{{date}} {{time}}"},"medium":{"pattern":"{{date}} {{time}}"},"short":{"pattern":"{{date}} {{time}}"}},"time":{"default":{"pattern":"h:mm:ss a"},"full":{"pattern":"h:mm:ss a zzzz"},"long":{"pattern":"h:mm:ss a z"},"medium":{"pattern":"h:mm:ss a"},"short":{"pattern":"h:mm a"}}},"months":{"format":{"abbreviated":{"1":"Jan","10":"Okt","11":"Nov","12":"Des","2":"Feb","3":"Mar","4":"Apr","5":"Mei","6":"Jun","7":"Jul","8":"Aug","9":"Sep"},"narrow":{"1":"J","10":"O","11":"N","12":"D","2":"F","3":"M","4":"A","5":"M","6":"J","7":"J","8":"A","9":"S"},"wide":{"1":"Januarie","10":"Oktober","11":"November","12":"Desember","2":"Februarie","3":"Maart","4":"April","5":"Mei","6":"Junie","7":"Julie","8":"Augustus","9":"September"}},"stand-alone":{"abbreviated":{"1":"Jan","10":"Okt","11":"Nov","12":"Des","2":"Feb","3":"Mar","4":"Apr","5":"Mei","6":"Jun","7":"Jul","8":"Aug","9":"Sep"},"narrow":{"1":"J","10":"O","11":"N","12":"D","2":"F","3":"M","4":"A","5":"M","6":"J","7":"J","8":"A","9":"S"},"wide":{"4":"April"}}},"periods":{"format":{"abbreviated":null,"narrow":null,"wide":{"am":"vm.","pm":"nm."}},"stand-alone":{}},"quarters":{"format":{"abbreviated":{"1":"K1","2":"K2","3":"K3","4":"K4"},"narrow":{"1":1,"2":2,"3":3,"4":4},"wide":{"1":"1ste kwartaal","2":"2de kwartaal","3":"3de kwartaal","4":"4de kwartaal"}},"stand-alone":{"abbreviated":{"1":"K1","2":"K2","3":"K3","4":"K4"},"narrow":{"1":1,"2":2,"3":3,"4":4},"wide":{"1":"1ste kwartaal","2":"2de kwartaal","3":"3de kwartaal","4":"4de kwartaal"}}}};
+ this.weekday_keys = ["sun", "mon", "tue", "wed", "thu", "fri", "sat"];
+ this.methods = {
+ 'G': 'era',
+ 'y': 'year',
+ 'Y': 'year_of_week_of_year',
+ 'Q': 'quarter',
+ 'q': 'quarter_stand_alone',
+ 'M': 'month',
+ 'L': 'month_stand_alone',
+ 'w': 'week_of_year',
+ 'W': 'week_of_month',
+ 'd': 'day',
+ 'D': 'day_of_month',
+ 'F': 'day_of_week_in_month',
+ 'E': 'weekday',
+ 'e': 'weekday_local',
+ 'c': 'weekday_local_stand_alone',
+ 'a': 'period',
+ 'h': 'hour',
+ 'H': 'hour',
+ 'K': 'hour',
+ 'k': 'hour',
+ 'm': 'minute',
+ 's': 'second',
+ 'S': 'second_fraction',
+ 'z': 'timezone',
+ 'Z': 'timezone',
+ 'v': 'timezone_generic_non_location',
+ 'V': 'timezone_metazone'
+ };
+ }
+
+ DateTimeFormatter.prototype.format = function(obj, options) {
+ var format_token, token, tokens,
+ _this = this;
+ format_token = function(token) {
+ var result;
+ result = "";
+ switch (token.type) {
+ case "pattern":
+ return _this.result_for_token(token, obj);
+ default:
+ if (token.value.length > 0 && token.value[0] === "'" && token.value[token.value.length - 1] === "'") {
+ return token.value.substring(1, token.value.length - 1);
+ } else {
+ return token.value;
+ }
+ }
+ };
+ tokens = this.get_tokens(obj, options);
+ return ((function() {
+ var _i, _len, _results;
+ _results = [];
+ for (_i = 0, _len = tokens.length; _i < _len; _i++) {
+ token = tokens[_i];
+ _results.push(format_token(token));
+ }
+ return _results;
+ })()).join("");
+ };
+
+ DateTimeFormatter.prototype.get_tokens = function(obj, options) {
+ return this.tokens[options.format || "date_time"][options.type || "default"];
+ };
+
+ DateTimeFormatter.prototype.result_for_token = function(token, date) {
+ return this[this.methods[token.value[0]]](date, token.value, token.value.length);
+ };
+
+ DateTimeFormatter.prototype.era = function(date, pattern, length) {
+ var choices, index;
+ switch (length) {
+ case 1:
+ case 2:
+ case 3:
+ choices = this.calendar["eras"]["abbr"];
+ break;
+ default:
+ choices = this.calendar["eras"]["name"];
+ }
+ index = date.getFullYear() < 0 ? 0 : 1;
+ return choices[index];
+ };
+
+ DateTimeFormatter.prototype.year = function(date, pattern, length) {
+ var year;
+ year = date.getFullYear().toString();
+ if (length === 2) {
+ if (year.length !== 1) {
+ year = year.slice(-2);
+ }
+ }
+ if (length > 1) {
+ year = ("0000" + year).slice(-length);
+ }
+ return year;
+ };
+
+ DateTimeFormatter.prototype.year_of_week_of_year = function(date, pattern, length) {
+ throw 'not implemented';
+ };
+
+ DateTimeFormatter.prototype.day_of_week_in_month = function(date, pattern, length) {
+ throw 'not implemented';
+ };
+
+ DateTimeFormatter.prototype.quarter = function(date, pattern, length) {
+ var quarter;
+ quarter = ((date.getMonth() / 3) | 0) + 1;
+ switch (length) {
+ case 1:
+ return quarter.toString();
+ case 2:
+ return ("0000" + quarter.toString()).slice(-length);
+ case 3:
+ return this.calendar.quarters.format.abbreviated[quarter];
+ case 4:
+ return this.calendar.quarters.format.wide[quarter];
+ }
+ };
+
+ DateTimeFormatter.prototype.quarter_stand_alone = function(date, pattern, length) {
+ var quarter;
+ quarter = (date.getMonth() - 1) / 3 + 1;
+ switch (length) {
+ case 1:
+ return quarter.toString();
+ case 2:
+ return ("0000" + quarter.toString()).slice(-length);
+ case 3:
+ throw 'not yet implemented (requires cldr\'s "multiple inheritance")';
+ break;
+ case 4:
+ throw 'not yet implemented (requires cldr\'s "multiple inheritance")';
+ break;
+ case 5:
+ return this.calendar.quarters['stand-alone'].narrow[quarter];
+ }
+ };
+
+ DateTimeFormatter.prototype.month = function(date, pattern, length) {
+ var month_str;
+ month_str = (date.getMonth() + 1).toString();
+ switch (length) {
+ case 1:
+ return month_str;
+ case 2:
+ return ("0000" + month_str).slice(-length);
+ case 3:
+ return this.calendar.months.format.abbreviated[month_str];
+ case 4:
+ return this.calendar.months.format.wide[month_str];
+ case 5:
+ throw 'not yet implemented (requires cldr\'s "multiple inheritance")';
+ break;
+ default:
+ throw "Unknown date format";
+ }
+ };
+
+ DateTimeFormatter.prototype.month_stand_alone = function(date, pattern, length) {
+ switch (length) {
+ case 1:
+ return date.getMonth().toString();
+ case 2:
+ return ("0000" + date.getMonth().toString()).slice(-length);
+ case 3:
+ throw 'not yet implemented (requires cldr\'s "multiple inheritance")';
+ break;
+ case 4:
+ throw 'not yet implemented (requires cldr\'s "multiple inheritance")';
+ break;
+ case 5:
+ return this.calendar.months['stand-alone'].narrow[date.month];
+ default:
+ throw "Unknown date format";
+ }
+ };
+
+ DateTimeFormatter.prototype.day = function(date, pattern, length) {
+ switch (length) {
+ case 1:
+ return date.getDate().toString();
+ case 2:
+ return ("0000" + date.getDate().toString()).slice(-length);
+ }
+ };
+
+ DateTimeFormatter.prototype.weekday = function(date, pattern, length) {
+ var key;
+ key = this.weekday_keys[date.getDay()];
+ switch (length) {
+ case 1:
+ case 2:
+ case 3:
+ return this.calendar.days.format.abbreviated[key];
+ case 4:
+ return this.calendar.days.format.wide[key];
+ case 5:
+ return this.calendar.days['stand-alone'].narrow[key];
+ }
+ };
+
+ DateTimeFormatter.prototype.weekday_local = function(date, pattern, length) {
+ var day;
+ switch (length) {
+ case 1:
+ case 2:
+ day = date.getDay();
+ return (day === 0 ? "7" : day.toString());
+ default:
+ return this.weekday(date, pattern, length);
+ }
+ };
+
+ DateTimeFormatter.prototype.weekday_local_stand_alone = function(date, pattern, length) {
+ switch (length) {
+ case 1:
+ return this.weekday_local(date, pattern, length);
+ default:
+ return this.weekday(date, pattern, length);
+ }
+ };
+
+ DateTimeFormatter.prototype.period = function(time, pattern, length) {
+ if (time.getHours() > 11) {
+ return this.calendar.periods.format.wide["pm"];
+ } else {
+ return this.calendar.periods.format.wide["am"];
+ }
+ };
+
+ DateTimeFormatter.prototype.hour = function(time, pattern, length) {
+ var hour;
+ hour = time.getHours();
+ switch (pattern[0]) {
+ case 'h':
+ if (hour > 12) {
+ hour = hour - 12;
+ } else if (hour === 0) {
+ hour = 12;
+ }
+ break;
+ case 'K':
+ if (hour > 11) {
+ hour = hour - 12;
+ }
+ break;
+ case 'k':
+ if (hour === 0) {
+ hour = 24;
+ }
+ }
+ if (length === 1) {
+ return hour.toString();
+ } else {
+ return ("000000" + hour.toString()).slice(-length);
+ }
+ };
+
+ DateTimeFormatter.prototype.minute = function(time, pattern, length) {
+ if (length === 1) {
+ return time.getMinutes().toString();
+ } else {
+ return ("000000" + time.getMinutes().toString()).slice(-length);
+ }
+ };
+
+ DateTimeFormatter.prototype.second = function(time, pattern, length) {
+ if (length === 1) {
+ return time.getSeconds().toString();
+ } else {
+ return ("000000" + time.getSeconds().toString()).slice(-length);
+ }
+ };
+
+ DateTimeFormatter.prototype.second_fraction = function(time, pattern, length) {
+ if (length > 6) {
+ throw 'can not use the S format with more than 6 digits';
+ }
+ return ("000000" + Math.round(Math.pow(time.getMilliseconds() * 100.0, 6 - length)).toString()).slice(-length);
+ };
+
+ DateTimeFormatter.prototype.timezone = function(time, pattern, length) {
+ var hours, minutes;
+ hours = ("00" + (time.getTimezoneOffset() / 60).toString()).slice(-2);
+ minutes = ("00" + (time.getTimezoneOffset() % 60).toString()).slice(-2);
+ switch (length) {
+ case 1:
+ case 2:
+ case 3:
+ return "-" + hours + ":" + minutes;
+ default:
+ return "UTC -" + hours + ":" + minutes;
+ }
+ };
+
+ DateTimeFormatter.prototype.timezone_generic_non_location = function(time, pattern, length) {
+ throw 'not yet implemented (requires timezone translation data")';
+ };
+
+ return DateTimeFormatter;
+
+})();
415 full/twitter_cldr_ar.js
@@ -0,0 +1,415 @@
+/*
+// Copyright 2012 Twitter, Inc
+// http://www.apache.org/licenses/LICENSE-2.0
+
+// TwitterCLDR (JavaScript) v1.6.2
+// Authors: Cameron Dutro [@camertron]
+ Kirill Lashuk [@KL_7]
+ portions by Sven Fuchs [@svenfuchs]
+// Homepage: https://twitter.com
+// Description: Provides date, time, number, and list formatting functionality for various Twitter-supported locales in Javascript.
+*/
+
+var DateTimeFormatter, PluralRules, TimespanFormatter, TwitterCldr;
+
+TwitterCldr = {};
+
+TwitterCldr.PluralRules = PluralRules = (function() {
+
+ function PluralRules() {}
+
+ PluralRules.rules = {"keys": ["zero","one","two","few","many","other"], "rule": function(n) { return (function() { if (n == 0) { return "zero" } else { return (function() { if (n == 1) { return "one" } else { return (function() { if (n == 2) { return "two" } else { return (function() { if ([3, 4, 5, 6, 7, 8, 9, 10].indexOf(n % 100) >= 0) { return "few" } else { return (function() { if ([11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99].indexOf(n % 100) >= 0) { return "many" } else { return "other" } })(); } })(); } })(); } })(); } })(); }};
+
+ PluralRules.all = function() {
+ return this.rules.keys;
+ };
+
+ PluralRules.rule_for = function(number) {
+ try {
+ return this.rules.rule(number);
+ } catch (error) {
+ return "other";
+ }
+ };
+
+ return PluralRules;
+
+})();
+
+TwitterCldr.TimespanFormatter = TimespanFormatter = (function() {
+
+ function TimespanFormatter() {
+ this.default_type = "default";
+ this.tokens = {"ago":{"second":{"default":{"zero":[{"value":"قبل 0 ثانية","type":"plaintext"}],"one":[{"value":"قبل ثانية واحدة","type":"plaintext"}],"two":[{"value":"قبل ثانيتين","type":"plaintext"}],"few":[{"value":"قبل ","type":"plaintext"},{"value":"{0}","type":"placeholder"},{"value":" ثوانِ","type":"plaintext"}],"many":[{"value":"قبل ","type":"plaintext"},{"value":"{0}","type":"placeholder"},{"value":" ثانية","type":"plaintext"}],"other":[{"value":"قبل ","type":"plaintext"},{"value":"{0}","type":"placeholder"},{"value":" من الثواني","type":"plaintext"}]}},"minute":{"default":{"zero":[{"value":"قبل 0 دقيقة","type":"plaintext"}],"one":[{"value":"قبل دقيقة واحدة","type":"plaintext"}],"two":[{"value":"قبل دقيقتين","type":"plaintext"}],"few":[{"value":"قبل ","type":"plaintext"},{"value":"{0}","type":"placeholder"},{"value":" دقائق","type":"plaintext"}],"many":[{"value":"قبل ","type":"plaintext"},{"value":"{0}","type":"placeholder"},{"value":" دقيقة","type":"plaintext"}],"other":[{"value":"قبل ","type":"plaintext"},{"value":"{0}","type":"placeholder"},{"value":" من الدقائق","type":"plaintext"}]}},"hour":{"default":{"zero":[{"value":"قبل 0 ساعة","type":"plaintext"}],"one":[{"value":"قبل ساعة واحدة","type":"plaintext"}],"two":[{"value":"قبل ساعتين","type":"plaintext"}],"few":[{"value":"قبل ","type":"plaintext"},{"value":"{0}","type":"placeholder"},{"value":" ساعات","type":"plaintext"}],"many":[{"value":"قبل ","type":"plaintext"},{"value":"{0}","type":"placeholder"},{"value":" ساعة","type":"plaintext"}],"other":[{"value":"قبل ","type":"plaintext"},{"value":"{0}","type":"placeholder"},{"value":" من الساعات","type":"plaintext"}]}},"day":{"default":{"zero":[{"value":"قبل 0 يوم","type":"plaintext"}],"one":[{"value":"قبل يوم واحد","type":"plaintext"}],"two":[{"value":"قبل يومين","type":"plaintext"}],"few":[{"value":"قبل ","type":"plaintext"},{"value":"{0}","type":"placeholder"},{"value":" أيام","type":"plaintext"}],"many":[{"value":"قبل ","type":"plaintext"},{"value":"{0}","type":"placeholder"},{"value":" يومًا","type":"plaintext"}],"other":[{"value":"قبل ","type":"plaintext"},{"value":"{0}","type":"placeholder"},{"value":" من الأيام","type":"plaintext"}]}},"week":{"default":{"zero":[{"value":"قبل 0 أسبوع","type":"plaintext"}],"one":[{"value":"قبل أسبوع واحد","type":"plaintext"}],"two":[{"value":"قبل أسبوعين","type":"plaintext"}],"few":[{"value":"قبل ","type":"plaintext"},{"value":"{0}","type":"placeholder"},{"value":" أسابيع","type":"plaintext"}],"many":[{"value":"قبل ","type":"plaintext"},{"value":"{0}","type":"placeholder"},{"value":" أسبوعًا","type":"plaintext"}],"other":[{"value":"قبل ","type":"plaintext"},{"value":"{0}","type":"placeholder"},{"value":" من الأسابيع","type":"plaintext"}]}},"month":{"default":{"zero":[{"value":"قبل 0 شهر","type":"plaintext"}],"one":[{"value":"قبل شهر واحد","type":"plaintext"}],"two":[{"value":"قبل شهرين","type":"plaintext"}],"few":[{"value":"قبل ","type":"plaintext"},{"value":"{0}","type":"placeholder"},{"value":" أشهر","type":"plaintext"}],"many":[{"value":"قبل ","type":"plaintext"},{"value":"{0}","type":"placeholder"},{"value":" شهرًا","type":"plaintext"}],"other":[{"value":"قبل ","type":"plaintext"},{"value":"{0}","type":"placeholder"},{"value":" من الشهور","type":"plaintext"}]}},"year":{"default":{"zero":[{"value":"قبل 0 سنة","type":"plaintext"}],"one":[{"value":"قبل سنة واحدة","type":"plaintext"}],"two":[{"value":"قبل سنتين","type":"plaintext"}],"few":[{"value":"قبل ","type":"plaintext"},{"value":"{0}","type":"placeholder"},{"value":" سنوات","type":"plaintext"}],"many":[{"value":"قبل ","type":"plaintext"},{"value":"{0}","type":"placeholder"},{"value":" سنة","type":"plaintext"}],"other":[{"value":"قبل ","type":"plaintext"},{"value":"{0}","type":"placeholder"},{"value":" من السنوات","type":"plaintext"}]}}},"until":{"second":{"default":{"zero":[{"value":"خلال 0 ثانية","type":"plaintext"}],"one":[{"value":"خلال ثانية واحدة","type":"plaintext"}],"two":[{"value":"خلال ثانيتين","type":"plaintext"}],"few":[{"value":"خلال ","type":"plaintext"},{"value":"{0}","type":"placeholder"},{"value":" ثوانِ","type":"plaintext"}],"many":[{"value":"خلال ","type":"plaintext"},{"value":"{0}","type":"placeholder"},{"value":" ثانية","type":"plaintext"}],"other":[{"value":"خلال ","type":"plaintext"},{"value":"{0}","type":"placeholder"},{"value":" من الثواني","type":"plaintext"}]}},"minute":{"default":{"zero":[{"value":"خلال 0 دقيقة","type":"plaintext"}],"one":[{"value":"خلال دقيقة واحدة","type":"plaintext"}],"two":[{"value":"خلال دقيقتين","type":"plaintext"}],"few":[{"value":"خلال ","type":"plaintext"},{"value":"{0}","type":"placeholder"},{"value":" دقائق","type":"plaintext"}],"many":[{"value":"خلال ","type":"plaintext"},{"value":"{0}","type":"placeholder"},{"value":" دقيقة","type":"plaintext"}],"other":[{"value":"خلال ","type":"plaintext"},{"value":"{0}","type":"placeholder"},{"value":" من الدقائق","type":"plaintext"}]}},"hour":{"default":{"zero":[{"value":"خلال 0 ساعة","type":"plaintext"}],"one":[{"value":"خلال ساعة واحدة","type":"plaintext"}],"two":[{"value":"خلال ساعتين","type":"plaintext"}],"few":[{"value":"خلال ","type":"plaintext"},{"value":"{0}","type":"placeholder"},{"value":" ساعات","type":"plaintext"}],"many":[{"value":"خلال ","type":"plaintext"},{"value":"{0}","type":"placeholder"},{"value":" ساعة","type":"plaintext"}],"other":[{"value":"خلال ","type":"plaintext"},{"value":"{0}","type":"placeholder"},{"value":" من الساعات","type":"plaintext"}]}},"day":{"default":{"zero":[{"value":"خلال 0 يوم","type":"plaintext"}],"one":[{"value":"خلال يوم واحد","type":"plaintext"}],"two":[{"value":"خلال يومين","type":"plaintext"}],"few":[{"value":"خلال ","type":"plaintext"},{"value":"{0}","type":"placeholder"},{"value":" أيام","type":"plaintext"}],"many":[{"value":"خلال ","type":"plaintext"},{"value":"{0}","type":"placeholder"},{"value":" يومًا","type":"plaintext"}],"other":[{"value":"خلال ","type":"plaintext"},{"value":"{0}","type":"placeholder"},{"value":" من الأيام","type":"plaintext"}]}},"week":{"default":{"zero":[{"value":"خلال 0 أسبوع","type":"plaintext"}],"one":[{"value":"خلال أسبوع واحد","type":"plaintext"}],"two":[{"value":"خلال أسبوعين","type":"plaintext"}],"few":[{"value":"خلال ","type":"plaintext"},{"value":"{0}","type":"placeholder"},{"value":" أسابيع","type":"plaintext"}],"many":[{"value":"خلال ","type":"plaintext"},{"value":"{0}","type":"placeholder"},{"value":" أسبوعًا","type":"plaintext"}],"other":[{"value":"خلال ","type":"plaintext"},{"value":"{0}","type":"placeholder"},{"value":" من الأسابيع","type":"plaintext"}]}},"month":{"default":{"zero":[{"value":"خلال 0 شهر","type":"plaintext"}],"one":[{"value":"خلال شهر واحد","type":"plaintext"}],"two":[{"value":"خلال شهرين","type":"plaintext"}],"few":[{"value":"خلال ","type":"plaintext"},{"value":"{0}","type":"placeholder"},{"value":" شهور","type":"plaintext"}],"many":[{"value":"خلال ","type":"plaintext"},{"value":"{0}","type":"placeholder"},{"value":" شهرًا","type":"plaintext"}],"other":[{"value":"خلال ","type":"plaintext"},{"value":"{0}","type":"placeholder"},{"value":" من الشهور","type":"plaintext"}]}},"year":{"default":{"zero":[{"value":"خلال 0 سنة","type":"plaintext"}],"one":[{"value":"خلال سنة واحدة","type":"plaintext"}],"two":[{"value":"خلال سنتين","type":"plaintext"}],"few":[{"value":"خلال ","type":"plaintext"},{"value":"{0}","type":"placeholder"},{"value":" سنوات","type":"plaintext"}],"many":[{"value":"خلال ","type":"plaintext"},{"value":"{0}","type":"placeholder"},{"value":" سنة","type":"plaintext"}],"other":[{"value":"خلال ","type":"plaintext"},{"value":"{0}","type":"placeholder"},{"value":" من السنوات","type":"plaintext"}]}}},"none":{"second":{"default":{"zero":[{"value":"لا ثوان","type":"plaintext"}],"one":[{"value":"ثانية","type":"plaintext"}],"two":[{"value":"ثانيتان","type":"plaintext"}],"few":[{"value":"{0}","type":"placeholder"},{"value":" ثوان","type":"plaintext"}],"many":[{"value":"{0}","type":"placeholder"},{"value":" ثانيةً","type":"plaintext"}],"other":[{"value":"{0}","type":"placeholder"},{"value":" ثانية","type":"plaintext"}]},"short":{"zero":[{"value":"لا ثوان","type":"plaintext"}],"one":[{"value":"ثانية","type":"plaintext"}],"two":[{"value":"ثانيتان","type":"plaintext"}],"few":[{"value":"{0}","type":"placeholder"},{"value":" ث","type":"plaintext"}],"many":[{"value":"{0}","type":"placeholder"},{"value":" ث","type":"plaintext"}],"other":[{"value":"{0}","type":"placeholder"},{"value":" ث","type":"plaintext"}]},"abbreviated":{"zero":[{"value":"{0}","type":"placeholder"},{"value":" ثانية","type":"plaintext"}],"one":[{"value":"{0}","type":"placeholder"},{"value":" ثانية","type":"plaintext"}],"two":[{"value":"{0}","type":"placeholder"},{"value":" ثانية","type":"plaintext"}],"few":[{"value":"{0}","type":"placeholder"},{"value":" ثانية","type":"plaintext"}],"many":[{"value":"{0}","type":"placeholder"},{"value":" ثانية","type":"plaintext"}],"other":[{"value":"{0}","type":"placeholder"},{"value":" ثانية","type":"plaintext"}]}},"minute":{"default":{"zero":[{"value":"لا دقائق","type":"plaintext"}],"one":[{"value":"دقيقة","type":"plaintext"}],"two":[{"value":"دقيقتان","type":"plaintext"}],"few":[{"value":"{0}","type":"placeholder"},{"value":" دقائق","type":"plaintext"}],"many":[{"value":"{0}","type":"placeholder"},{"value":" دقيقةً","type":"plaintext"}],"other":[{"value":"{0}","type":"placeholder"},{"value":" دقيقة","type":"plaintext"}]},"short":{"zero":[{"value":"لا دقائق","type":"plaintext"}],"one":[{"value":"دقيقة","type":"plaintext"}],"two":[{"value":"دقيقتان","type":"plaintext"}],"few":[{"value":"{0}","type":"placeholder"},{"value":" د","type":"plaintext"}],"many":[{"value":"{0}","type":"placeholder"},{"value":" د","type":"plaintext"}],"other":[{"value":"{0}","type":"placeholder"},{"value":" د","type":"plaintext"}]},"abbreviated":{"zero":[{"value":"{0}","type":"placeholder"},{"value":" دقيقة","type":"plaintext"}],"one":[{"value":"{0}","type":"placeholder"},{"value":" دقيقة","type":"plaintext"}],"two":[{"value":"{0}","type":"placeholder"},{"value":" دقيقة","type":"plaintext"}],"few":[{"value":"{0}","type":"placeholder"},{"value":" دقيقة","type":"plaintext"}],"many":[{"value":"{0}","type":"placeholder"},{"value":" دقيقة","type":"plaintext"}],"other":[{"value":"{0}","type":"placeholder"},{"value":" دقيقة","type":"plaintext"}]}},"hour":{"default":{"zero":[{"value":"لا ساعات","type":"plaintext"}],"one":[{"value":"ساعة","type":"plaintext"}],"two":[{"value":"ساعتان","type":"plaintext"}],"few":[{"value":"{0}","type":"placeholder"},{"value":" ساعات","type":"plaintext"}],"many":[{"value":"{0}","type":"placeholder"},{"value":" ساعةً","type":"plaintext"}],"other":[{"value":"{0}","type":"placeholder"},{"value":" ساعة","type":"plaintext"}]},"short":{"zero":[{"value":"لا ساعات","type":"plaintext"}],"one":[{"value":"ساعة","type":"plaintext"}],"two":[{"value":"ساعتان","type":"plaintext"}],"few":[{"value":"{0}","type":"placeholder"},{"value":" س","type":"plaintext"}],"many":[{"value":"{0}","type":"placeholder"},{"value":" س","type":"plaintext"}],"other":[{"value":"{0}","type":"placeholder"},{"value":" س","type":"plaintext"}]},"abbreviated":{"zero":[{"value":"{0}","type":"placeholder"},{"value":" ساعة","type":"plaintext"}],"one":[{"value":"{0}","type":"placeholder"},{"value":" ساعة","type":"plaintext"}],"two":[{"value":"{0}","type":"placeholder"},{"value":" ساعة","type":"plaintext"}],"few":[{"value":"{0}","type":"placeholder"},{"value":" ساعة","type":"plaintext"}],"many":[{"value":"{0}","type":"placeholder"},{"value":" ساعة","type":"plaintext"}],"other":[{"value":"{0}","type":"placeholder"},{"value":" ساعة","type":"plaintext"}]}},"day":{"default":{"zero":[{"value":"لا أيام","type":"plaintext"}],"one":[{"value":"يوم","type":"plaintext"}],"two":[{"value":"يومان","type":"plaintext"}],"few":[{"value":"{0}","type":"placeholder"},{"value":" أيام","type":"plaintext"}],"many":[{"value":"{0}","type":"placeholder"},{"value":" يوماً","type":"plaintext"}],"other":[{"value":"{0}","type":"placeholder"},{"value":" يوم","type":"plaintext"}]},"short":{"zero":[{"value":"لا أيام","type":"plaintext"}],"one":[{"value":"يوم","type":"plaintext"}],"two":[{"value":"يومان","type":"plaintext"}],"few":[{"value":"{0}","type":"placeholder"},{"value":" أيام","type":"plaintext"}],"many":[{"value":"{0}","type":"placeholder"},{"value":" يوماً","type":"plaintext"}],"other":[{"value":"{0}","type":"placeholder"},{"value":" يوم","type":"plaintext"}]},"abbreviated":{"zero":[{"value":"{0}","type":"placeholder"},{"value":" يوم","type":"plaintext"}],"one":[{"value":"{0}","type":"placeholder"},{"value":" يوم","type":"plaintext"}],"two":[{"value":"{0}","type":"placeholder"},{"value":" يوم","type":"plaintext"}],"few":[{"value":"{0}","type":"placeholder"},{"value":" يوم","type":"plaintext"}],"many":[{"value":"{0}","type":"placeholder"},{"value":" يوم","type":"plaintext"}],"other":[{"value":"{0}","type":"placeholder"},{"value":" يوم","type":"plaintext"}]}},"week":{"default":{"zero":[{"value":"لا أسابيع","type":"plaintext"}],"one":[{"value":"أسبوع","type":"plaintext"}],"two":[{"value":"أسبوعان","type":"plaintext"}],"few":[{"value":"{0}","type":"placeholder"},{"value":" أسابيع","type":"plaintext"}],"many":[{"value":"{0}","type":"placeholder"},{"value":" أسبوعاً","type":"plaintext"}],"other":[{"value":"{0}","type":"placeholder"},{"value":" أسبوع","type":"plaintext"}]},"short":{"zero":[{"value":"لا أسابيع","type":"plaintext"}],"one":[{"value":"أسبوع","type":"plaintext"}],"two":[{"value":"أسبوعان","type":"plaintext"}],"few":[{"value":"{0}","type":"placeholder"},{"value":" أسابيع","type":"plaintext"}],"many":[{"value":"{0}","type":"placeholder"},{"value":" أسبوعاً","type":"plaintext"}],"other":[{"value":"{0}","type":"placeholder"},{"value":" أسبوع","type":"plaintext"}]}},"month":{"default":{"zero":[{"value":"لا أشهر","type":"plaintext"}],"one":[{"value":"شهر","type":"plaintext"}],"two":[{"value":"شهران","type":"plaintext"}],"few":[{"value":"{0}","type":"placeholder"},{"value":" أشهر","type":"plaintext"}],"many":[{"value":"{0}","type":"placeholder"},{"value":" شهراً","type":"plaintext"}],"other":[{"value":"{0}","type":"placeholder"},{"value":" شهر","type":"plaintext"}]},"short":{"zero":[{"value":"لا أشهر","type":"plaintext"}],"one":[{"value":"شهر","type":"plaintext"}],"two":[{"value":"شهران","type":"plaintext"}],"few":[{"value":"{0}","type":"placeholder"},{"value":" أشهر","type":"plaintext"}],"many":[{"value":"{0}","type":"placeholder"},{"value":" شهراً","type":"plaintext"}],"other":[{"value":"{0}","type":"placeholder"},{"value":" شهر","type":"plaintext"}]}},"year":{"default":{"zero":[{"value":"لا سنوات","type":"plaintext"}],"one":[{"value":"سنة","type":"plaintext"}],"two":[{"value":"سنتان","type":"plaintext"}],"few":[{"value":"{0}","type":"placeholder"},{"value":" سنوات","type":"plaintext"}],"many":[{"value":"{0}","type":"placeholder"},{"value":" سنةً","type":"plaintext"}],"other":[{"value":"{0}","type":"placeholder"},{"value":" سنة","type":"plaintext"}]},"short":{"zero":[{"value":"لا سنوات","type":"plaintext"}],"one":[{"value":"سنة","type":"plaintext"}],"two":[{"value":"سنتان","type":"plaintext"}],"few":[{"value":"{0}","type":"placeholder"},{"value":" سنوات","type":"plaintext"}],"many":[{"value":"{0}","type":"placeholder"},{"value":" سنةً","type":"plaintext"}],"other":[{"value":"{0}","type":"placeholder"},{"value":" سنة","type":"plaintext"}]}}}};
+ this.time_in_seconds = {
+ "second": 1,
+ "minute": 60,
+ "hour": 3600,
+ "day": 86400,
+ "week": 604800,
+ "month": 2629743.83,
+ "year": 31556926
+ };
+ }
+
+ TimespanFormatter.prototype.format = function(seconds, options) {
+ var number, strings, token;
+ if (options == null) {
+ options = {};
+ }
+ options["direction"] || (options["direction"] = (seconds < 0 ? "ago" : "until"));
+ if (options["unit"] === null || options["unit"] === void 0) {
+ options["unit"] = this.calculate_unit(Math.abs(seconds));
+ }
+ options["type"] || (options["type"] = this.default_type);
+ options["number"] = this.calculate_time(Math.abs(seconds), options["unit"]);
+ number = this.calculate_time(Math.abs(seconds), options["unit"]);
+ options["rule"] = TwitterCldr.PluralRules.rule_for(number);
+ strings = (function() {
+ var _i, _len, _ref, _results;
+ _ref = this.tokens[options["direction"]][options["unit"]][options["type"]][options["rule"]];
+ _results = [];
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
+ token = _ref[_i];
+ _results.push(token.value);
+ }
+ return _results;
+ }).call(this);
+ return strings.join("").replace(/\{[0-9]\}/, number.toString());
+ };
+
+ TimespanFormatter.prototype.calculate_unit = function(seconds) {
+ if (seconds < 30) {
+ return "second";
+ } else if (seconds < 2670) {
+ return "minute";
+ } else if (seconds < 86369) {
+ return "hour";
+ } else if (seconds < 604800) {
+ return "day";
+ } else if (seconds < 2591969) {
+ return "week";
+ } else if (seconds < 31556926) {
+ return "month";
+ } else {
+ return "year";
+ }
+ };
+
+ TimespanFormatter.prototype.calculate_time = function(seconds, unit) {
+ return Math.round(seconds / this.time_in_seconds[unit]);
+ };
+
+ return TimespanFormatter;
+
+})();
+
+TwitterCldr.DateTimeFormatter = DateTimeFormatter = (function() {
+
+ function DateTimeFormatter() {
+ this.tokens = {"date_time":{"default":[{"value":"dd","type":"pattern"},{"value":"‏/","type":"plaintext"},{"value":"MM","type":"pattern"},{"value":"‏/","type":"plaintext"},{"value":"yyyy","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"h","type":"pattern"},{"value":":","type":"plaintext"},{"value":"mm","type":"pattern"},{"value":":","type":"plaintext"},{"value":"ss","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"a","type":"pattern"}],"full":[{"value":"EEEE","type":"pattern"},{"value":"، ","type":"plaintext"},{"value":"d","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"MMMM","type":"pattern"},{"value":"، ","type":"plaintext"},{"value":"y","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"zzzz","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"h","type":"pattern"},{"value":":","type":"plaintext"},{"value":"mm","type":"pattern"},{"value":":","type":"plaintext"},{"value":"ss","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"a","type":"pattern"}],"long":[{"value":"d","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"MMMM","type":"pattern"},{"value":"، ","type":"plaintext"},{"value":"y","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"z","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"h","type":"pattern"},{"value":":","type":"plaintext"},{"value":"mm","type":"pattern"},{"value":":","type":"plaintext"},{"value":"ss","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"a","type":"pattern"}],"medium":[{"value":"dd","type":"pattern"},{"value":"‏/","type":"plaintext"},{"value":"MM","type":"pattern"},{"value":"‏/","type":"plaintext"},{"value":"yyyy","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"h","type":"pattern"},{"value":":","type":"plaintext"},{"value":"mm","type":"pattern"},{"value":":","type":"plaintext"},{"value":"ss","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"a","type":"pattern"}],"short":[{"value":"d","type":"pattern"},{"value":"‏/","type":"plaintext"},{"value":"M","type":"pattern"},{"value":"‏/","type":"plaintext"},{"value":"yyyy","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"h","type":"pattern"},{"value":":","type":"plaintext"},{"value":"mm","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"a","type":"pattern"}]},"time":{"default":[{"value":"h","type":"pattern"},{"value":":","type":"plaintext"},{"value":"mm","type":"pattern"},{"value":":","type":"plaintext"},{"value":"ss","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"a","type":"pattern"}],"full":[{"value":"zzzz","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"h","type":"pattern"},{"value":":","type":"plaintext"},{"value":"mm","type":"pattern"},{"value":":","type":"plaintext"},{"value":"ss","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"a","type":"pattern"}],"long":[{"value":"z","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"h","type":"pattern"},{"value":":","type":"plaintext"},{"value":"mm","type":"pattern"},{"value":":","type":"plaintext"},{"value":"ss","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"a","type":"pattern"}],"medium":[{"value":"h","type":"pattern"},{"value":":","type":"plaintext"},{"value":"mm","type":"pattern"},{"value":":","type":"plaintext"},{"value":"ss","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"a","type":"pattern"}],"short":[{"value":"h","type":"pattern"},{"value":":","type":"plaintext"},{"value":"mm","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"a","type":"pattern"}]},"date":{"default":[{"value":"dd","type":"pattern"},{"value":"‏/","type":"plaintext"},{"value":"MM","type":"pattern"},{"value":"‏/","type":"plaintext"},{"value":"yyyy","type":"pattern"}],"full":[{"value":"EEEE","type":"pattern"},{"value":"، ","type":"plaintext"},{"value":"d","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"MMMM","type":"pattern"},{"value":"، ","type":"plaintext"},{"value":"y","type":"pattern"}],"long":[{"value":"d","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"MMMM","type":"pattern"},{"value":"، ","type":"plaintext"},{"value":"y","type":"pattern"}],"medium":[{"value":"dd","type":"pattern"},{"value":"‏/","type":"plaintext"},{"value":"MM","type":"pattern"},{"value":"‏/","type":"plaintext"},{"value":"yyyy","type":"pattern"}],"short":[{"value":"d","type":"pattern"},{"value":"‏/","type":"plaintext"},{"value":"M","type":"pattern"},{"value":"‏/","type":"plaintext"},{"value":"yyyy","type":"pattern"}]}};
+ this.calendar = {"days":{"format":{"abbreviated":{"fri":"الجمعة","mon":"الاثنين","sat":"السبت","sun":"الأحد","thu":"الخميس","tue":"الثلاثاء","wed":"الأربعاء"},"narrow":{"fri":"ج","mon":"ن","sat":"س","sun":"ح","thu":"خ","tue":"ث","wed":"ر"},"wide":{"fri":"الجمعة","mon":"الاثنين","sat":"السبت","sun":"الأحد","thu":"الخميس","tue":"الثلاثاء","wed":"الأربعاء"}},"stand-alone":{"abbreviated":{"fri":"الجمعة","mon":"الاثنين","sat":"السبت","sun":"الأحد","thu":"الخميس","tue":"الثلاثاء","wed":"الأربعاء"},"narrow":{"fri":"ج","mon":"ن","sat":"س","sun":"ح","thu":"خ","tue":"ث","wed":"ر"},"wide":{"mon":"الاثنين"}}},"eras":{"abbr":{"0":"ق.م","1":"م"},"name":{"0":"قبل الميلاد","1":"ميلادي"},"narrow":{"0":""}},"fields":{"day":"يوم","dayperiod":"ص/م","era":"العصر","hour":"الساعات","minute":"الدقائق","month":"الشهر","second":"الثواني","week":"الأسبوع","weekday":"اليوم","year":"السنة","zone":"التوقيت"},"formats":{"date":{"default":{"pattern":"dd‏/MM‏/yyyy"},"full":{"pattern":"EEEE، d MMMM، y"},"long":{"pattern":"d MMMM، y"},"medium":{"pattern":"dd‏/MM‏/yyyy"},"short":{"pattern":"d‏/M‏/yyyy"}},"datetime":{"default":{"pattern":"{{date}} {{time}}"},"full":{"pattern":"{{date}} {{time}}"},"long":{"pattern":"{{date}} {{time}}"},"medium":{"pattern":"{{date}} {{time}}"},"short":{"pattern":"{{date}} {{time}}"}},"time":{"default":{"pattern":"h:mm:ss a"},"full":{"pattern":"zzzz h:mm:ss a"},"long":{"pattern":"z h:mm:ss a"},"medium":{"pattern":"h:mm:ss a"},"short":{"pattern":"h:mm a"}}},"months":{"format":{"abbreviated":{"1":"يناير","10":"أكتوبر","11":"نوفمبر","12":"ديسمبر","2":"فبراير","3":"مارس","4":"أبريل","5":"مايو","6":"يونيو","7":"يوليو","8":"أغسطس","9":"سبتمبر"},"narrow":{"1":"ي","10":"ك","11":"ب","12":"د","2":"ف","3":"م","4":"أ","5":"و","6":"ن","7":"ل","8":"غ","9":"س"},"wide":{"1":"يناير","10":"أكتوبر","11":"نوفمبر","12":"ديسمبر","2":"فبراير","3":"مارس","4":"أبريل","5":"مايو","6":"يونيو","7":"يوليو","8":"أغسطس","9":"سبتمبر"}},"stand-alone":{"abbreviated":{"1":"يناير","10":"أكتوبر","11":"نوفمبر","12":"ديسمبر","2":"فبراير","3":"مارس","4":"أبريل","5":"مايو","6":"يونيو","7":"يوليو","8":"أغسطس","9":"سبتمبر"},"narrow":{"1":"ي","10":"ك","11":"ب","12":"د","2":"ف","3":"م","4":"أ","5":"و","6":"ن","7":"ل","8":"غ","9":"س"},"wide":{"1":"يناير","10":"أكتوبر","11":"نوفمبر","12":"ديسمبر","2":"فبراير","3":"مارس","4":"أبريل","5":"مايو","6":"يونيو","7":"يوليو","8":"أغسطس","9":"سبتمبر"}}},"periods":{"format":{"abbreviated":null,"narrow":null,"wide":{"am":"ص","pm":"م"}},"stand-alone":{}},"quarters":{"format":{"abbreviated":{"1":"الربع الأول","2":"الربع الثاني","3":"الربع الثالث","4":"الربع الرابع"},"narrow":{"1":"١","2":"٢","3":"٣","4":"٤"},"wide":{"1":"الربع الأول","2":"الربع الثاني","3":"الربع الثالث","4":"الربع الرابع"}},"stand-alone":{"abbreviated":{"1":"الربع الأول","2":"الربع الثاني","3":"الربع الثالث","4":"الربع الرابع"},"narrow":{"1":"١","2":"٢","3":"٣","4":"٤"},"wide":{"1":"الربع الأول","2":"الربع الثاني","3":"الربع الثالث","4":"الربع الرابع"}}}};
+ this.weekday_keys = ["sun", "mon", "tue", "wed", "thu", "fri", "sat"];
+ this.methods = {
+ 'G': 'era',
+ 'y': 'year',
+ 'Y': 'year_of_week_of_year',
+ 'Q': 'quarter',
+ 'q': 'quarter_stand_alone',
+ 'M': 'month',
+ 'L': 'month_stand_alone',
+ 'w': 'week_of_year',
+ 'W': 'week_of_month',
+ 'd': 'day',
+ 'D': 'day_of_month',
+ 'F': 'day_of_week_in_month',
+ 'E': 'weekday',
+ 'e': 'weekday_local',
+ 'c': 'weekday_local_stand_alone',
+ 'a': 'period',
+ 'h': 'hour',
+ 'H': 'hour',
+ 'K': 'hour',
+ 'k': 'hour',
+ 'm': 'minute',
+ 's': 'second',
+ 'S': 'second_fraction',
+ 'z': 'timezone',
+ 'Z': 'timezone',
+ 'v': 'timezone_generic_non_location',
+ 'V': 'timezone_metazone'
+ };
+ }
+
+ DateTimeFormatter.prototype.format = function(obj, options) {
+ var format_token, token, tokens,
+ _this = this;
+ format_token = function(token) {
+ var result;
+ result = "";
+ switch (token.type) {
+ case "pattern":
+ return _this.result_for_token(token, obj);
+ default:
+ if (token.value.length > 0 && token.value[0] === "'" && token.value[token.value.length - 1] === "'") {
+ return token.value.substring(1, token.value.length - 1);
+ } else {
+ return token.value;
+ }
+ }
+ };
+ tokens = this.get_tokens(obj, options);
+ return ((function() {
+ var _i, _len, _results;
+ _results = [];
+ for (_i = 0, _len = tokens.length; _i < _len; _i++) {
+ token = tokens[_i];
+ _results.push(format_token(token));
+ }
+ return _results;
+ })()).join("");
+ };
+
+ DateTimeFormatter.prototype.get_tokens = function(obj, options) {
+ return this.tokens[options.format || "date_time"][options.type || "default"];
+ };
+
+ DateTimeFormatter.prototype.result_for_token = function(token, date) {
+ return this[this.methods[token.value[0]]](date, token.value, token.value.length);
+ };
+
+ DateTimeFormatter.prototype.era = function(date, pattern, length) {
+ var choices, index;
+ switch (length) {
+ case 1:
+ case 2:
+ case 3:
+ choices = this.calendar["eras"]["abbr"];
+ break;
+ default:
+ choices = this.calendar["eras"]["name"];
+ }
+ index = date.getFullYear() < 0 ? 0 : 1;
+ return choices[index];
+ };
+
+ DateTimeFormatter.prototype.year = function(date, pattern, length) {
+ var year;
+ year = date.getFullYear().toString();
+ if (length === 2) {
+ if (year.length !== 1) {
+ year = year.slice(-2);
+ }
+ }
+ if (length > 1) {
+ year = ("0000" + year).slice(-length);
+ }
+ return year;
+ };
+
+ DateTimeFormatter.prototype.year_of_week_of_year = function(date, pattern, length) {
+ throw 'not implemented';
+ };
+
+ DateTimeFormatter.prototype.day_of_week_in_month = function(date, pattern, length) {
+ throw 'not implemented';
+ };
+
+ DateTimeFormatter.prototype.quarter = function(date, pattern, length) {
+ var quarter;
+ quarter = ((date.getMonth() / 3) | 0) + 1;
+ switch (length) {
+ case 1:
+ return quarter.toString();
+ case 2:
+ return ("0000" + quarter.toString()).slice(-length);
+ case 3:
+ return this.calendar.quarters.format.abbreviated[quarter];
+ case 4:
+ return this.calendar.quarters.format.wide[quarter];
+ }
+ };
+
+ DateTimeFormatter.prototype.quarter_stand_alone = function(date, pattern, length) {
+ var quarter;
+ quarter = (date.getMonth() - 1) / 3 + 1;
+ switch (length) {
+ case 1:
+ return quarter.toString();
+ case 2:
+ return ("0000" + quarter.toString()).slice(-length);
+ case 3:
+ throw 'not yet implemented (requires cldr\'s "multiple inheritance")';
+ break;
+ case 4:
+ throw 'not yet implemented (requires cldr\'s "multiple inheritance")';
+ break;
+ case 5:
+ return this.calendar.quarters['stand-alone'].narrow[quarter];
+ }
+ };
+
+ DateTimeFormatter.prototype.month = function(date, pattern, length) {
+ var month_str;
+ month_str = (date.getMonth() + 1).toString();
+ switch (length) {
+ case 1:
+ return month_str;
+ case 2:
+ return ("0000" + month_str).slice(-length);
+ case 3:
+ return this.calendar.months.format.abbreviated[month_str];
+ case 4:
+ return this.calendar.months.format.wide[month_str];
+ case 5:
+ throw 'not yet implemented (requires cldr\'s "multiple inheritance")';
+ break;
+ default:
+ throw "Unknown date format";
+ }
+ };
+
+ DateTimeFormatter.prototype.month_stand_alone = function(date, pattern, length) {
+ switch (length) {
+ case 1:
+ return date.getMonth().toString();
+ case 2:
+ return ("0000" + date.getMonth().toString()).slice(-length);
+ case 3:
+ throw 'not yet implemented (requires cldr\'s "multiple inheritance")';
+ break;
+ case 4:
+ throw 'not yet implemented (requires cldr\'s "multiple inheritance")';
+ break;
+ case 5:
+ return this.calendar.months['stand-alone'].narrow[date.month];
+ default:
+ throw "Unknown date format";
+ }
+ };
+
+ DateTimeFormatter.prototype.day = function(date, pattern, length) {
+ switch (length) {
+ case 1:
+ return date.getDate().toString();
+ case 2:
+ return ("0000" + date.getDate().toString()).slice(-length);
+ }
+ };
+
+ DateTimeFormatter.prototype.weekday = function(date, pattern, length) {
+ var key;
+ key = this.weekday_keys[date.getDay()];
+ switch (length) {
+ case 1:
+ case 2:
+ case 3:
+ return this.calendar.days.format.abbreviated[key];
+ case 4:
+ return this.calendar.days.format.wide[key];
+ case 5:
+ return this.calendar.days['stand-alone'].narrow[key];
+ }
+ };
+
+ DateTimeFormatter.prototype.weekday_local = function(date, pattern, length) {
+ var day;
+ switch (length) {
+ case 1:
+ case 2:
+ day = date.getDay();
+ return (day === 0 ? "7" : day.toString());
+ default:
+ return this.weekday(date, pattern, length);
+ }
+ };
+
+ DateTimeFormatter.prototype.weekday_local_stand_alone = function(date, pattern, length) {
+ switch (length) {
+ case 1:
+ return this.weekday_local(date, pattern, length);
+ default:
+ return this.weekday(date, pattern, length);
+ }
+ };
+
+ DateTimeFormatter.prototype.period = function(time, pattern, length) {
+ if (time.getHours() > 11) {
+ return this.calendar.periods.format.wide["pm"];
+ } else {
+ return this.calendar.periods.format.wide["am"];
+ }
+ };
+
+ DateTimeFormatter.prototype.hour = function(time, pattern, length) {
+ var hour;
+ hour = time.getHours();
+ switch (pattern[0]) {
+ case 'h':
+ if (hour > 12) {
+ hour = hour - 12;
+ } else if (hour === 0) {
+ hour = 12;
+ }
+ break;
+ case 'K':
+ if (hour > 11) {
+ hour = hour - 12;
+ }
+ break;
+ case 'k':
+ if (hour === 0) {
+ hour = 24;
+ }
+ }
+ if (length === 1) {
+ return hour.toString();
+ } else {
+ return ("000000" + hour.toString()).slice(-length);
+ }
+ };
+
+ DateTimeFormatter.prototype.minute = function(time, pattern, length) {
+ if (length === 1) {
+ return time.getMinutes().toString();
+ } else {
+ return ("000000" + time.getMinutes().toString()).slice(-length);
+ }
+ };
+
+ DateTimeFormatter.prototype.second = function(time, pattern, length) {
+ if (length === 1) {
+ return time.getSeconds().toString();
+ } else {
+ return ("000000" + time.getSeconds().toString()).slice(-length);
+ }
+ };
+
+ DateTimeFormatter.prototype.second_fraction = function(time, pattern, length) {
+ if (length > 6) {
+ throw 'can not use the S format with more than 6 digits';
+ }
+ return ("000000" + Math.round(Math.pow(time.getMilliseconds() * 100.0, 6 - length)).toString()).slice(-length);
+ };
+
+ DateTimeFormatter.prototype.timezone = function(time, pattern, length) {
+ var hours, minutes;
+ hours = ("00" + (time.getTimezoneOffset() / 60).toString()).slice(-2);
+ minutes = ("00" + (time.getTimezoneOffset() % 60).toString()).slice(-2);
+ switch (length) {
+ case 1:
+ case 2:
+ case 3:
+ return "-" + hours + ":" + minutes;
+ default:
+ return "UTC -" + hours + ":" + minutes;
+ }
+ };
+
+ DateTimeFormatter.prototype.timezone_generic_non_location = function(time, pattern, length) {
+ throw 'not yet implemented (requires timezone translation data")';
+ };
+
+ return DateTimeFormatter;
+
+})();
415 full/twitter_cldr_ca.js
@@ -0,0 +1,415 @@
+/*
+// Copyright 2012 Twitter, Inc
+// http://www.apache.org/licenses/LICENSE-2.0
+
+// TwitterCLDR (JavaScript) v1.6.2
+// Authors: Cameron Dutro [@camertron]
+ Kirill Lashuk [@KL_7]
+ portions by Sven Fuchs [@svenfuchs]
+// Homepage: https://twitter.com
+// Description: Provides date, time, number, and list formatting functionality for various Twitter-supported locales in Javascript.
+*/
+
+var DateTimeFormatter, PluralRules, TimespanFormatter, TwitterCldr;
+
+TwitterCldr = {};
+
+TwitterCldr.PluralRules = PluralRules = (function() {
+
+ function PluralRules() {}
+
+ PluralRules.rules = {"keys": ["one","other"], "rule": function(n) { return (function() { if (n == 1) { return "one" } else { return "other" } })(); }};
+
+ PluralRules.all = function() {
+ return this.rules.keys;
+ };
+
+ PluralRules.rule_for = function(number) {
+ try {
+ return this.rules.rule(number);
+ } catch (error) {
+ return "other";
+ }
+ };
+
+ return PluralRules;
+
+})();
+
+TwitterCldr.TimespanFormatter = TimespanFormatter = (function() {
+
+ function TimespanFormatter() {
+ this.default_type = "default";
+ this.tokens = {"ago":{"second":{"default":{"one":[{"value":"Fa 1 segon","type":"plaintext"}],"other":[{"value":"Fa ","type":"plaintext"},{"value":"{0}","type":"placeholder"},{"value":" segons","type":"plaintext"}]}},"minute":{"default":{"one":[{"value":"Fa 1 minut","type":"plaintext"}],"other":[{"value":"Fa ","type":"plaintext"},{"value":"{0}","type":"placeholder"},{"value":" minuts","type":"plaintext"}]}},"hour":{"default":{"one":[{"value":"Fa 1 hora","type":"plaintext"}],"other":[{"value":"Fa ","type":"plaintext"},{"value":"{0}","type":"placeholder"},{"value":" hores","type":"plaintext"}]}},"day":{"default":{"one":[{"value":"Fa 1 dia","type":"plaintext"}],"other":[{"value":"Fa ","type":"plaintext"},{"value":"{0}","type":"placeholder"},{"value":" dies","type":"plaintext"}]}},"week":{"default":{"one":[{"value":"Fa 1 setmana","type":"plaintext"}],"other":[{"value":"Fa ","type":"plaintext"},{"value":"{0}","type":"placeholder"},{"value":" setmanes","type":"plaintext"}]}},"month":{"default":{"one":[{"value":"Fa 1 mes","type":"plaintext"}],"other":[{"value":"Fa ","type":"plaintext"},{"value":"{0}","type":"placeholder"},{"value":" mesos","type":"plaintext"}]}},"year":{"default":{"one":[{"value":"Fa 1 any","type":"plaintext"}],"other":[{"value":"Fa ","type":"plaintext"},{"value":"{0}","type":"placeholder"},{"value":" anys","type":"plaintext"}]}}},"until":{"second":{"default":{"one":[{"value":"D'aquí a 1 segon","type":"plaintext"}],"other":[{"value":"D'aquí a ","type":"plaintext"},{"value":"{0}","type":"placeholder"},{"value":" segons","type":"plaintext"}]}},"minute":{"default":{"one":[{"value":"D'aquí a 1 minut","type":"plaintext"}],"other":[{"value":"D'aquí a ","type":"plaintext"},{"value":"{0}","type":"placeholder"},{"value":" minuts","type":"plaintext"}]}},"hour":{"default":{"one":[{"value":"D'aquí a 1 hora","type":"plaintext"}],"other":[{"value":"D'aquí a ","type":"plaintext"},{"value":"{0}","type":"placeholder"},{"value":" hores","type":"plaintext"}]}},"day":{"default":{"one":[{"value":"D'aquí a 1 dia","type":"plaintext"}],"other":[{"value":"D'aquí a ","type":"plaintext"},{"value":"{0}","type":"placeholder"},{"value":" dies","type":"plaintext"}]}},"week":{"default":{"one":[{"value":"D'aquí a 1 setmana","type":"plaintext"}],"other":[{"value":"D'aquí a ","type":"plaintext"},{"value":"{0}","type":"placeholder"},{"value":" setmanes","type":"plaintext"}]}},"month":{"default":{"one":[{"value":"D'aquí a 1 mes","type":"plaintext"}],"other":[{"value":"D'aquí a ","type":"plaintext"},{"value":"{0}","type":"placeholder"},{"value":" mesos","type":"plaintext"}]}},"year":{"default":{"one":[{"value":"D'aquí a 1 any","type":"plaintext"}],"other":[{"value":"D'aquí a ","type":"plaintext"},{"value":"{0}","type":"placeholder"},{"value":" anys","type":"plaintext"}]}}},"none":{"second":{"default":{"one":[{"value":"{0}","type":"placeholder"},{"value":" segon","type":"plaintext"}],"other":[{"value":"{0}","type":"placeholder"},{"value":" segons","type":"plaintext"}]},"short":{"one":[{"value":"{0}","type":"placeholder"},{"value":" s","type":"plaintext"}],"other":[{"value":"{0}","type":"placeholder"},{"value":" s","type":"plaintext"}]},"abbreviated":{"one":[{"value":"{0}","type":"placeholder"},{"value":"s","type":"plaintext"}],"other":[{"value":"{0}","type":"placeholder"},{"value":"s","type":"plaintext"}]}},"minute":{"default":{"one":[{"value":"{0}","type":"placeholder"},{"value":" minut","type":"plaintext"}],"other":[{"value":"{0}","type":"placeholder"},{"value":" minuts","type":"plaintext"}]},"short":{"one":[{"value":"{0}","type":"placeholder"},{"value":" m","type":"plaintext"}],"other":[{"value":"{0}","type":"placeholder"},{"value":" m","type":"plaintext"}]},"abbreviated":{"one":[{"value":"{0}","type":"placeholder"},{"value":" min","type":"plaintext"}],"other":[{"value":"{0}","type":"placeholder"},{"value":" min","type":"plaintext"}]}},"hour":{"default":{"one":[{"value":"{0}","type":"placeholder"},{"value":" hora","type":"plaintext"}],"other":[{"value":"{0}","type":"placeholder"},{"value":" hores","type":"plaintext"}]},"short":{"one":[{"value":"{0}","type":"placeholder"},{"value":" h","type":"plaintext"}],"other":[{"value":"{0}","type":"placeholder"},{"value":" h","type":"plaintext"}]},"abbreviated":{"one":[{"value":"{0}","type":"placeholder"},{"value":" h","type":"plaintext"}],"other":[{"value":"{0}","type":"placeholder"},{"value":" h","type":"plaintext"}]}},"day":{"default":{"one":[{"value":"{0}","type":"placeholder"},{"value":" dia","type":"plaintext"}],"other":[{"value":"{0}","type":"placeholder"},{"value":" dies","type":"plaintext"}]},"short":{"one":[{"value":"{0}","type":"placeholder"},{"value":" dia","type":"plaintext"}],"other":[{"value":"{0}","type":"placeholder"},{"value":" dies","type":"plaintext"}]},"abbreviated":{"one":[{"value":"{0}","type":"placeholder"},{"value":"d","type":"plaintext"}],"other":[{"value":"{0}","type":"placeholder"},{"value":"d","type":"plaintext"}]}},"week":{"default":{"one":[{"value":"{0}","type":"placeholder"},{"value":" setmana","type":"plaintext"}],"other":[{"value":"{0}","type":"placeholder"},{"value":" setmanes","type":"plaintext"}]},"short":{"one":[{"value":"{0}","type":"placeholder"},{"value":" setmana","type":"plaintext"}],"other":[{"value":"{0}","type":"placeholder"},{"value":" setmanes","type":"plaintext"}]}},"month":{"default":{"one":[{"value":"{0}","type":"placeholder"},{"value":" mes","type":"plaintext"}],"other":[{"value":"{0}","type":"placeholder"},{"value":" mesos","type":"plaintext"}]},"short":{"one":[{"value":"{0}","type":"placeholder"},{"value":" mes","type":"plaintext"}],"other":[{"value":"{0}","type":"placeholder"},{"value":" mesos","type":"plaintext"}]}},"year":{"default":{"one":[{"value":"{0}","type":"placeholder"},{"value":" any","type":"plaintext"}],"other":[{"value":"{0}","type":"placeholder"},{"value":" anys","type":"plaintext"}]},"short":{"one":[{"value":"{0}","type":"placeholder"},{"value":" any","type":"plaintext"}],"other":[{"value":"{0}","type":"placeholder"},{"value":" anys","type":"plaintext"}]}}}};
+ this.time_in_seconds = {
+ "second": 1,
+ "minute": 60,
+ "hour": 3600,
+ "day": 86400,
+ "week": 604800,
+ "month": 2629743.83,
+ "year": 31556926
+ };
+ }
+
+ TimespanFormatter.prototype.format = function(seconds, options) {
+ var number, strings, token;
+ if (options == null) {
+ options = {};
+ }
+ options["direction"] || (options["direction"] = (seconds < 0 ? "ago" : "until"));
+ if (options["unit"] === null || options["unit"] === void 0) {
+ options["unit"] = this.calculate_unit(Math.abs(seconds));
+ }
+ options["type"] || (options["type"] = this.default_type);
+ options["number"] = this.calculate_time(Math.abs(seconds), options["unit"]);
+ number = this.calculate_time(Math.abs(seconds), options["unit"]);
+ options["rule"] = TwitterCldr.PluralRules.rule_for(number);
+ strings = (function() {
+ var _i, _len, _ref, _results;
+ _ref = this.tokens[options["direction"]][options["unit"]][options["type"]][options["rule"]];
+ _results = [];
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
+ token = _ref[_i];
+ _results.push(token.value);
+ }
+ return _results;
+ }).call(this);
+ return strings.join("").replace(/\{[0-9]\}/, number.toString());
+ };
+
+ TimespanFormatter.prototype.calculate_unit = function(seconds) {
+ if (seconds < 30) {
+ return "second";
+ } else if (seconds < 2670) {
+ return "minute";
+ } else if (seconds < 86369) {
+ return "hour";
+ } else if (seconds < 604800) {
+ return "day";
+ } else if (seconds < 2591969) {
+ return "week";
+ } else if (seconds < 31556926) {
+ return "month";
+ } else {
+ return "year";
+ }
+ };
+
+ TimespanFormatter.prototype.calculate_time = function(seconds, unit) {
+ return Math.round(seconds / this.time_in_seconds[unit]);
+ };
+
+ return TimespanFormatter;
+
+})();
+
+TwitterCldr.DateTimeFormatter = DateTimeFormatter = (function() {
+
+ function DateTimeFormatter() {
+ this.tokens = {"date_time":{"default":[{"value":"dd","type":"pattern"},{"value":"/","type":"plaintext"},{"value":"MM","type":"pattern"},{"value":"/","type":"plaintext"},{"value":"yyyy","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"H","type":"pattern"},{"value":":","type":"plaintext"},{"value":"mm","type":"pattern"},{"value":":","type":"plaintext"},{"value":"ss","type":"pattern"}],"full":[{"value":"EEEE","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"d","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"MMMM","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"'de'","type":"plaintext"},{"value":" ","type":"plaintext"},{"value":"y","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"H","type":"pattern"},{"value":":","type":"plaintext"},{"value":"mm","type":"pattern"},{"value":":","type":"plaintext"},{"value":"ss","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"zzzz","type":"pattern"}],"long":[{"value":"d","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"MMMM","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"'de'","type":"plaintext"},{"value":" ","type":"plaintext"},{"value":"y","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"H","type":"pattern"},{"value":":","type":"plaintext"},{"value":"mm","type":"pattern"},{"value":":","type":"plaintext"},{"value":"ss","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"z","type":"pattern"}],"medium":[{"value":"dd","type":"pattern"},{"value":"/","type":"plaintext"},{"value":"MM","type":"pattern"},{"value":"/","type":"plaintext"},{"value":"yyyy","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"H","type":"pattern"},{"value":":","type":"plaintext"},{"value":"mm","type":"pattern"},{"value":":","type":"plaintext"},{"value":"ss","type":"pattern"}],"short":[{"value":"dd","type":"pattern"},{"value":"/","type":"plaintext"},{"value":"MM","type":"pattern"},{"value":"/","type":"plaintext"},{"value":"yy","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"H","type":"pattern"},{"value":":","type":"plaintext"},{"value":"mm","type":"pattern"}]},"time":{"default":[{"value":"H","type":"pattern"},{"value":":","type":"plaintext"},{"value":"mm","type":"pattern"},{"value":":","type":"plaintext"},{"value":"ss","type":"pattern"}],"full":[{"value":"H","type":"pattern"},{"value":":","type":"plaintext"},{"value":"mm","type":"pattern"},{"value":":","type":"plaintext"},{"value":"ss","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"zzzz","type":"pattern"}],"long":[{"value":"H","type":"pattern"},{"value":":","type":"plaintext"},{"value":"mm","type":"pattern"},{"value":":","type":"plaintext"},{"value":"ss","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"z","type":"pattern"}],"medium":[{"value":"H","type":"pattern"},{"value":":","type":"plaintext"},{"value":"mm","type":"pattern"},{"value":":","type":"plaintext"},{"value":"ss","type":"pattern"}],"short":[{"value":"H","type":"pattern"},{"value":":","type":"plaintext"},{"value":"mm","type":"pattern"}]},"date":{"default":[{"value":"dd","type":"pattern"},{"value":"/","type":"plaintext"},{"value":"MM","type":"pattern"},{"value":"/","type":"plaintext"},{"value":"yyyy","type":"pattern"}],"full":[{"value":"EEEE","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"d","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"MMMM","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"'de'","type":"plaintext"},{"value":" ","type":"plaintext"},{"value":"y","type":"pattern"}],"long":[{"value":"d","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"MMMM","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"'de'","type":"plaintext"},{"value":" ","type":"plaintext"},{"value":"y","type":"pattern"}],"medium":[{"value":"dd","type":"pattern"},{"value":"/","type":"plaintext"},{"value":"MM","type":"pattern"},{"value":"/","type":"plaintext"},{"value":"yyyy","type":"pattern"}],"short":[{"value":"dd","type":"pattern"},{"value":"/","type":"plaintext"},{"value":"MM","type":"pattern"},{"value":"/","type":"plaintext"},{"value":"yy","type":"pattern"}]}};
+ this.calendar = {"days":{"format":{"abbreviated":{"fri":"dv.","mon":"dl.","sat":"ds.","sun":"dg.","thu":"dj.","tue":"dt.","wed":"dc."},"narrow":{"fri":"V","mon":"l","sat":"S","sun":"G","thu":"J","tue":"T","wed":"C"},"wide":{"fri":"divendres","mon":"dilluns","sat":"dissabte","sun":"diumenge","thu":"dijous","tue":"dimarts","wed":"dimecres"}},"stand-alone":{"abbreviated":{"fri":"dv","mon":"dl","sat":"ds","sun":"dg","thu":"dj","tue":"dt","wed":"dc"},"narrow":{"fri":"v","mon":"l","sat":"s","sun":"g","thu":"j","tue":"t","wed":"c"},"wide":{"fri":"Divendres","mon":"Dilluns","sat":"Dissabte","sun":"Diumenge","thu":"Dijous","tue":"Dimarts","wed":"Dimecres"}}},"eras":{"abbr":{"0":"aC","1":"dC"},"name":{"0":"abans de Crist","1":"després de Crist"},"narrow":{"0":""}},"fields":{"day":"dia","dayperiod":"a.m./p.m.","era":"era","hour":"hora","minute":"minut","month":"mes","second":"segon","week":"setmana","weekday":"dia de la setmana","year":"any","zone":"zona"},"formats":{"date":{"default":{"pattern":"dd/MM/yyyy"},"full":{"pattern":"EEEE d MMMM 'de' y"},"long":{"pattern":"d MMMM 'de' y"},"medium":{"pattern":"dd/MM/yyyy"},"short":{"pattern":"dd/MM/yy"}},"datetime":{"default":{"pattern":"{{date}} {{time}}"},"full":{"pattern":"{{date}} {{time}}"},"long":{"pattern":"{{date}} {{time}}"},"medium":{"pattern":"{{date}} {{time}}"},"short":{"pattern":"{{date}} {{time}}"}},"time":{"default":{"pattern":"H:mm:ss"},"full":{"pattern":"H:mm:ss zzzz"},"long":{"pattern":"H:mm:ss z"},"medium":{"pattern":"H:mm:ss"},"short":{"pattern":"H:mm"}}},"months":{"format":{"abbreviated":{"1":"de gen.","10":"d’oct.","11":"de nov.","12":"de des.","2":"de febr.","3":"de març","4":"d’abr.","5":"de maig","6":"de juny","7":"de jul.","8":"d’ag.","9":"de set."},"narrow":{"1":"G","10":"O","11":"N","12":"D","2":"F","3":"M","4":"A","5":"M","6":"J","7":"G","8":"A","9":"S"},"wide":{"1":"de gener","10":"d’octubre","11":"de novembre","12":"de desembre","2":"de febrer","3":"de març","4":"d’abril","5":"de maig","6":"de juny","7":"de juliol","8":"d’agost","9":"de setembre"}},"stand-alone":{"abbreviated":{"1":"gen.","10":"oct.","11":"nov.","12":"des.","2":"febr.","3":"març","4":"abr.","5":"maig","6":"juny","7":"jul.","8":"ag.","9":"set."},"narrow":{"1":"g","10":"o","11":"n","12":"d","2":"f","3":"m","4":"a","5":"m","6":"j","7":"j","8":"a","9":"s"},"wide":{"1":"gener","10":"octubre","11":"novembre","12":"desembre","2":"febrer","3":"març","4":"abril","5":"maig","6":"juny","7":"juliol","8":"agost","9":"setembre"}}},"periods":{"format":{"abbreviated":null,"narrow":null,"wide":{"am":"a.m.","pm":"p.m."}},"stand-alone":{}},"quarters":{"format":{"abbreviated":{"1":"1T","2":"2T","3":"3T","4":"4T"},"narrow":{"1":1,"2":2,"3":3,"4":4},"wide":{"1":"1r trimestre","2":"2n trimestre","3":"3r trimestre","4":"4t trimestre"}},"stand-alone":{"abbreviated":{"1":"1T","2":"2T","3":"3T","4":"4T"},"narrow":{"1":1,"2":2,"3":3,"4":4},"wide":{"1":"1r trimestre","2":"2n trimestre","3":"3r trimestre","4":"4t trimestre"}}}};
+ this.weekday_keys = ["sun", "mon", "tue", "wed", "thu", "fri", "sat"];
+ this.methods = {
+ 'G': 'era',
+ 'y': 'year',
+ 'Y': 'year_of_week_of_year',
+ 'Q': 'quarter',
+ 'q': 'quarter_stand_alone',
+ 'M': 'month',
+ 'L': 'month_stand_alone',
+ 'w': 'week_of_year',
+ 'W': 'week_of_month',
+ 'd': 'day',
+ 'D': 'day_of_month',
+ 'F': 'day_of_week_in_month',
+ 'E': 'weekday',
+ 'e': 'weekday_local',
+ 'c': 'weekday_local_stand_alone',
+ 'a': 'period',
+ 'h': 'hour',
+ 'H': 'hour',
+ 'K': 'hour',
+ 'k': 'hour',
+ 'm': 'minute',
+ 's': 'second',
+ 'S': 'second_fraction',
+ 'z': 'timezone',
+ 'Z': 'timezone',
+ 'v': 'timezone_generic_non_location',
+ 'V': 'timezone_metazone'
+ };
+ }
+
+ DateTimeFormatter.prototype.format = function(obj, options) {
+ var format_token, token, tokens,
+ _this = this;
+ format_token = function(token) {
+ var result;
+ result = "";
+ switch (token.type) {
+ case "pattern":
+ return _this.result_for_token(token, obj);
+ default:
+ if (token.value.length > 0 && token.value[0] === "'" && token.value[token.value.length - 1] === "'") {
+ return token.value.substring(1, token.value.length - 1);
+ } else {
+ return token.value;
+ }
+ }
+ };
+ tokens = this.get_tokens(obj, options);
+ return ((function() {
+ var _i, _len, _results;
+ _results = [];
+ for (_i = 0, _len = tokens.length; _i < _len; _i++) {
+ token = tokens[_i];
+ _results.push(format_token(token));
+ }
+ return _results;
+ })()).join("");
+ };
+
+ DateTimeFormatter.prototype.get_tokens = function(obj, options) {
+ return this.tokens[options.format || "date_time"][options.type || "default"];
+ };
+
+ DateTimeFormatter.prototype.result_for_token = function(token, date) {
+ return this[this.methods[token.value[0]]](date, token.value, token.value.length);
+ };
+
+ DateTimeFormatter.prototype.era = function(date, pattern, length) {
+ var choices, index;
+ switch (length) {
+ case 1:
+ case 2:
+ case 3:
+ choices = this.calendar["eras"]["abbr"];
+ break;
+ default:
+ choices = this.calendar["eras"]["name"];
+ }
+ index = date.getFullYear() < 0 ? 0 : 1;
+ return choices[index];
+ };
+
+ DateTimeFormatter.prototype.year = function(date, pattern, length) {
+ var year;
+ year = date.getFullYear().toString();
+ if (length === 2) {
+ if (year.length !== 1) {
+ year = year.slice(-2);
+ }
+ }
+ if (length > 1) {
+ year = ("0000" + year).slice(-length);
+ }
+ return year;
+ };
+
+ DateTimeFormatter.prototype.year_of_week_of_year = function(date, pattern, length) {
+ throw 'not implemented';
+ };
+
+ DateTimeFormatter.prototype.day_of_week_in_month = function(date, pattern, length) {
+ throw 'not implemented';
+ };
+
+ DateTimeFormatter.prototype.quarter = function(date, pattern, length) {
+ var quarter;
+ quarter = ((date.getMonth() / 3) | 0) + 1;
+ switch (length) {
+ case 1:
+ return quarter.toString();
+ case 2:
+ return ("0000" + quarter.toString()).slice(-length);
+ case 3:
+ return this.calendar.quarters.format.abbreviated[quarter];
+ case 4:
+ return this.calendar.quarters.format.wide[quarter];
+ }
+ };
+
+ DateTimeFormatter.prototype.quarter_stand_alone = function(date, pattern, length) {
+ var quarter;
+ quarter = (date.getMonth() - 1) / 3 + 1;
+ switch (length) {
+ case 1:
+ return quarter.toString();
+ case 2:
+ return ("0000" + quarter.toString()).slice(-length);
+ case 3:
+ throw 'not yet implemented (requires cldr\'s "multiple inheritance")';
+ break;
+ case 4:
+ throw 'not yet implemented (requires cldr\'s "multiple inheritance")';
+ break;
+ case 5:
+ return this.calendar.quarters['stand-alone'].narrow[quarter];
+ }
+ };
+
+ DateTimeFormatter.prototype.month = function(date, pattern, length) {
+ var month_str;
+ month_str = (date.getMonth() + 1).toString();
+ switch (length) {
+ case 1:
+ return month_str;
+ case 2:
+ return ("0000" + month_str).slice(-length);
+ case 3:
+ return this.calendar.months.format.abbreviated[month_str];
+ case 4:
+ return this.calendar.months.format.wide[month_str];
+ case 5:
+ throw 'not yet implemented (requires cldr\'s "multiple inheritance")';
+ break;
+ default:
+ throw "Unknown date format";
+ }
+ };
+
+ DateTimeFormatter.prototype.month_stand_alone = function(date, pattern, length) {
+ switch (length) {
+ case 1:
+ return date.getMonth().toString();
+ case 2:
+ return ("0000" + date.getMonth().toString()).slice(-length);
+ case 3:
+ throw 'not yet implemented (requires cldr\'s "multiple inheritance")';
+ break;
+ case 4:
+ throw 'not yet implemented (requires cldr\'s "multiple inheritance")';
+ break;
+ case 5:
+ return this.calendar.months['stand-alone'].narrow[date.month];
+ default:
+ throw "Unknown date format";
+ }
+ };
+
+ DateTimeFormatter.prototype.day = function(date, pattern, length) {
+ switch (length) {
+ case 1:
+ return date.getDate().toString();
+ case 2:
+ return ("0000" + date.getDate().toString()).slice(-length);
+ }
+ };
+
+ DateTimeFormatter.prototype.weekday = function(date, pattern, length) {
+ var key;
+ key = this.weekday_keys[date.getDay()];
+ switch (length) {
+ case 1:
+ case 2:
+ case 3:
+ return this.calendar.days.format.abbreviated[key];
+ case 4:
+ return this.calendar.days.format.wide[key];
+ case 5:
+ return this.calendar.days['stand-alone'].narrow[key];
+ }
+ };
+
+ DateTimeFormatter.prototype.weekday_local = function(date, pattern, length) {
+ var day;
+ switch (length) {
+ case 1:
+ case 2:
+ day = date.getDay();
+ return (day === 0 ? "7" : day.toString());
+ default:
+ return this.weekday(date, pattern, length);
+ }
+ };
+
+ DateTimeFormatter.prototype.weekday_local_stand_alone = function(date, pattern, length) {
+ switch (length) {
+ case 1:
+ return this.weekday_local(date, pattern, length);
+ default:
+ return this.weekday(date, pattern, length);
+ }
+ };
+
+ DateTimeFormatter.prototype.period = function(time, pattern, length) {
+ if (time.getHours() > 11) {
+ return this.calendar.periods.format.wide["pm"];
+ } else {
+ return this.calendar.periods.format.wide["am"];
+ }
+ };
+
+ DateTimeFormatter.prototype.hour = function(time, pattern, length) {
+ var hour;
+ hour = time.getHours();
+ switch (pattern[0]) {
+ case 'h':
+ if (hour > 12) {
+ hour = hour - 12;
+ } else if (hour === 0) {
+ hour = 12;
+ }
+ break;
+ case 'K':
+ if (hour > 11) {
+ hour = hour - 12;
+ }
+ break;
+ case 'k':
+ if (hour === 0) {
+ hour = 24;
+ }
+ }
+ if (length === 1) {
+ return hour.toString();
+ } else {
+ return ("000000" + hour.toString()).slice(-length);
+ }
+ };
+
+ DateTimeFormatter.prototype.minute = function(time, pattern, length) {
+ if (length === 1) {
+ return time.getMinutes().toString();
+ } else {
+ return ("000000" + time.getMinutes().toString()).slice(-length);
+ }
+ };
+
+ DateTimeFormatter.prototype.second = function(time, pattern, length) {
+ if (length === 1) {
+ return time.getSeconds().toString();
+ } else {
+ return ("000000" + time.getSeconds().toString()).slice(-length);
+ }
+ };
+
+ DateTimeFormatter.prototype.second_fraction = function(time, pattern, length) {
+ if (length > 6) {
+ throw 'can not use the S format with more than 6 digits';
+ }
+ return ("000000" + Math.round(Math.pow(time.getMilliseconds() * 100.0, 6 - length)).toString()).slice(-length);
+ };
+
+ DateTimeFormatter.prototype.timezone = function(time, pattern, length) {
+ var hours, minutes;
+ hours = ("00" + (time.getTimezoneOffset() / 60).toString()).slice(-2);
+ minutes = ("00" + (time.getTimezoneOffset() % 60).toString()).slice(-2);
+ switch (length) {
+ case 1:
+ case 2:
+ case 3:
+ return "-" + hours + ":" + minutes;
+ default:
+ return "UTC -" + hours + ":" + minutes;
+ }
+ };
+
+ DateTimeFormatter.prototype.timezone_generic_non_location = function(time, pattern, length) {
+ throw 'not yet implemented (requires timezone translation data")';
+ };
+
+ return DateTimeFormatter;
+
+})();
415 full/twitter_cldr_cs.js
@@ -0,0 +1,415 @@
+/*
+// Copyright 2012 Twitter, Inc
+// http://www.apache.org/licenses/LICENSE-2.0
+
+// TwitterCLDR (JavaScript) v1.6.2
+// Authors: Cameron Dutro [@camertron]
+ Kirill Lashuk [@KL_7]
+ portions by Sven Fuchs [@svenfuchs]
+// Homepage: https://twitter.com
+// Description: Provides date, time, number, and list formatting functionality for various Twitter-supported locales in Javascript.
+*/
+
+var DateTimeFormatter, PluralRules, TimespanFormatter, TwitterCldr;
+
+TwitterCldr = {};
+
+TwitterCldr.PluralRules = PluralRules = (function() {
+
+ function PluralRules() {}
+
+ PluralRules.rules = {"keys": ["one","few","other"], "rule": function(n) { return (function() { if (n == 1) { return "one" } else { return (function() { if ([2, 3, 4].indexOf(n) >= 0) { return "few" } else { return "other" } })(); } })(); }};
+
+ PluralRules.all = function() {
+ return this.rules.keys;
+ };
+
+ PluralRules.rule_for = function(number) {
+ try {
+ return this.rules.rule(number);
+ } catch (error) {
+ return "other";
+ }
+ };
+
+ return PluralRules;
+
+})();
+
+TwitterCldr.TimespanFormatter = TimespanFormatter = (function() {
+
+ function TimespanFormatter() {
+ this.default_type = "default";
+ this.tokens = {"ago":{"second":{"default":{"one":[{"value":"před 1 sekundou","type":"plaintext"}],"few":[{"value":"před ","type":"plaintext"},{"value":"{0}","type":"placeholder"},{"value":" sekundami","type":"plaintext"}],"other":[{"value":"před ","type":"plaintext"},{"value":"{0}","type":"placeholder"},{"value":" sekundami","type":"plaintext"}]}},"minute":{"default":{"one":[{"value":"před 1 minutou","type":"plaintext"}],"few":[{"value":"před ","type":"plaintext"},{"value":"{0}","type":"placeholder"},{"value":" minutami","type":"plaintext"}],"other":[{"value":"před ","type":"plaintext"},{"value":"{0}","type":"placeholder"},{"value":" minutami","type":"plaintext"}]}},"hour":{"default":{"one":[{"value":"před 1 hodinou","type":"plaintext"}],"few":[{"value":"před ","type":"plaintext"},{"value":"{0}","type":"placeholder"},{"value":" hodinami","type":"plaintext"}],"other":[{"value":"před ","type":"plaintext"},{"value":"{0}","type":"placeholder"},{"value":" hodinami","type":"plaintext"}]}},"day":{"default":{"one":[{"value":"před 1 dnem","type":"plaintext"}],"few":[{"value":"před ","type":"plaintext"},{"value":"{0}","type":"placeholder"},{"value":" dny","type":"plaintext"}],"other":[{"value":"před ","type":"plaintext"},{"value":"{0}","type":"placeholder"},{"value":" dny","type":"plaintext"}]}},"week":{"default":{"one":[{"value":"před 1 týdnem","type":"plaintext"}],"few":[{"value":"před ","type":"plaintext"},{"value":"{0}","type":"placeholder"},{"value":" týdny","type":"plaintext"}],"other":[{"value":"před ","type":"plaintext"},{"value":"{0}","type":"placeholder"},{"value":" týdny","type":"plaintext"}]}},"month":{"default":{"one":[{"value":"před 1 měsícem","type":"plaintext"}],"few":[{"value":"před ","type":"plaintext"},{"value":"{0}","type":"placeholder"},{"value":" měsíci","type":"plaintext"}],"other":[{"value":"před ","type":"plaintext"},{"value":"{0}","type":"placeholder"},{"value":" měsíci","type":"plaintext"}]}},"year":{"default":{"one":[{"value":"před 1 rokem","type":"plaintext"}],"few":[{"value":"před ","type":"plaintext"},{"value":"{0}","type":"placeholder"},{"value":" lety","type":"plaintext"}],"other":[{"value":"před ","type":"plaintext"},{"value":"{0}","type":"placeholder"},{"value":" lety","type":"plaintext"}]}}},"until":{"second":{"default":{"one":[{"value":"za 1 sekundu","type":"plaintext"}],"few":[{"value":"za ","type":"plaintext"},{"value":"{0}","type":"placeholder"},{"value":" sekundy","type":"plaintext"}],"other":[{"value":"za ","type":"plaintext"},{"value":"{0}","type":"placeholder"},{"value":" sekund","type":"plaintext"}]}},"minute":{"default":{"one":[{"value":"za 1 minutu","type":"plaintext"}],"few":[{"value":"za ","type":"plaintext"},{"value":"{0}","type":"placeholder"},{"value":" minuty","type":"plaintext"}],"other":[{"value":"za ","type":"plaintext"},{"value":"{0}","type":"placeholder"},{"value":" minut","type":"plaintext"}]}},"hour":{"default":{"one":[{"value":"za 1 hodinu","type":"plaintext"}],"few":[{"value":"za ","type":"plaintext"},{"value":"{0}","type":"placeholder"},{"value":" hodiny","type":"plaintext"}],"other":[{"value":"za ","type":"plaintext"},{"value":"{0}","type":"placeholder"},{"value":" hodin","type":"plaintext"}]}},"day":{"default":{"one":[{"value":"za 1 den","type":"plaintext"}],"few":[{"value":"za ","type":"plaintext"},{"value":"{0}","type":"placeholder"},{"value":" dny","type":"plaintext"}],"other":[{"value":"za ","type":"plaintext"},{"value":"{0}","type":"placeholder"},{"value":" dní","type":"plaintext"}]}},"week":{"default":{"one":[{"value":"za 1 týden","type":"plaintext"}],"few":[{"value":"za ","type":"plaintext"},{"value":"{0}","type":"placeholder"},{"value":" týdny","type":"plaintext"}],"other":[{"value":"za ","type":"plaintext"},{"value":"{0}","type":"placeholder"},{"value":" týdnů","type":"plaintext"}]}},"month":{"default":{"one":[{"value":"za 1 měsíc","type":"plaintext"}],"few":[{"value":"za ","type":"plaintext"},{"value":"{0}","type":"placeholder"},{"value":" měsíce","type":"plaintext"}],"other":[{"value":"za ","type":"plaintext"},{"value":"{0}","type":"placeholder"},{"value":" měsíců","type":"plaintext"}]}},"year":{"default":{"one":[{"value":"za 1 rok","type":"plaintext"}],"few":[{"value":"za ","type":"plaintext"},{"value":"{0}","type":"placeholder"},{"value":" roky","type":"plaintext"}],"other":[{"value":"za ","type":"plaintext"},{"value":"{0}","type":"placeholder"},{"value":" let","type":"plaintext"}]}}},"none":{"second":{"default":{"one":[{"value":"{0}","type":"placeholder"},{"value":" sekunda","type":"plaintext"}],"few":[{"value":"{0}","type":"placeholder"},{"value":" sekundy","type":"plaintext"}],"other":[{"value":"{0}","type":"placeholder"},{"value":" sekund","type":"plaintext"}]},"short":{"one":[{"value":"{0}","type":"placeholder"},{"value":" sek.","type":"plaintext"}],"few":[{"value":"{0}","type":"placeholder"},{"value":" sek.","type":"plaintext"}],"other":[{"value":"{0}","type":"placeholder"},{"value":" sek.","type":"plaintext"}]},"abbreviated":{"one":[{"value":"{0}","type":"placeholder"},{"value":"s","type":"plaintext"}],"few":[{"value":"{0}","type":"placeholder"},{"value":"s","type":"plaintext"}],"other":[{"value":"{0}","type":"placeholder"},{"value":"s","type":"plaintext"}]}},"minute":{"default":{"one":[{"value":"{0}","type":"placeholder"},{"value":" minuta","type":"plaintext"}],"few":[{"value":"{0}","type":"placeholder"},{"value":" minuty","type":"plaintext"}],"other":[{"value":"{0}","type":"placeholder"},{"value":" minut","type":"plaintext"}]},"short":{"one":[{"value":"{0}","type":"placeholder"},{"value":" min.","type":"plaintext"}],"few":[{"value":"{0}","type":"placeholder"},{"value":" min.","type":"plaintext"}],"other":[{"value":"{0}","type":"placeholder"},{"value":" min.","type":"plaintext"}]},"abbreviated":{"one":[{"value":"{0}","type":"placeholder"},{"value":"min","type":"plaintext"}],"few":[{"value":"{0}","type":"placeholder"},{"value":"min","type":"plaintext"}],"other":[{"value":"{0}","type":"placeholder"},{"value":"min","type":"plaintext"}]}},"hour":{"default":{"one":[{"value":"{0}","type":"placeholder"},{"value":" hodina","type":"plaintext"}],"few":[{"value":"{0}","type":"placeholder"},{"value":" hodiny","type":"plaintext"}],"other":[{"value":"{0}","type":"placeholder"},{"value":" hodin","type":"plaintext"}]},"short":{"one":[{"value":"{0}","type":"placeholder"},{"value":" hod.","type":"plaintext"}],"few":[{"value":"{0}","type":"placeholder"},{"value":" hod.","type":"plaintext"}],"other":[{"value":"{0}","type":"placeholder"},{"value":" hod.","type":"plaintext"}]},"abbreviated":{"one":[{"value":"{0}","type":"placeholder"},{"value":"hod","type":"plaintext"}],"few":[{"value":"{0}","type":"placeholder"},{"value":"hod","type":"plaintext"}],"other":[{"value":"{0}","type":"placeholder"},{"value":"hod","type":"plaintext"}]}},"day":{"default":{"one":[{"value":"{0}","type":"placeholder"},{"value":" den","type":"plaintext"}],"few":[{"value":"{0}","type":"placeholder"},{"value":" dny","type":"plaintext"}],"other":[{"value":"{0}","type":"placeholder"},{"value":" dní","type":"plaintext"}]},"short":{"one":[{"value":"{0}","type":"placeholder"},{"value":" den","type":"plaintext"}],"few":[{"value":"{0}","type":"placeholder"},{"value":" dny","type":"plaintext"}],"other":[{"value":"{0}","type":"placeholder"},{"value":" dní","type":"plaintext"}]},"abbreviated":{"one":[{"value":"{0}","type":"placeholder"},{"value":"dnů","type":"plaintext"}],"few":[{"value":"{0}","type":"placeholder"},{"value":"dnů","type":"plaintext"}],"other":[{"value":"{0}","type":"placeholder"},{"value":"dnů","type":"plaintext"}]}},"week":{"default":{"one":[{"value":"{0}","type":"placeholder"},{"value":" týden","type":"plaintext"}],"few":[{"value":"{0}","type":"placeholder"},{"value":" týdny","type":"plaintext"}],"other":[{"value":"{0}","type":"placeholder"},{"value":" týdnů","type":"plaintext"}]},"short":{"one":[{"value":"{0}","type":"placeholder"},{"value":" týd.","type":"plaintext"}],"few":[{"value":"{0}","type":"placeholder"},{"value":" týd.","type":"plaintext"}],"other":[{"value":"{0}","type":"placeholder"},{"value":" týd.","type":"plaintext"}]}},"month":{"default":{"one":[{"value":"{0}","type":"placeholder"},{"value":" měsíc","type":"plaintext"}],"few":[{"value":"{0}","type":"placeholder"},{"value":" měsíce","type":"plaintext"}],"other":[{"value":"{0}","type":"placeholder"},{"value":" měsíců","type":"plaintext"}]},"short":{"one":[{"value":"{0}","type":"placeholder"},{"value":" měs.","type":"plaintext"}],"few":[{"value":"{0}","type":"placeholder"},{"value":" měs.","type":"plaintext"}],"other":[{"value":"{0}","type":"placeholder"},{"value":" měs.","type":"plaintext"}]}},"year":{"default":{"one":[{"value":"{0}","type":"placeholder"},{"value":" rok","type":"plaintext"}],"few":[{"value":"{0}","type":"placeholder"},{"value":" roky","type":"plaintext"}],"other":[{"value":"{0}","type":"placeholder"},{"value":" let","type":"plaintext"}]},"short":{"one":[{"value":"{0}","type":"placeholder"},{"value":" rok","type":"plaintext"}],"few":[{"value":"{0}","type":"placeholder"},{"value":" roky","type":"plaintext"}],"other":[{"value":"{0}","type":"placeholder"},{"value":" let","type":"plaintext"}]}}}};
+ this.time_in_seconds = {
+ "second": 1,
+ "minute": 60,
+ "hour": 3600,
+ "day": 86400,
+ "week": 604800,
+ "month": 2629743.83,
+ "year": 31556926
+ };
+ }
+
+ TimespanFormatter.prototype.format = function(seconds, options) {
+ var number, strings, token;
+ if (options == null) {
+ options = {};
+ }
+ options["direction"] || (options["direction"] = (seconds < 0 ? "ago" : "until"));
+ if (options["unit"] === null || options["unit"] === void 0) {
+ options["unit"] = this.calculate_unit(Math.abs(seconds));
+ }
+ options["type"] || (options["type"] = this.default_type);
+ options["number"] = this.calculate_time(Math.abs(seconds), options["unit"]);
+ number = this.calculate_time(Math.abs(seconds), options["unit"]);
+ options["rule"] = TwitterCldr.PluralRules.rule_for(number);
+ strings = (function() {
+ var _i, _len, _ref, _results;
+ _ref = this.tokens[options["direction"]][options["unit"]][options["type"]][options["rule"]];
+ _results = [];
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
+ token = _ref[_i];
+ _results.push(token.value);
+ }
+ return _results;
+ }).call(this);
+ return strings.join("").replace(/\{[0-9]\}/, number.toString());
+ };
+
+ TimespanFormatter.prototype.calculate_unit = function(seconds) {
+ if (seconds < 30) {
+ return "second";
+ } else if (seconds < 2670) {
+ return "minute";
+ } else if (seconds < 86369) {
+ return "hour";
+ } else if (seconds < 604800) {
+ return "day";
+ } else if (seconds < 2591969) {
+ return "week";
+ } else if (seconds < 31556926) {
+ return "month";
+ } else {
+ return "year";
+ }
+ };
+
+ TimespanFormatter.prototype.calculate_time = function(seconds, unit) {
+ return Math.round(seconds / this.time_in_seconds[unit]);
+ };
+
+ return TimespanFormatter;
+
+})();
+
+TwitterCldr.DateTimeFormatter = DateTimeFormatter = (function() {
+
+ function DateTimeFormatter() {
+ this.tokens = {"date_time":{"default":[{"value":"d","type":"pattern"},{"value":". ","type":"plaintext"},{"value":"M","type":"pattern"},{"value":". ","type":"plaintext"},{"value":"yyyy","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"H","type":"pattern"},{"value":":","type":"plaintext"},{"value":"mm","type":"pattern"},{"value":":","type":"plaintext"},{"value":"ss","type":"pattern"}],"full":[{"value":"EEEE","type":"pattern"},{"value":", ","type":"plaintext"},{"value":"d","type":"pattern"},{"value":". ","type":"plaintext"},{"value":"MMMM","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"y","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"H","type":"pattern"},{"value":":","type":"plaintext"},{"value":"mm","type":"pattern"},{"value":":","type":"plaintext"},{"value":"ss","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"zzzz","type":"pattern"}],"long":[{"value":"d","type":"pattern"},{"value":". ","type":"plaintext"},{"value":"MMMM","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"y","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"H","type":"pattern"},{"value":":","type":"plaintext"},{"value":"mm","type":"pattern"},{"value":":","type":"plaintext"},{"value":"ss","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"z","type":"pattern"}],"medium":[{"value":"d","type":"pattern"},{"value":". ","type":"plaintext"},{"value":"M","type":"pattern"},{"value":". ","type":"plaintext"},{"value":"yyyy","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"H","type":"pattern"},{"value":":","type":"plaintext"},{"value":"mm","type":"pattern"},{"value":":","type":"plaintext"},{"value":"ss","type":"pattern"}],"short":[{"value":"dd","type":"pattern"},{"value":".","type":"plaintext"},{"value":"MM","type":"pattern"},{"value":".","type":"plaintext"},{"value":"yy","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"H","type":"pattern"},{"value":":","type":"plaintext"},{"value":"mm","type":"pattern"}]},"time":{"default":[{"value":"H","type":"pattern"},{"value":":","type":"plaintext"},{"value":"mm","type":"pattern"},{"value":":","type":"plaintext"},{"value":"ss","type":"pattern"}],"full":[{"value":"H","type":"pattern"},{"value":":","type":"plaintext"},{"value":"mm","type":"pattern"},{"value":":","type":"plaintext"},{"value":"ss","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"zzzz","type":"pattern"}],"long":[{"value":"H","type":"pattern"},{"value":":","type":"plaintext"},{"value":"mm","type":"pattern"},{"value":":","type":"plaintext"},{"value":"ss","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"z","type":"pattern"}],"medium":[{"value":"H","type":"pattern"},{"value":":","type":"plaintext"},{"value":"mm","type":"pattern"},{"value":":","type":"plaintext"},{"value":"ss","type":"pattern"}],"short":[{"value":"H","type":"pattern"},{"value":":","type":"plaintext"},{"value":"mm","type":"pattern"}]},"date":{"default":[{"value":"d","type":"pattern"},{"value":". ","type":"plaintext"},{"value":"M","type":"pattern"},{"value":". ","type":"plaintext"},{"value":"yyyy","type":"pattern"}],"full":[{"value":"EEEE","type":"pattern"},{"value":", ","type":"plaintext"},{"value":"d","type":"pattern"},{"value":". ","type":"plaintext"},{"value":"MMMM","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"y","type":"pattern"}],"long":[{"value":"d","type":"pattern"},{"value":". ","type":"plaintext"},{"value":"MMMM","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"y","type":"pattern"}],"medium":[{"value":"d","type":"pattern"},{"value":". ","type":"plaintext"},{"value":"M","type":"pattern"},{"value":". ","type":"plaintext"},{"value":"yyyy","type":"pattern"}],"short":[{"value":"dd","type":"pattern"},{"value":".","type":"plaintext"},{"value":"MM","type":"pattern"},{"value":".","type":"plaintext"},{"value":"yy","type":"pattern"}]}};
+ this.calendar = {"days":{"format":{"abbreviated":{"fri":"pá","mon":"po","sat":"so","sun":"ne","thu":"čt","tue":"út","wed":"st"},"narrow":{"fri":"P","mon":"P","sat":"S","sun":"N","thu":"Č","tue":"Ú","wed":"S"},"wide":{"fri":"pátek","mon":"pondělí","sat":"sobota","sun":"neděle","thu":"čtvrtek","tue":"úterý","wed":"středa"}},"stand-alone":{"abbreviated":{"fri":"pá","mon":"po","sat":"so","sun":"ne","thu":"čt","tue":"út","wed":"st"},"narrow":{"fri":"P","mon":"P","sat":"S","sun":"N","thu":"Č","tue":"Ú","wed":"S"},"wide":{"fri":"pátek","mon":"pondělí","sat":"sobota","sun":"neděle","thu":"čtvrtek","tue":"úterý","wed":"středa"}}},"eras":{"abbr":{"0":"př. n. l.","1":"n. l."},"name":{"0":"př. n. l.","1":"n. l."},"narrow":{"0":"př.n.l.","1":"n. l."}},"fields":{"day":"Den","dayperiod":"AM/PM","era":"Letopočet","hour":"Hodina","minute":"Minuta","month":"Měsíc","second":"Sekunda","week":"Týden","weekday":"Den v týdnu","year":"Rok","zone":"Časové pásmo"},"formats":{"date":{"default":{"pattern":"d. M. yyyy"},"full":{"pattern":"EEEE, d. MMMM y"},"long":{"pattern":"d. MMMM y"},"medium":{"pattern":"d. M. yyyy"},"short":{"pattern":"dd.MM.yy"}},"datetime":{"default":{"pattern":"{{date}} {{time}}"},"full":{"pattern":"{{date}} {{time}}"},"long":{"pattern":"{{date}} {{time}}"},"medium":{"pattern":"{{date}} {{time}}"},"short":{"pattern":"{{date}} {{time}}"}},"time":{"default":{"pattern":"H:mm:ss"},"full":{"pattern":"H:mm:ss zzzz"},"long":{"pattern":"H:mm:ss z"},"medium":{"pattern":"H:mm:ss"},"short":{"pattern":"H:mm"}}},"months":{"format":{"abbreviated":{"1":"Led","10":"Říj","11":"Lis","12":"Pro","2":"Úno","3":"Bře","4":"Dub","5":"Kvě","6":"Čer","7":"Čvc","8":"Srp","9":"Zář"},"narrow":{"1":1,"10":10,"11":11,"12":12,"2":2,"3":3,"4":4,"5":5,"6":6,"7":7,"8":8,"9":9},"wide":{"1":"ledna","10":"října","11":"listopadu","12":"prosince","2":"února","3":"března","4":"dubna","5":"května","6":"června","7":"července","8":"srpna","9":"září"}},"stand-alone":{"abbreviated":{"1":"1.","10":"10.","11":"11.","12":"12.","2":"2.","3":"3.","4":"4.","5":"5.","6":"6.","7":"7.","8":"8.","9":"9."},"narrow":{"1":"l","10":"ř","11":"l","12":"p","2":"ú","3":"b","4":"d","5":"k","6":"č","7":"č","8":"s","9":"z"},"wide":{"1":"leden","10":"říjen","11":"listopad","12":"prosinec","2":"únor","3":"březen","4":"duben","5":"květen","6":"červen","7":"červenec","8":"srpen","9":"září"}}},"periods":{"format":{"abbreviated":null,"narrow":null,"wide":{"am":"dop.","pm":"odp."}},"stand-alone":{}},"quarters":{"format":{"abbreviated":{"1":"Q1","2":"Q2","3":"Q3","4":"Q4"},"narrow":{"1":1,"2":2,"3":3,"4":4},"wide":{"1":"1. čtvrtletí","2":"2. čtvrtletí","3":"3. čtvrtletí","4":"4. čtvrtletí"}},"stand-alone":{"abbreviated":{"1":"Q1","2":"Q2","3":"Q3","4":"Q4"},"narrow":{"1":1,"2":2,"3":3,"4":4},"wide":{"1":"1. čtvrtletí","2":"2. čtvrtletí","3":"3. čtvrtletí","4":"4. čtvrtletí"}}}};
+ this.weekday_keys = ["sun", "mon", "tue", "wed", "thu", "fri", "sat"];
+ this.methods = {
+ 'G': 'era',
+ 'y': 'year',
+ 'Y': 'year_of_week_of_year',
+ 'Q': 'quarter',
+ 'q': 'quarter_stand_alone',
+ 'M': 'month',
+ 'L': 'month_stand_alone',
+ 'w': 'week_of_year',
+ 'W': 'week_of_month',
+ 'd': 'day',
+ 'D': 'day_of_month',
+ 'F': 'day_of_week_in_month',
+ 'E': 'weekday',
+ 'e': 'weekday_local',
+ 'c': 'weekday_local_stand_alone',
+ 'a': 'period',
+ 'h': 'hour',
+ 'H': 'hour',
+ 'K': 'hour',
+ 'k': 'hour',
+ 'm': 'minute',
+ 's': 'second',
+ 'S': 'second_fraction',
+ 'z': 'timezone',
+ 'Z': 'timezone',
+ 'v': 'timezone_generic_non_location',
+ 'V': 'timezone_metazone'
+ };
+ }
+
+ DateTimeFormatter.prototype.format = function(obj, options) {
+ var format_token, token, tokens,
+ _this = this;
+ format_token = function(token) {
+ var result;
+ result = "";
+ switch (token.type) {
+ case "pattern":
+ return _this.result_for_token(token, obj);
+ default:
+ if (token.value.length > 0 && token.value[0] === "'" && token.value[token.value.length - 1] === "'") {
+ return token.value.substring(1, token.value.length - 1);
+ } else {
+ return token.value;
+ }
+ }
+ };
+ tokens = this.get_tokens(obj, options);
+ return ((function() {
+ var _i, _len, _results;
+ _results = [];
+ for (_i = 0, _len = tokens.length; _i < _len; _i++) {
+ token = tokens[_i];
+ _results.push(format_token(token));
+ }
+ return _results;
+ })()).join("");
+ };
+
+ DateTimeFormatter.prototype.get_tokens = function(obj, options) {
+ return this.tokens[options.format || "date_time"][options.type || "default"];
+ };
+
+ DateTimeFormatter.prototype.result_for_token = function(token, date) {
+ return this[this.methods[token.value[0]]](date, token.value, token.value.length);
+ };
+
+ DateTimeFormatter.prototype.era = function(date, pattern, length) {
+ var choices, index;
+ switch (length) {
+ case 1:
+ case 2:
+ case 3:
+ choices = this.calendar["eras"]["abbr"];
+ break;
+ default:
+ choices = this.calendar["eras"]["name"];
+ }
+ index = date.getFullYear() < 0 ? 0 : 1;
+ return choices[index];
+ };
+
+ DateTimeFormatter.prototype.year = function(date, pattern, length) {
+ var year;
+ year = date.getFullYear().toString();
+ if (length === 2) {
+ if (year.length !== 1) {
+ year = year.slice(-2);
+ }
+ }
+ if (length > 1) {
+ year = ("0000" + year).slice(-length);
+ }
+ return year;
+ };
+
+ DateTimeFormatter.prototype.year_of_week_of_year = function(date, pattern, length) {
+ throw 'not implemented';
+ };
+
+ DateTimeFormatter.prototype.day_of_week_in_month = function(date, pattern, length) {
+ throw 'not implemented';
+ };
+
+ DateTimeFormatter.prototype.quarter = function(date, pattern, length) {
+ var quarter;
+ quarter = ((date.getMonth() / 3) | 0) + 1;
+ switch (length) {
+ case 1:
+ return quarter.toString();
+ case 2:
+ return ("0000" + quarter.toString()).slice(-length);
+ case 3:
+ return this.calendar.quarters.format.abbreviated[quarter];
+ case 4:
+ return this.calendar.quarters.format.wide[quarter];
+ }
+ };
+
+ DateTimeFormatter.prototype.quarter_stand_alone = function(date, pattern, length) {
+ var quarter;
+ quarter = (date.getMonth() - 1) / 3 + 1;
+ switch (length) {
+ case 1:
+ return quarter.toString();
+ case 2:
+ return ("0000" + quarter.toString()).slice(-length);
+ case 3:
+ throw 'not yet implemented (requires cldr\'s "multiple inheritance")';
+ break;
+ case 4:
+ throw 'not yet implemented (requires cldr\'s "multiple inheritance")';
+ break;
+ case 5:
+ return this.calendar.quarters['stand-alone'].narrow[quarter];
+ }
+ };
+
+ DateTimeFormatter.prototype.month = function(date, pattern, length) {
+ var month_str;
+ month_str = (date.getMonth() + 1).toString();
+ switch (length) {
+ case 1:
+ return month_str;
+ case 2:
+ return ("0000" + month_str).slice(-length);
+ case 3:
+ return this.calendar.months.format.abbreviated[month_str];
+ case 4:
+ return this.calendar.months.format.wide[month_str];
+ case 5:
+ throw 'not yet implemented (requires cldr\'s "multiple inheritance")';
+ break;
+ default:
+ throw "Unknown date format";
+ }
+ };
+
+ DateTimeFormatter.prototype.month_stand_alone = function(date, pattern, length) {
+ switch (length) {
+ case 1:
+ return date.getMonth().toString();
+ case 2:
+ return ("0000" + date.getMonth().toString()).slice(-length);
+ case 3:
+ throw 'not yet implemented (requires cldr\'s "multiple inheritance")';
+ break;
+ case 4:
+ throw 'not yet implemented (requires cldr\'s "multiple inheritance")';
+ break;
+ case 5:
+ return this.calendar.months['stand-alone'].narrow[date.month];
+ default:
+ throw "Unknown date format";
+ }
+ };
+
+ DateTimeFormatter.prototype.day = function(date, pattern, length) {
+ switch (length) {
+ case 1:
+ return date.getDate().toString();
+ case 2:
+ return ("0000" + date.getDate().toString()).slice(-length);
+ }
+ };
+