summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPirate Praveen <praveen@debian.org>2020-09-16 11:22:35 +0200
committerPirate Praveen <praveen@debian.org>2020-09-16 11:22:35 +0200
commit67ce5367cadd21121b29b2446edb16acf8ebfa42 (patch)
treee32b0a982d0b5b227a9f6ec832b18ddb4dbbcb82
Import libjs-jquery-timeago_1.6.7.orig.tar.gz
[dgit import orig libjs-jquery-timeago_1.6.7.orig.tar.gz]
-rw-r--r--.github/no-response.yml13
-rw-r--r--.gitignore4
-rw-r--r--CNAME1
-rw-r--r--CONTRIBUTING.md37
-rw-r--r--LICENSE.txt22
-rw-r--r--README.markdown132
-rw-r--r--Rakefile50
-rw-r--r--bower.json12
-rw-r--r--clock.pngbin0 -> 5530 bytes
-rw-r--r--composer.json32
-rw-r--r--contrib/timeago-koext.js14
-rw-r--r--index.html224
-rw-r--r--jquery.timeago.js232
-rw-r--r--locales/README.md27
-rw-r--r--locales/jquery.timeago.af.js30
-rw-r--r--locales/jquery.timeago.am.js30
-rw-r--r--locales/jquery.timeago.ar.js104
-rw-r--r--locales/jquery.timeago.az-short.js30
-rw-r--r--locales/jquery.timeago.az.js30
-rw-r--r--locales/jquery.timeago.be.js43
-rw-r--r--locales/jquery.timeago.bg.js28
-rw-r--r--locales/jquery.timeago.bs.js55
-rw-r--r--locales/jquery.timeago.ca.js30
-rw-r--r--locales/jquery.timeago.cs.js34
-rw-r--r--locales/jquery.timeago.cy.js30
-rw-r--r--locales/jquery.timeago.da.js28
-rw-r--r--locales/jquery.timeago.de-short.js30
-rw-r--r--locales/jquery.timeago.de.js28
-rw-r--r--locales/jquery.timeago.dv.js32
-rw-r--r--locales/jquery.timeago.el.js28
-rw-r--r--locales/jquery.timeago.en-short.js30
-rw-r--r--locales/jquery.timeago.en.js30
-rw-r--r--locales/jquery.timeago.es-short.js31
-rw-r--r--locales/jquery.timeago.es.js29
-rw-r--r--locales/jquery.timeago.et.js28
-rw-r--r--locales/jquery.timeago.eu.js28
-rw-r--r--locales/jquery.timeago.fa-short.js30
-rw-r--r--locales/jquery.timeago.fa.js32
-rw-r--r--locales/jquery.timeago.fi.js38
-rw-r--r--locales/jquery.timeago.fr-short.js26
-rw-r--r--locales/jquery.timeago.fr.js27
-rw-r--r--locales/jquery.timeago.gl.js28
-rw-r--r--locales/jquery.timeago.he.js26
-rw-r--r--locales/jquery.timeago.hr.js54
-rw-r--r--locales/jquery.timeago.hu.js28
-rw-r--r--locales/jquery.timeago.hy.js28
-rw-r--r--locales/jquery.timeago.id.js29
-rw-r--r--locales/jquery.timeago.is.js29
-rw-r--r--locales/jquery.timeago.it-short.js30
-rw-r--r--locales/jquery.timeago.it.js28
-rw-r--r--locales/jquery.timeago.ja.js29
-rw-r--r--locales/jquery.timeago.jv.js28
-rw-r--r--locales/jquery.timeago.ko.js31
-rw-r--r--locales/jquery.timeago.ky.js42
-rw-r--r--locales/jquery.timeago.lt.js30
-rw-r--r--locales/jquery.timeago.lv.js30
-rw-r--r--locales/jquery.timeago.mk.js30
-rw-r--r--locales/jquery.timeago.nl.js30
-rw-r--r--locales/jquery.timeago.no.js28
-rw-r--r--locales/jquery.timeago.pl.js39
-rw-r--r--locales/jquery.timeago.pt-br-short.js30
-rw-r--r--locales/jquery.timeago.pt-br.js28
-rw-r--r--locales/jquery.timeago.pt-short.js30
-rw-r--r--locales/jquery.timeago.pt.js26
-rw-r--r--locales/jquery.timeago.ro.js29
-rw-r--r--locales/jquery.timeago.rs.js54
-rw-r--r--locales/jquery.timeago.ru.js43
-rw-r--r--locales/jquery.timeago.rw.js30
-rw-r--r--locales/jquery.timeago.si.js28
-rw-r--r--locales/jquery.timeago.sk.js34
-rw-r--r--locales/jquery.timeago.sl.js46
-rw-r--r--locales/jquery.timeago.sq.js26
-rw-r--r--locales/jquery.timeago.sr.js54
-rw-r--r--locales/jquery.timeago.sv.js28
-rw-r--r--locales/jquery.timeago.th.js30
-rw-r--r--locales/jquery.timeago.tr-short.js30
-rw-r--r--locales/jquery.timeago.tr.js26
-rw-r--r--locales/jquery.timeago.uk.js42
-rw-r--r--locales/jquery.timeago.ur.js30
-rwxr-xr-xlocales/jquery.timeago.uz.js29
-rw-r--r--locales/jquery.timeago.vi.js30
-rw-r--r--locales/jquery.timeago.zh-CN.js31
-rw-r--r--locales/jquery.timeago.zh-TW.js30
-rw-r--r--package.json37
-rw-r--r--test/index.html732
-rw-r--r--test/test_helpers.js215
-rw-r--r--timeago.jquery.json30
87 files changed, 4094 insertions, 0 deletions
diff --git a/.github/no-response.yml b/.github/no-response.yml
new file mode 100644
index 0000000..7e40c03
--- /dev/null
+++ b/.github/no-response.yml
@@ -0,0 +1,13 @@
+# Configuration for probot-no-response - https://github.com/probot/no-response
+
+# Number of days of inactivity before an Issue is closed for lack of response
+daysUntilClose: 7
+# Label requiring a response
+responseRequiredLabel: more-information-needed
+# Comment to post when closing an Issue for lack of response. Set to `false` to disable
+closeComment: >
+ This issue has been automatically closed because there has been no response
+ to our request for more information from the original author. With only the
+ information that is currently in the issue, we don't have enough information
+ to take action. Please reach out if you have or find the answers we need so
+ that we can investigate further.
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..db54837
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,4 @@
+.bundle
+vendor/ruby
+public
+node_modules/
diff --git a/CNAME b/CNAME
new file mode 100644
index 0000000..0e83d43
--- /dev/null
+++ b/CNAME
@@ -0,0 +1 @@
+timeago.yarp.com
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
new file mode 100644
index 0000000..accb164
--- /dev/null
+++ b/CONTRIBUTING.md
@@ -0,0 +1,37 @@
+## Want to Contribute?
+
+Found an issue? Thank you for helping out by reporting it. Please describe the
+problem, what you tried, what you expected to see, and what you actually
+experienced. Please [re-read the documentation](http://timeago.yarp.com/) to
+make sure you're using the API as designed, but if you found something that's
+broken, we really appreciate your efforts in letting us know. Bonus points for
+submitting a failing test case to help us diagnose and potentially fix the
+issue.
+
+## Want to Contribute?
+
+Awesome. We love help, but before getting started, please read:
+
+**[Don't "Push" Your Pull Requests](http://www.igvita.com/2011/12/19/dont-push-your-pull-requests/)**
+
+## Ready for a Pull-Request?
+
+1. Fork the repo.
+
+2. Run the tests. Run `rake` or open `open test/index.html`. We only take pull
+ requests with passing tests, and it's great to know that you started from a
+ clean slate.
+
+3. Add a test for your change. Only refactoring and documentation change
+ require no new tests. If you are adding functionality or fixing a bug, we
+ need a test!
+
+4. Make the test pass.
+
+5. Push to your fork (hopefully this comes from a topical branch) and submit a
+ pull request.
+
+At this point you're waiting on us. Please keep in mind that OSS maintainers
+are often very busy. We'll do our best to at least comment on issues and
+pull-requests as soon as possible, but sometimes life gets in the way. We may
+also suggest some changes or improvements or alternatives.
diff --git a/LICENSE.txt b/LICENSE.txt
new file mode 100644
index 0000000..4af20e7
--- /dev/null
+++ b/LICENSE.txt
@@ -0,0 +1,22 @@
+Copyright (c) 2008-2019 Ryan McGeary
+
+MIT License
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/README.markdown b/README.markdown
new file mode 100644
index 0000000..0b48e62
--- /dev/null
+++ b/README.markdown
@@ -0,0 +1,132 @@
+# timeago: a jQuery plugin
+
+[![NPM](https://img.shields.io/npm/v/timeago.svg)](https://www.npmjs.com/package/timeago)
+[![Bower](https://img.shields.io/bower/v/jquery-timeago.svg)](http://bower.io/search/?q=jquery-timeago)
+
+Timeago is a jQuery plugin that makes it easy to support automatically updating
+fuzzy timestamps (e.g. "4 minutes ago" or "about 1 day ago") from ISO 8601
+formatted dates and times embedded in your HTML (à la microformats).
+
+---
+
+**How You Can Help**
+
+[![Square Cash](http://img.shields.io/badge/square%20cash-$rmm5t-brightgreen.svg)][square]
+[![PayPal](http://img.shields.io/badge/paypal-rmm5t-blue.svg)][paypal]
+[![Book a Codementor session](http://img.shields.io/badge/codementor-book%20a%20session-orange.svg)][codementor]
+
+If you like this project, [buy me a coffee][paypal], or [book a session with me][codementor], or donate bitcoin: `1rmm5tv6f997JK5bLcGbRCZyVjZUPkQ2m`
+
+[square]: https://cash.me/$rmm5t/5 "Donate to rmm5t for open source!"
+[paypal]: https://www.paypal.me/rmm5t/5 "Donate to rmm5t for open source!"
+[bitcoin]: bitcoin:1rmm5tv6f997JK5bLcGbRCZyVjZUPkQ2m?amount=0.01&label=Coffee%20to%20rmm5t%20for%20Open%20Source "Buy rmm5t a coffee for open source!"
+[codementor]: https://www.codementor.io/rmm5t?utm_campaign=profile&utm_source=button-rmm5t&utm_medium=shields "Book a session with rmm5t on Codementor!"
+
+[![Twitter](https://img.shields.io/twitter/follow/rmm5t.svg?style=social)](https://twitter.com/rmm5t)
+[![Stack Overflow](https://img.shields.io/stackexchange/stackoverflow/r/8985.svg?style=social)](http://stackoverflow.com/users/8985/ryan-mcgeary)
+
+## Usage
+
+First, load jQuery and the plugin:
+
+```html
+<script src="jquery.min.js" type="text/javascript"></script>
+<script src="jquery.timeago.js" type="text/javascript"></script>
+```
+
+Now, let's attach it to your timestamps on DOM ready - put this in the head
+section:
+
+```html
+<script type="text/javascript">
+ jQuery(document).ready(function() {
+ $("time.timeago").timeago();
+ });
+</script>
+```
+
+This will turn all `<time>` elements with a class of `timeago` and a
+`datetime` attribute formatted according to the
+[ISO 8601](http://en.wikipedia.org/wiki/ISO_8601) standard:
+
+```html
+<time class="timeago" datetime="2011-12-17T09:24:17Z">December 17, 2011</time>
+```
+
+into something like this:
+
+```html
+<time class="timeago" datetime="2011-12-17T09:24:17Z" title="December 17, 2011">about 1 day ago</time>
+```
+
+`<abbr>` elements are also supported (this is for
+[legacy microformat support](http://microformats.org/wiki/datetime-design-pattern)
+and was originally supported by the library before the `time` element was
+introduced to HTML5):
+
+```html
+<abbr class="timeago" title="2011-12-17T09:24:17Z">December 17, 2011</abbr>
+```
+
+As time passes, the timestamps will automatically update.
+
+If you want to update a timestamp programatically later, call the `update`
+function with a new ISO8601 timestamp of `Date` object. For example:
+
+```javascript
+$("time#some_id").timeago("update", "2013-12-17T09:24:17Z");
+// or
+$("time#some_id").timeago("update", new Date());
+```
+
+**For more usage and examples**: [http://timeago.yarp.com/](http://timeago.yarp.com/)
+
+**For different language configurations**: visit the [`locales`](https://github.com/rmm5t/jquery-timeago/tree/master/locales) directory.
+
+## Settings
+
+**`cutoff`** : Return the original date if time distance is older than `cutoff` (miliseconds).
+
+```javascript
+// Display original dates older than 24 hours
+jQuery.timeago.settings.cutoff = 1000*60*60*24;
+```
+
+## Changes
+
+| Version | Notes |
+|---------|---------------------------------------------------------------------------------|
+| 1.6.x | ([compare][compare-1.6]) Wraped locales in UMD wrappers; locale improvements |
+| 1.5.x | ([compare][compare-1.5]) Added Date as argument to update function; locales |
+| 1.4.x | ([compare][compare-1.4]) Added allowPast setting; locale updates |
+| 1.3.x | ([compare][compare-1.3]) Added updateFromDOM function; bug fixes; bower support |
+| 1.2.x | ([compare][compare-1.2]) Added cutoff setting; locale updates |
+| 1.1.x | ([compare][compare-1.1]) Added update function; locale updates |
+| 1.0.x | ([compare][compare-1.0]) locale updates; bug fixes; AMD wrapper |
+| 0.11.x | ([compare][compare-0.11]) natural rounding; locale updates; |
+| 0.10.x | ([compare][compare-0.10]) locale updates |
+| 0.9.x | ([compare][compare-0.9]) microsecond support; bug fixes |
+| 0.8.x | ([compare][compare-0.8]) `<time>` element support; bug fixes |
+| 0.7.x | ([compare][compare-0.7]) locale function overrides; unit tests |
+| ... | ... |
+
+[compare-1.6]: https://github.com/rmm5t/jquery-timeago/compare/v1.5.4...v1.6.7
+[compare-1.5]: https://github.com/rmm5t/jquery-timeago/compare/v1.4.3...v1.5.4
+[compare-1.4]: https://github.com/rmm5t/jquery-timeago/compare/v1.3.2...v1.4.3
+[compare-1.3]: https://github.com/rmm5t/jquery-timeago/compare/v1.2.0...v1.3.2
+[compare-1.2]: https://github.com/rmm5t/jquery-timeago/compare/v1.1.0...v1.2.0
+[compare-1.1]: https://github.com/rmm5t/jquery-timeago/compare/v1.0.2...v1.1.0
+[compare-1.0]: https://github.com/rmm5t/jquery-timeago/compare/v0.11.4...v1.0.2
+[compare-0.11]: https://github.com/rmm5t/jquery-timeago/compare/v0.10.1...v0.11.4
+[compare-0.10]: https://github.com/rmm5t/jquery-timeago/compare/v0.9.3...v0.10.1
+[compare-0.9]: https://github.com/rmm5t/jquery-timeago/compare/v0.8.2...v0.9.3
+[compare-0.8]: https://github.com/rmm5t/jquery-timeago/compare/v0.7.2...v0.8.2
+[compare-0.7]: https://github.com/rmm5t/jquery-timeago/compare/v0.6.2...v0.7.2
+
+## Author
+
+[Ryan McGeary](http://ryan.mcgeary.org) ([@rmm5t](http://twitter.com/rmm5t))
+
+## License
+
+[MIT License](https://rmm5t.mit-license.org/)
diff --git a/Rakefile b/Rakefile
new file mode 100644
index 0000000..b359d38
--- /dev/null
+++ b/Rakefile
@@ -0,0 +1,50 @@
+require "bundler/setup"
+
+task default: :test
+
+desc "Publish new release"
+task :publish do
+ sh("git push --tags")
+ sh("npm publish")
+end
+
+desc "Open your default browser with the test page"
+task :test do
+ sh("open test/index.html")
+end
+
+desc "Automatically wrap given locale files in UMD declarations"
+task :umd, [:files] do |t, args|
+ def indent(str)
+ indented = str.split("\n").map do |line|
+ " #{line}"
+ end
+ indented.join("\n")
+ end
+
+ def wrap_in_umd(str)
+ <<~HEREDOC
+ (function (factory) {
+ if (typeof define === 'function' && define.amd) {
+ define(['jquery'], factory);
+ } else if (typeof module === 'object' && typeof module.exports === 'object') {
+ factory(require('jquery'));
+ } else {
+ factory(jQuery);
+ }
+ }(function (jQuery) {
+ #{indent(str)}
+ }));
+ HEREDOC
+ end
+
+ matches = Dir.glob(args[:files])
+ puts "Pattern did not match any file" if matches.length == 0
+ matches.each do |file|
+ input = File.read(file)
+ base = Pathname.new(file).basename
+ output = File.open("locales/#{base}", "w")
+ output.write(wrap_in_umd(input))
+ output.close
+ end
+end
diff --git a/bower.json b/bower.json
new file mode 100644
index 0000000..3690740
--- /dev/null
+++ b/bower.json
@@ -0,0 +1,12 @@
+{
+ "name": "jquery-timeago",
+ "license": "MIT",
+ "main": "jquery.timeago.js",
+ "ignore": [
+ "test",
+ "vendor"
+ ],
+ "dependencies": {
+ "jquery": ">=1.4"
+ }
+}
diff --git a/clock.png b/clock.png
new file mode 100644
index 0000000..4225cef
--- /dev/null
+++ b/clock.png
Binary files differ
diff --git a/composer.json b/composer.json
new file mode 100644
index 0000000..ae00fd5
--- /dev/null
+++ b/composer.json
@@ -0,0 +1,32 @@
+{
+ "name": "rmm5t/jquery-timeago",
+ "description": "jQuery plugin that makes it easy to support automatically updating fuzzy timestamps (e.g. \"4 minutes ago\" or \"about 1 day ago\").",
+ "license": "MIT",
+ "homepage": "http://timeago.yarp.com/",
+ "authors": [
+ {
+ "name": "Ryan McGeary",
+ "email": "ryan@mcgeary.org"
+ }
+ ],
+ "support": {
+ "issues": "https://github.com/rmm5t/jquery-timeago/issues"
+ },
+ "keywords": [
+ "time",
+ "microformat"
+ ],
+ "require": {
+ "components/jquery": ">=1.5.0 <4.0"
+ },
+ "extra": {
+ "component": {
+ "scripts": [
+ "jquery.timeago.js"
+ ],
+ "files": [
+ "locales/jquery.timeago.*.js"
+ ]
+ }
+ }
+}
diff --git a/contrib/timeago-koext.js b/contrib/timeago-koext.js
new file mode 100644
index 0000000..bec4d13
--- /dev/null
+++ b/contrib/timeago-koext.js
@@ -0,0 +1,14 @@
+ko.bindingHandlers.timeago = {
+ init: function (element, valueAccessor, allBindingsAccessor, viewModel, bindingContext) {
+ var value = valueAccessor();
+ var valueUnwrapped = ko.unwrap(value);
+ element.title = moment(valueUnwrapped).toISOString();
+ $(element).timeago();
+ },
+ update: function (element, valueAccessor, allBindingsAccessor, viewModel, bindingContext) {
+ var value = valueAccessor();
+ var valueUnwrapped = ko.unwrap(value);
+ element.title = moment(valueUnwrapped).toISOString();
+ $(element).timeago('update', element.title);
+ }
+}
diff --git a/index.html b/index.html
new file mode 100644
index 0000000..5216e1d
--- /dev/null
+++ b/index.html
@@ -0,0 +1,224 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+ <meta name="microid" content="mailto+http:sha1:566841e568e84b46c92d2291b44b836dfddc5c42" />
+ <title>timeago: a jQuery plugin</title>
+ <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
+ <script src="jquery.timeago.js" type="text/javascript"></script>
+ <script src="test/test_helpers.js" type="text/javascript"></script>
+ <script type="text/javascript">
+ jQuery(document).ready(function($) {
+ prepareDynamicDates();
+ $(".timeago").timeago();
+
+ $("#prog_date").text(jQuery.timeago(new Date()));
+ $("#prog_string").text(jQuery.timeago("2008-07-17"));
+ $("#prog_element").text(jQuery.timeago("2008-07-20"));
+ });
+
+ </script>
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/github-fork-ribbon-css/0.2.0/gh-fork-ribbon.min.css" />
+ <style>
+ * { margin: 0; padding: 0; }
+ body { font-family: Helvetica,Arial,sans-serif; color: #333; background-color: #ccc; font-size: 16px; line-height: 24px; }
+ h1 { margin: 0; font-size: 60px; line-height: 100px; text-align: center; }
+ h2 { margin: -30px 0 40px 50px; font-size: 20px; line-height: 20px; text-align: center; color: #999; }
+ h3 { margin: 24px 0 6px 0; font-size: 18px; line-height: 18px; border-bottom: 1px solid #ccc; }
+ h1 img { vertical-align: middle; }
+ p { margin: 0 0 24px 0; }
+ p.example { margin: 0 0 12px 0; }
+ p.how, p.last { margin: 0; }
+ ul { margin: 0 24px 24px; }
+ li { line-height: 24px; }
+ pre { background-color: #333; color: #fff; margin: 12px 0; font-size: 12px; padding: 0 6px; }
+ pre em { font-style: normal; background-color: #554; }
+ pre, tt { font-family: monaco, "courier new", mono, monospace; }
+ abbr[title], time[title] { border-bottom: 1px dotted #333; }
+ tt { font-size: 14px; }
+ a { color: #06e; padding: 1px; }
+ em { font-style: normal; background-color: #feb; }
+ a:hover { background-color: #06c; color: #fff; text-decoration: none; }
+ #content { margin:0 auto; padding: 24px; width:700px; background-color:#fff; border: 1px solid #999; border-width: 0 1px 1px 1px; }
+ #footer { margin:0 auto 24px; padding: 12px; width:700px; line-height: 24px; }
+ .help { font-size: 14px; color: #888; }
+ .github-fork-ribbon:before { background-color: #f80; }
+ </style>
+ <!-- Google Analytics -->
+ <script>
+ (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
+ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
+ m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
+ })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
+
+ ga('create', 'UA-2856277-2', 'auto');
+ ga('send', 'pageview');
+ </script>
+ <!-- End Google Analytics -->
+ </head>
+ <body>
+ <div id="content">
+ <h1><img src="clock.png" /> timeago</h1>
+ <h2>a jQuery plugin</h2>
+
+ <h3>What?</h3>
+ <p>
+ Timeago is a jQuery plugin that makes it easy to support automatically updating fuzzy
+ timestamps (e.g. "4 minutes ago" or "about 1 day ago"). <a href="jquery.timeago.js">Download</a>, view
+ the examples, and enjoy.
+ </p>
+ <noscript><p class="example"><strong>Whoah, whoah, whoah. You see the irony here, don't you? You're looking for a jQuery plugin, yet you surf the Internet with JavaScript turned off. This confuses the Interwebs. Afterall, there might be some useful demos and such that you could enjoy, but instead, you're wasting your time reading this. I'm so sorry.</strong></p></noscript>
+ <p class="example">
+ You opened this page <time class="loaded timeago">when you opened the page</time>. <span class="help">(This will update every minute. Wait for it.)</span>
+ </p>
+ <p class="example">
+ This page was last modified <time class="modified timeago">sometime before now [browser might not support document.lastModified]</time>.
+ </p>
+ <p class="example">
+ Ryan was born <time class="timeago" datetime="1978-12-18T17:17:00Z">Dec 18, 1978</time>.
+ </p>
+
+ <h3>Why?</h3>
+ <p>Timeago was originally built for use with <a href="http://yarp.com">Yarp.com</a> to timestamp comments.</p>
+ <ul>
+ <li>Avoid timestamps dated "1 minute ago" even though the page was opened 10 minutes ago; <em>timeago refreshes automatically</em>.</li>
+ <li>You can <em>take full advantage of page caching</em> in your web applications, because the timestamps aren't calculated on the server.</li>
+ <li>You get to <em>use standard HTML5 tags</em>.</li>
+ </ul>
+
+ <h3>How?</h3>
+ <p class="how">
+ First, load <a href="http://jquery.com/">jQuery</a> and the plugin:
+ </p>
+ <pre>
+&lt;script src=&quot;jquery.min.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;jquery.timeago.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;</pre>
+ <p class="how">
+ Now, let's attach it to your timestamps on DOM ready:
+ </p>
+ <pre>
+jQuery(document).ready(function() {
+ jQuery("time.timeago").timeago();
+});</pre>
+ <p class="how">
+ This will turn all <tt>time</tt> elements with a class
+ of <tt>timeago</tt> and an <a href="http://en.wikipedia.org/wiki/ISO_8601">ISO 8601</a> timestamp in the datetime:
+ </p>
+ <pre>
+&lt;time class=&quot;<em>timeago</em>&quot; datetime=&quot;<em>2008-07-17T09:24:17Z</em>&quot;&gt;July 17, 2008&lt;/time&gt;</pre>
+ <p class="how">
+ into something like this:
+ </p>
+ <pre>
+&lt;time class=&quot;timeago&quot; datetime=&quot;<em>2008-07-17T09:24:17Z</em>&quot; title=&quot;July 17, 2008&quot;&gt;<em><time class="timeago" datetime="2008-07-17T09:24:17Z">time ago</time></em>&lt;/time&gt;</pre>
+ <p>
+ which yields: <time class="timeago" datetime="2008-07-17T09:24:17Z">July 17, 2008</time>. As time passes, the timestamps will automatically update.
+ </p>
+
+ <p class="how">
+ You can also use it programmatically:
+ </p>
+ <pre>
+jQuery.timeago(new Date()); //=> &quot;<span id="prog_date"></span>&quot;
+jQuery.timeago("2008-07-17"); //=> &quot;<span id="prog_string"></span>&quot;
+jQuery.timeago(jQuery("time#some_id")); //=> &quot;<span id="prog_element"></span>&quot; // [title=&quot;2008-07-20&quot;]</pre>
+
+ <p class="how">
+ To support timestamps in the future, use the <tt>allowFuture</tt> setting:
+ </p>
+ <pre>
+jQuery.timeago.settings.allowFuture = true;</pre>
+
+ <p class="how">
+ To disable timestamps in the past, use the <tt>allowPast</tt> setting.
+ This setting is set to true by default. When set to false, if the time is in the past then instead of displaying a message like "5 minutes ago" a static message will be displayed.
+ The staic message displayed can be configured with the <tt>strings.inPast</tt> setting:
+ </p>
+ <pre>
+jQuery.timeago.settings.strings.inPast = "time has elapsed";
+jQuery.timeago.settings.allowPast = false;</pre>
+
+ <h3>Excusez-moi?</h3>
+ <p>
+ Yes, timeago has locale/i18n/language support. Here are some <a href="https://github.com/rmm5t/jquery-timeago/tree/master/locales">configuration examples</a>. Please submit a <a href="https://github.com/rmm5t/jquery-timeago">GitHub pull request</a> for corrections or additional languages.
+ </p>
+
+ <h3>Where?</h3>
+ <p><a href="jquery.timeago.js">Download the &quot;stable&quot; release</a>.</p>
+ <p>
+ The code is hosted on
+ GitHub: <a href="http://github.com/rmm5t/jquery-timeago">http://github.com/rmm5t/jquery-timeago</a>.
+ Go on, live on the edge.
+ </p>
+
+ <h3>Who?</h3>
+ <p>
+ Timeago was built by <a href="http://ryan.mcgeary.org">Ryan McGeary</a>
+ (<a href="http://twitter.com/rmm5t">@rmm5t</a>) while standing on the
+ shoulders of giants. John Resig wrote about
+ a <a href="http://ejohn.org/blog/javascript-pretty-date/">similar
+ approach</a>. The verbiage was based on
+ the <tt>distance_of_time_in_words</tt> ActionView helper
+ in <a href="http://rubyonrails.org">Ruby on Rails</a>.
+ </p>
+
+ <h3>When?</h3>
+ <p>
+ Timeago was conceived <time class="timeago" title="2008-07-17T02:30:00-0500">on July 17, 2008</time>. <span class="help">(Yup, that's powered by timeago too)</span>
+ </p>
+
+ <h3>What else?</h3>
+ <p class="example">
+ The HTML5 <tt>time</tt> tag is strongly recommended, but the legacy <a href="http://microformats.org/wiki/datetime-design-pattern">datetime microformat</a> using the <tt>abbr</tt> tag is also supported:
+ </p>
+ <pre>
+&lt;abbr class=&quot;<em>timeago</em>&quot; title=&quot;<em>2008-07-17T09:24:17Z</em>&quot;&gt;July 17, 2008&lt;/abbr&gt;</pre>
+ <p class="how">
+ Attach timeago like so:
+ </p>
+ <pre>
+jQuery(document).ready(function() {
+ jQuery("abbr.timeago").timeago();
+});</pre>
+
+ <p>
+ Are you concerned about time zone support? Don't be. Timeago handles
+ this too. As long as your timestamps are
+ in <a href="http://en.wikipedia.org/wiki/ISO_8601">ISO 8601</a> format
+ and include a
+ full <a href="http://en.wikipedia.org/wiki/ISO_8601#Time_zone_designators">time
+ zone designator</a> (±hhmm), everything should work out of the box
+ regardless of the time zone that your visitors live in.
+ </p>
+
+ <h3>Huh?</h3>
+ <p class="last">
+ Need a Rails helper to make those fancy microformat <tt>time</tt> tags? Fine, here ya go:
+ </p>
+ <pre>
+def timeago(time, options = {})
+ options[:class] ||= "timeago"
+ content_tag(:time, time.to_s, options.merge(datetime: time.getutc.iso8601)) if time
+end</pre>
+
+ <h3>Do you use Timeago?</h3>
+
+ <p>
+ Great! Please add your site to the list
+ of <a href="https://github.com/rmm5t/jquery-timeago/wiki/Sites-that-use-Timeago">Sites
+ that use Timeago</a>.
+ </p>
+
+ </div>
+ <div id="footer">
+ <div style="float:right;">
+ <a href="http://www.opensource.org/licenses/mit-license.php">MIT
+ License</a>
+ </div>
+ Copyright &copy; 2008-2019 <a href="http://ryan.mcgeary.org">Ryan McGeary</a>
+ (<a href="http://twitter.com/rmm5t">@rmm5t</a>)
+ </div>
+
+ <a class="github-fork-ribbon" href="http://github.com/rmm5t/jquery-timeago" title="Fork me on GitHub">Fork me on GitHub</a>
+ </body>
+</html>
diff --git a/jquery.timeago.js b/jquery.timeago.js
new file mode 100644
index 0000000..d949b77
--- /dev/null
+++ b/jquery.timeago.js
@@ -0,0 +1,232 @@
+/**
+ * Timeago is a jQuery plugin that makes it easy to support automatically
+ * updating fuzzy timestamps (e.g. "4 minutes ago" or "about 1 day ago").
+ *
+ * @name timeago
+ * @version 1.6.7
+ * @requires jQuery >=1.5.0 <4.0
+ * @author Ryan McGeary
+ * @license MIT License - http://www.opensource.org/licenses/mit-license.php
+ *
+ * For usage and examples, visit:
+ * http://timeago.yarp.com/
+ *
+ * Copyright (c) 2008-2019, Ryan McGeary (ryan -[at]- mcgeary [*dot*] org)
+ */
+
+(function (factory) {
+ if (typeof define === 'function' && define.amd) {
+ // AMD. Register as an anonymous module.
+ define(['jquery'], factory);
+ } else if (typeof module === 'object' && typeof module.exports === 'object') {
+ factory(require('jquery'));
+ } else {
+ // Browser globals
+ factory(jQuery);
+ }
+}(function ($) {
+ $.timeago = function(timestamp) {
+ if (timestamp instanceof Date) {
+ return inWords(timestamp);
+ } else if (typeof timestamp === "string") {
+ return inWords($.timeago.parse(timestamp));
+ } else if (typeof timestamp === "number") {
+ return inWords(new Date(timestamp));
+ } else {
+ return inWords($.timeago.datetime(timestamp));
+ }
+ };
+ var $t = $.timeago;
+
+ $.extend($.timeago, {
+ settings: {
+ refreshMillis: 60000,
+ allowPast: true,
+ allowFuture: false,
+ localeTitle: false,
+ cutoff: 0,
+ autoDispose: true,
+ strings: {
+ prefixAgo: null,
+ prefixFromNow: null,
+ suffixAgo: "ago",
+ suffixFromNow: "from now",
+ inPast: 'any moment now',
+ seconds: "less than a minute",
+ minute: "about a minute",
+ minutes: "%d minutes",
+ hour: "about an hour",
+ hours: "about %d hours",
+ day: "a day",
+ days: "%d days",
+ month: "about a month",
+ months: "%d months",
+ year: "about a year",
+ years: "%d years",
+ wordSeparator: " ",
+ numbers: []
+ }
+ },
+
+ inWords: function(distanceMillis) {
+ if (!this.settings.allowPast && ! this.settings.allowFuture) {
+ throw 'timeago allowPast and allowFuture settings can not both be set to false.';
+ }
+
+ var $l = this.settings.strings;
+ var prefix = $l.prefixAgo;
+ var suffix = $l.suffixAgo;
+ if (this.settings.allowFuture) {
+ if (distanceMillis < 0) {
+ prefix = $l.prefixFromNow;
+ suffix = $l.suffixFromNow;
+ }
+ }
+
+ if (!this.settings.allowPast && distanceMillis >= 0) {
+ return this.settings.strings.inPast;
+ }
+
+ var seconds = Math.abs(distanceMillis) / 1000;
+ var minutes = seconds / 60;
+ var hours = minutes / 60;
+ var days = hours / 24;
+ var years = days / 365;
+
+ function substitute(stringOrFunction, number) {
+ var string = $.isFunction(stringOrFunction) ? stringOrFunction(number, distanceMillis) : stringOrFunction;
+ var value = ($l.numbers && $l.numbers[number]) || number;
+ return string.replace(/%d/i, value);
+ }
+
+ var words = seconds < 45 && substitute($l.seconds, Math.round(seconds)) ||
+ seconds < 90 && substitute($l.minute, 1) ||
+ minutes < 45 && substitute($l.minutes, Math.round(minutes)) ||
+ minutes < 90 && substitute($l.hour, 1) ||
+ hours < 24 && substitute($l.hours, Math.round(hours)) ||
+ hours < 42 && substitute($l.day, 1) ||
+ days < 30 && substitute($l.days, Math.round(days)) ||
+ days < 45 && substitute($l.month, 1) ||
+ days < 365 && substitute($l.months, Math.round(days / 30)) ||
+ years < 1.5 && substitute($l.year, 1) ||
+ substitute($l.years, Math.round(years));
+
+ var separator = $l.wordSeparator || "";
+ if ($l.wordSeparator === undefined) { separator = " "; }
+ return $.trim([prefix, words, suffix].join(separator));
+ },
+
+ parse: function(iso8601) {
+ var s = $.trim(iso8601);
+ s = s.replace(/\.\d+/,""); // remove milliseconds
+ s = s.replace(/-/,"/").replace(/-/,"/");
+ s = s.replace(/T/," ").replace(/Z/," UTC");
+ s = s.replace(/([\+\-]\d\d)\:?(\d\d)/," $1$2"); // -04:00 -> -0400
+ s = s.replace(/([\+\-]\d\d)$/," $100"); // +09 -> +0900
+ return new Date(s);
+ },
+ datetime: function(elem) {
+ var iso8601 = $t.isTime(elem) ? $(elem).attr("datetime") : $(elem).attr("title");
+ return $t.parse(iso8601);
+ },
+ isTime: function(elem) {
+ // jQuery's `is()` doesn't play well with HTML5 in IE
+ return $(elem).get(0).tagName.toLowerCase() === "time"; // $(elem).is("time");
+ }
+ });
+
+ // functions that can be called via $(el).timeago('action')
+ // init is default when no action is given
+ // functions are called with context of a single element
+ var functions = {
+ init: function() {
+ functions.dispose.call(this);
+ var refresh_el = $.proxy(refresh, this);
+ refresh_el();
+ var $s = $t.settings;
+ if ($s.refreshMillis > 0) {
+ this._timeagoInterval = setInterval(refresh_el, $s.refreshMillis);
+ }
+ },
+ update: function(timestamp) {
+ var date = (timestamp instanceof Date) ? timestamp : $t.parse(timestamp);
+ $(this).data('timeago', { datetime: date });
+ if ($t.settings.localeTitle) {
+ $(this).attr("title", date.toLocaleString());
+ }
+ refresh.apply(this);
+ },
+ updateFromDOM: function() {
+ $(this).data('timeago', { datetime: $t.parse( $t.isTime(this) ? $(this).attr("datetime") : $(this).attr("title") ) });
+ refresh.apply(this);
+ },
+ dispose: function () {
+ if (this._timeagoInterval) {
+ window.clearInterval(this._timeagoInterval);
+ this._timeagoInterval = null;
+ }
+ }
+ };
+
+ $.fn.timeago = function(action, options) {
+ var fn = action ? functions[action] : functions.init;
+ if (!fn) {
+ throw new Error("Unknown function name '"+ action +"' for timeago");
+ }
+ // each over objects here and call the requested function
+ this.each(function() {
+ fn.call(this, options);
+ });
+ return this;
+ };
+
+ function refresh() {
+ var $s = $t.settings;
+
+ //check if it's still visible
+ if ($s.autoDispose && !$.contains(document.documentElement,this)) {
+ //stop if it has been removed
+ $(this).timeago("dispose");
+ return this;
+ }
+
+ var data = prepareData(this);
+
+ if (!isNaN(data.datetime)) {
+ if ( $s.cutoff === 0 || Math.abs(distance(data.datetime)) < $s.cutoff) {
+ $(this).text(inWords(data.datetime));
+ } else {
+ if ($(this).attr('title').length > 0) {
+ $(this).text($(this).attr('title'));
+ }
+ }
+ }
+ return this;
+ }
+
+ function prepareData(element) {
+ element = $(element);
+ if (!element.data("timeago")) {
+ element.data("timeago", { datetime: $t.datetime(element) });
+ var text = $.trim(element.text());
+ if ($t.settings.localeTitle) {
+ element.attr("title", element.data('timeago').datetime.toLocaleString());
+ } else if (text.length > 0 && !($t.isTime(element) && element.attr("title"))) {
+ element.attr("title", text);
+ }
+ }
+ return element.data("timeago");
+ }
+
+ function inWords(date) {
+ return $t.inWords(distance(date));
+ }
+
+ function distance(date) {
+ return (new Date().getTime() - date.getTime());
+ }
+
+ // fix for IE6 suckage
+ document.createElement("abbr");
+ document.createElement("time");
+}));
diff --git a/locales/README.md b/locales/README.md
new file mode 100644
index 0000000..7557112
--- /dev/null
+++ b/locales/README.md
@@ -0,0 +1,27 @@
+# Locale override examples for timeago
+
+You can represent time statements in most western languages where
+a prefix and/or suffix is used.
+
+The default case is to use suffix only (as in English), which you
+do by providing the `suffixAgo` and `suffixFromNow` settings in
+the strings hash (earlier versions of timeago used the deprecated
+`ago` and `fromNow` options). If present, they are used.
+
+ 2 minutes [suffixAgo]
+ 2 minutes [suffixFromNow]
+
+In case you want to use prefix only instead of
+suffix (e.g. Greek), you provide the `prefixAgo` and
+`prefixFromNow` options in the strings hash and leave `suffixAgo`
+and `suffixFromNow` empty or null.
+
+ [prefixAgo] 2 minutes
+ [prefixFromNow] 2 minutes
+
+For languages where you want to use a prefix only for future
+tense and prefix/suffix for past tense (for example swedish), you
+can combine the prefix and suffixes as needed.
+
+ [prefixAgo] 2 minutes [suffixAgo]
+ [prefixFromNow] 2 minutes
diff --git a/locales/jquery.timeago.af.js b/locales/jquery.timeago.af.js
new file mode 100644
index 0000000..817a7fa
--- /dev/null
+++ b/locales/jquery.timeago.af.js
@@ -0,0 +1,30 @@
+(function (factory) {
+ if (typeof define === 'function' && define.amd) {
+ define(['jquery'], factory);
+ } else if (typeof module === 'object' && typeof module.exports === 'object') {
+ factory(require('jquery'));
+ } else {
+ factory(jQuery);
+ }
+}(function (jQuery) {
+ // Afrikaans
+ jQuery.timeago.settings.strings = {
+ prefixAgo: null,
+ prefixFromNow: null,
+ suffixAgo: "gelede",
+ suffixFromNow: "van nou af",
+ seconds: "%d sekondes",
+ minute: "1 minuut",
+ minutes: "%d minute",
+ hour: "1 uur",
+ hours: "%d ure",
+ day: "1 dag",
+ days: "%d dae",
+ month: "1 maand",
+ months: "%d maande",
+ year: "1 jaar",
+ years: "%d jaar",
+ wordSeparator: " ",
+ numbers: []
+ };
+}));
diff --git a/locales/jquery.timeago.am.js b/locales/jquery.timeago.am.js
new file mode 100644
index 0000000..65502c3
--- /dev/null
+++ b/locales/jquery.timeago.am.js
@@ -0,0 +1,30 @@
+(function (factory) {
+ if (typeof define === 'function' && define.amd) {
+ define(['jquery'], factory);
+ } else if (typeof module === 'object' && typeof module.exports === 'object') {
+ factory(require('jquery'));
+ } else {
+ factory(jQuery);
+ }
+}(function (jQuery) {
+ // Amharic
+ jQuery.timeago.settings.strings = {
+ prefixAgo: null,
+ prefixFromNow: null,
+ suffixAgo: "በፊት",
+ suffixFromNow: "በኋላ",
+ seconds: "ከአንድ ደቂቃ በታች",
+ minute: "ከአንድ ደቂቃ ገደማ",
+ minutes: "ከ%d ደቂቃ",
+ hour: "ከአንድ ሰዓት ገደማ",
+ hours: "ከ%d ሰዓት ገደማ",
+ day: "ከአንድ ቀን",
+ days: "ከ%d ቀን",
+ month: "ከአንድ ወር ገደማ",
+ months: "ከ%d ወር",
+ year: "ከአንድ ዓመት ገደማ",
+ years: "ከ%d ዓመት",
+ wordSeparator: " ",
+ numbers: []
+ };
+}));
diff --git a/locales/jquery.timeago.ar.js b/locales/jquery.timeago.ar.js
new file mode 100644
index 0000000..14cd18f
--- /dev/null
+++ b/locales/jquery.timeago.ar.js
@@ -0,0 +1,104 @@
+(function (factory) {
+ if (typeof define === 'function' && define.amd) {
+ define(['jquery'], factory);
+ } else if (typeof module === 'object' && typeof module.exports === 'object') {
+ factory(require('jquery'));
+ } else {
+ factory(jQuery);
+ }
+}(function (jQuery) {
+ function numpf(n, a) {
+ return a[plural=n===0 ? 0 : n===1 ? 1 : n===2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 ? 4 : 5];
+ }
+
+ jQuery.timeago.settings.strings = {
+ prefixAgo: "منذ",
+ prefixFromNow: "بعد",
+ suffixAgo: null,
+ suffixFromNow: null, // null OR "من الآن"
+ second: function(value) { return numpf(value, [
+ 'أقل من ثانية',
+ 'ثانية واحدة',
+ 'ثانيتين',
+ '%d ثوانٍ',
+ '%d ثانية',
+ '%d ثانية']); },
+ seconds: function(value) { return numpf(value, [
+ 'أقل من ثانية',
+ 'ثانية واحدة',
+ 'ثانيتين',
+ '%d ثوانٍ',
+ '%d ثانية',
+ '%d ثانية']); },
+ minute: function(value) { return numpf(value, [
+ 'أقل من دقيقة',
+ 'دقيقة واحدة',
+ 'دقيقتين',
+ '%d دقائق',
+ '%d دقيقة',
+ 'دقيقة']); },
+ minutes: function(value) { return numpf(value, [
+ 'أقل من دقيقة',
+ 'دقيقة واحدة',
+ 'دقيقتين',
+ '%d دقائق',
+ '%d دقيقة',
+ 'دقيقة']); },
+ hour: function(value) { return numpf(value, [
+ 'أقل من ساعة',
+ 'ساعة واحدة',
+ 'ساعتين',
+ '%d ساعات',
+ '%d ساعة',
+ '%d ساعة']); },
+ hours: function(value) { return numpf(value, [
+ 'أقل من ساعة',
+ 'ساعة واحدة',
+ 'ساعتين',
+ '%d ساعات',
+ '%d ساعة',
+ '%d ساعة']); },
+ day: function(value) { return numpf(value, [
+ 'أقل من يوم',
+ 'يوم واحد',
+ 'يومين',
+ '%d أيام',
+ '%d يومًا',
+ '%d يوم']); },
+ days: function(value) { return numpf(value, [
+ 'أقل من يوم',
+ 'يوم واحد',
+ 'يومين',
+ '%d أيام',
+ '%d يومًا',
+ '%d يوم']); },
+ month: function(value) { return numpf(value, [
+ 'أقل من شهر',
+ 'شهر واحد',
+ 'شهرين',
+ '%d أشهر',
+ '%d شهرًا',
+ '%d شهر']); },
+ months: function(value) { return numpf(value, [
+ 'أقل من شهر',
+ 'شهر واحد',
+ 'شهرين',
+ '%d أشهر',
+ '%d شهرًا',
+ '%d شهر']); },
+ year: function(value) { return numpf(value, [
+ 'أقل من عام',
+ 'عام واحد',
+ '%d عامين',
+ '%d أعوام',
+ '%d عامًا']);
+ },
+ years: function(value) { return numpf(value, [
+ 'أقل من عام',
+ 'عام واحد',
+ 'عامين',
+ '%d أعوام',
+ '%d عامًا',
+ '%d عام']);}
+ };
+}));
diff --git a/locales/jquery.timeago.az-short.js b/locales/jquery.timeago.az-short.js
new file mode 100644
index 0000000..a1d5740
--- /dev/null
+++ b/locales/jquery.timeago.az-short.js
@@ -0,0 +1,30 @@
+(function (factory) {
+ if (typeof define === 'function' && define.amd) {
+ define(['jquery'], factory);
+ } else if (typeof module === 'object' && typeof module.exports === 'object') {
+ factory(require('jquery'));
+ } else {
+ factory(jQuery);
+ }
+}(function (jQuery) {
+ // Azerbaijani shortened
+ jQuery.timeago.settings.strings = {
+ prefixAgo: null,
+ prefixFromNow: null,
+ suffixAgo: "",
+ suffixFromNow: "",
+ seconds: '1 dəq',
+ minute: '1 dəq',
+ minutes: '%d dəq',
+ hour: '1 saat',
+ hours: '%d saat',
+ day: '1 gün',
+ days: '%d gün',
+ month: '1 ay',
+ months: '%d ay',
+ year: '1 il',
+ years: '%d il',
+ wordSeparator: '',
+ numbers: []
+ };
+}));
diff --git a/locales/jquery.timeago.az.js b/locales/jquery.timeago.az.js
new file mode 100644
index 0000000..8332c41
--- /dev/null
+++ b/locales/jquery.timeago.az.js
@@ -0,0 +1,30 @@
+(function (factory) {
+ if (typeof define === 'function' && define.amd) {
+ define(['jquery'], factory);
+ } else if (typeof module === 'object' && typeof module.exports === 'object') {
+ factory(require('jquery'));
+ } else {
+ factory(jQuery);
+ }
+}(function (jQuery) {
+ // Azerbaijani
+ jQuery.timeago.settings.strings = {
+ prefixAgo: null,
+ prefixFromNow: null,
+ suffixAgo: 'əvvəl',
+ suffixFromNow: 'sonra',
+ seconds: 'saniyələr',
+ minute: '1 dəqiqə',
+ minutes: '%d dəqiqə',
+ hour: '1 saat',
+ hours: '%d saat',
+ day: '1 gün',
+ days: '%d gün',
+ month: '1 ay',
+ months: '%d ay',
+ year: '1 il',
+ years: '%d il',
+ wordSeparator: '',
+ numbers: []
+ };
+}));
diff --git a/locales/jquery.timeago.be.js b/locales/jquery.timeago.be.js
new file mode 100644
index 0000000..50efb8c
--- /dev/null
+++ b/locales/jquery.timeago.be.js
@@ -0,0 +1,43 @@
+(function (factory) {
+ if (typeof define === 'function' && define.amd) {
+ define(['jquery'], factory);
+ } else if (typeof module === 'object' && typeof module.exports === 'object') {
+ factory(require('jquery'));
+ } else {
+ factory(jQuery);
+ }
+ }(function (jQuery) {
+ // Belarusian
+ function numpf(n, f, s, t) {
+ // f - 1, 21, 31, ...
+ // s - 2-4, 22-24, 32-34 ...
+ // t - 5-20, 25-30, ...
+ n = n % 100;
+ var n10 = n % 10;
+ if ( (n10 === 1) && ( (n === 1) || (n > 20) ) ) {
+ return f;
+ } else if ( (n10 > 1) && (n10 < 5) && ( (n > 20) || (n < 10) ) ) {
+ return s;
+ } else {
+ return t;
+ }
+ }
+
+ jQuery.timeago.settings.strings = {
+ prefixAgo: null,
+ prefixFromNow: "праз",
+ suffixAgo: "таму",
+ suffixFromNow: null,
+ seconds: "менш хвіліны",
+ minute: "хвіліну",
+ minutes: function(value) { return numpf(value, "%d хвіліна", "%d хвіліны", "%d хвілін"); },
+ hour: "гадзіну",
+ hours: function(value) { return numpf(value, "%d гадзіна", "%d гадзіны", "%d гадзін"); },
+ day: "дзень",
+ days: function(value) { return numpf(value, "%d дзень", "%d дні", "%d дзён"); },
+ month: "месяц",
+ months: function(value) { return numpf(value, "%d месяц", "%d месяцы", "%d месяцаў"); },
+ year: "год",
+ years: function(value) { return numpf(value, "%d год", "%d гады", "%d гадоў"); }
+ };
+ }));
diff --git a/locales/jquery.timeago.bg.js b/locales/jquery.timeago.bg.js
new file mode 100644
index 0000000..a3bd343
--- /dev/null
+++ b/locales/jquery.timeago.bg.js
@@ -0,0 +1,28 @@
+(function (factory) {
+ if (typeof define === 'function' && define.amd) {
+ define(['jquery'], factory);
+ } else if (typeof module === 'object' && typeof module.exports === 'object') {
+ factory(require('jquery'));
+ } else {
+ factory(jQuery);
+ }
+}(function (jQuery) {
+ // Bulgarian
+ jQuery.timeago.settings.strings = {
+ prefixAgo: "преди",
+ prefixFromNow: "след",
+ suffixAgo: null,
+ suffixFromNow: null,
+ seconds: "по-малко от минута",
+ minute: "една минута",
+ minutes: "%d минути",
+ hour: "един час",
+ hours: "%d часа",
+ day: "един ден",
+ days: "%d дни",
+ month: "един месец",
+ months: "%d месеца",
+ year: "една година",
+ years: "%d години"
+ };
+}));
diff --git a/locales/jquery.timeago.bs.js b/locales/jquery.timeago.bs.js
new file mode 100644
index 0000000..cbb1780
--- /dev/null
+++ b/locales/jquery.timeago.bs.js
@@ -0,0 +1,55 @@
+(function (factory) {
+ if (typeof define === 'function' && define.amd) {
+ define(['jquery'], factory);
+ } else if (typeof module === 'object' && typeof module.exports === 'object') {
+ factory(require('jquery'));
+ } else {
+ factory(jQuery);
+ }
+}(function (jQuery) {
+ // Bosnian
+ var numpf = function(n, f, s, t) {
+ var n10;
+ n10 = n % 10;
+ if (n10 === 1 && (n === 1 || n > 20)) {
+ return f;
+ } else if (n10 > 1 && n10 < 5 && (n > 20 || n < 10)) {
+ return s;
+ } else {
+ return t;
+ }
+ };
+
+ jQuery.timeago.settings.strings = {
+ prefixAgo: "prije",
+ prefixFromNow: "za",
+ suffixAgo: null,
+ suffixFromNow: null,
+ second: "sekund",
+ seconds: function(value) {
+ return numpf(value, "%d sekund", "%d sekunde", "%d sekundi");
+ },
+ minute: "oko minut",
+ minutes: function(value) {
+ return numpf(value, "%d minut", "%d minute", "%d minuta");
+ },
+ hour: "oko sat",
+ hours: function(value) {
+ return numpf(value, "%d sat", "%d sata", "%d sati");
+ },
+ day: "oko jednog dana",
+ days: function(value) {
+ return numpf(value, "%d dan", "%d dana", "%d dana");
+ },
+ month: "mjesec dana",
+ months: function(value) {
+ return numpf(value, "%d mjesec", "%d mjeseca", "%d mjeseci");
+ },
+ year: "prije godinu dana ",
+ years: function(value) {
+ return numpf(value, "%d godinu", "%d godine", "%d godina");
+ },
+ wordSeparator: " "
+ };
+
+}));
diff --git a/locales/jquery.timeago.ca.js b/locales/jquery.timeago.ca.js
new file mode 100644
index 0000000..e4cb5ca
--- /dev/null
+++ b/locales/jquery.timeago.ca.js
@@ -0,0 +1,30 @@
+(function (factory) {
+ if (typeof define === 'function' && define.amd) {
+ define(['jquery'], factory);
+ } else if (typeof module === 'object' && typeof module.exports === 'object') {
+ factory(require('jquery'));
+ } else {
+ factory(jQuery);
+ }
+}(function (jQuery) {
+ // Catalan
+ jQuery.timeago.settings.strings = {
+ prefixAgo: "fa",
+ prefixFromNow: "d'aquí",
+ suffixAgo: null,
+ suffixFromNow: null,
+ seconds: "menys d'un minut",
+ minute: "un minut",
+ minutes: "%d minuts",
+ hour: "una hora",
+ hours: "%d hores",
+ day: "un dia",
+ days: "%d dies",
+ month: "un mes",
+ months: "%d mesos",
+ year: "un any",
+ years: "%d anys",
+ wordSeparator: " ",
+ numbers: []
+ };
+}));
diff --git a/locales/jquery.timeago.cs.js b/locales/jquery.timeago.cs.js
new file mode 100644
index 0000000..b940f69
--- /dev/null
+++ b/locales/jquery.timeago.cs.js
@@ -0,0 +1,34 @@
+(function (factory) {
+ if (typeof define === 'function' && define.amd) {
+ define(['jquery'], factory);
+ } else if (typeof module === 'object' && typeof module.exports === 'object') {
+ factory(require('jquery'));
+ } else {
+ factory(jQuery);
+ }
+}(function (jQuery) {
+ // Czech
+ (function() {
+ function f(n, d, a) {
+ return a[d>=0 ? 0 : a.length===2 || n<5 ? 1 : 2];
+ }
+
+ jQuery.timeago.settings.strings = {
+ prefixAgo: 'před',
+ prefixFromNow: 'za',
+ suffixAgo: null,
+ suffixFromNow: null,
+ seconds: function(n, d) {return f(n, d, ['méně než minutou', 'méně než minutu']);},
+ minute: function(n, d) {return f(n, d, ['minutou', 'minutu']);},
+ minutes: function(n, d) {return f(n, d, ['%d minutami', '%d minuty', '%d minut']);},
+ hour: function(n, d) {return f(n, d, ['hodinou', 'hodinu']);},
+ hours: function(n, d) {return f(n, d, ['%d hodinami', '%d hodiny', '%d hodin']);},
+ day: function(n, d) {return f(n, d, ['%d dnem', '%d den']);},
+ days: function(n, d) {return f(n, d, ['%d dny', '%d dny', '%d dní']);},
+ month: function(n, d) {return f(n, d, ['%d měsícem', '%d měsíc']);},
+ months: function(n, d) {return f(n, d, ['%d měsíci', '%d měsíce', '%d měsíců']);},
+ year: function(n, d) {return f(n, d, ['%d rokem', '%d rok']);},
+ years: function(n, d) {return f(n, d, ['%d lety', '%d roky', '%d let']);}
+ };
+ })();
+}));
diff --git a/locales/jquery.timeago.cy.js b/locales/jquery.timeago.cy.js
new file mode 100644
index 0000000..4c514a8
--- /dev/null
+++ b/locales/jquery.timeago.cy.js
@@ -0,0 +1,30 @@
+(function (factory) {
+ if (typeof define === 'function' && define.amd) {
+ define(['jquery'], factory);
+ } else if (typeof module === 'object' && typeof module.exports === 'object') {
+ factory(require('jquery'));
+ } else {
+ factory(jQuery);
+ }
+}(function (jQuery) {
+ // Welsh
+ jQuery.timeago.settings.strings = {
+ prefixAgo: null,
+ prefixFromNow: null,
+ suffixAgo: "yn ôl",
+ suffixFromNow: "o hyn",
+ seconds: "llai na munud",
+ minute: "am funud",
+ minutes: "%d munud",
+ hour: "tua awr",
+ hours: "am %d awr",
+ day: "y dydd",
+ days: "%d diwrnod",
+ month: "tua mis",
+ months: "%d mis",
+ year: "am y flwyddyn",
+ years: "%d blynedd",
+ wordSeparator: " ",
+ numbers: []
+ };
+}));
diff --git a/locales/jquery.timeago.da.js b/locales/jquery.timeago.da.js
new file mode 100644
index 0000000..236c34c
--- /dev/null
+++ b/locales/jquery.timeago.da.js
@@ -0,0 +1,28 @@
+(function (factory) {
+ if (typeof define === 'function' && define.amd) {
+ define(['jquery'], factory);
+ } else if (typeof module === 'object' && typeof module.exports === 'object') {
+ factory(require('jquery'));
+ } else {
+ factory(jQuery);
+ }
+}(function (jQuery) {
+ // Danish
+ jQuery.timeago.settings.strings = {
+ prefixAgo: "for",
+ prefixFromNow: "om",
+ suffixAgo: "siden",
+ suffixFromNow: "",
+ seconds: "mindre end et minut",
+ minute: "ca. et minut",
+ minutes: "%d minutter",
+ hour: "ca. en time",
+ hours: "ca. %d timer",
+ day: "en dag",
+ days: "%d dage",
+ month: "ca. en måned",
+ months: "%d måneder",
+ year: "ca. et år",
+ years: "%d år"
+ };
+}));
diff --git a/locales/jquery.timeago.de-short.js b/locales/jquery.timeago.de-short.js
new file mode 100644
index 0000000..15b446e
--- /dev/null
+++ b/locales/jquery.timeago.de-short.js
@@ -0,0 +1,30 @@
+(function (factory) {
+ if (typeof define === 'function' && define.amd) {
+ define(['jquery'], factory);
+ } else if (typeof module === 'object' && typeof module.exports === 'object') {
+ factory(require('jquery'));
+ } else {
+ factory(jQuery);
+ }
+}(function (jQuery) {
+ // German shortened
+ jQuery.timeago.settings.strings = {
+ prefixAgo: null,
+ prefixFromNow: null,
+ suffixAgo: "",
+ suffixFromNow: "",
+ seconds: "s",
+ minute: "1m",
+ minutes: "%dm",
+ hour: "1h",
+ hours: "%dh",
+ day: "1T.",
+ days: "%dT.",
+ month: "1Mt.",
+ months: "%dMt.",
+ year: "1J.",
+ years: "%dJ.",
+ wordSeparator: " ",
+ numbers: []
+ };
+}));
diff --git a/locales/jquery.timeago.de.js b/locales/jquery.timeago.de.js
new file mode 100644
index 0000000..6a877a2
--- /dev/null
+++ b/locales/jquery.timeago.de.js
@@ -0,0 +1,28 @@
+(function (factory) {
+ if (typeof define === 'function' && define.amd) {
+ define(['jquery'], factory);
+ } else if (typeof module === 'object' && typeof module.exports === 'object') {
+ factory(require('jquery'));
+ } else {
+ factory(jQuery);
+ }
+}(function (jQuery) {
+ // German
+ jQuery.timeago.settings.strings = {
+ prefixAgo: "vor",
+ prefixFromNow: "in",
+ suffixAgo: "",
+ suffixFromNow: "",
+ seconds: "wenigen Sekunden",
+ minute: "etwa einer Minute",
+ minutes: "%d Minuten",
+ hour: "etwa einer Stunde",
+ hours: "%d Stunden",
+ day: "etwa einem Tag",
+ days: "%d Tagen",
+ month: "etwa einem Monat",
+ months: "%d Monaten",
+ year: "etwa einem Jahr",
+ years: "%d Jahren"
+ };
+}));
diff --git a/locales/jquery.timeago.dv.js b/locales/jquery.timeago.dv.js
new file mode 100644
index 0000000..0d70a49
--- /dev/null
+++ b/locales/jquery.timeago.dv.js
@@ -0,0 +1,32 @@
+(function (factory) {
+ if (typeof define === 'function' && define.amd) {
+ define(['jquery'], factory);
+ } else if (typeof module === 'object' && typeof module.exports === 'object') {
+ factory(require('jquery'));
+ } else {
+ factory(jQuery);
+ }
+}(function (jQuery) {
+ /**
+ * Dhivehi time in Thaana for timeago.js
+ **/
+ jQuery.timeago.settings.strings = {
+ prefixAgo: null,
+ prefixFromNow: null,
+ suffixAgo: "ކުރިން",
+ suffixFromNow: "ފަހުން",
+ seconds: "ސިކުންތުކޮޅެއް",
+ minute: "މިނިޓެއްވަރު",
+ minutes: "%d މިނިޓު",
+ hour: "ގަޑިއެއްވަރު",
+ hours: "ގާތްގަނޑަކަށް %d ގަޑިއިރު",
+ day: "އެއް ދުވަސް",
+ days: "މީގެ %d ދުވަސް",
+ month: "މަހެއްވަރު",
+ months: "މީގެ %d މަސް",
+ year: "އަހަރެއްވަރު",
+ years: "މީގެ %d އަހަރު",
+ wordSeparator: " ",
+ numbers: []
+ };
+}));
diff --git a/locales/jquery.timeago.el.js b/locales/jquery.timeago.el.js
new file mode 100644
index 0000000..2db9ebe
--- /dev/null
+++ b/locales/jquery.timeago.el.js
@@ -0,0 +1,28 @@
+(function (factory) {
+ if (typeof define === 'function' && define.amd) {
+ define(['jquery'], factory);
+ } else if (typeof module === 'object' && typeof module.exports === 'object') {
+ factory(require('jquery'));
+ } else {
+ factory(jQuery);
+ }
+}(function (jQuery) {
+ // Greek
+ jQuery.timeago.settings.strings = {
+ prefixAgo: "πριν",
+ prefixFromNow: "σε",
+ suffixAgo: "",
+ suffixFromNow: "",
+ seconds: "λιγότερο από ένα λεπτό",
+ minute: "περίπου ένα λεπτό",
+ minutes: "%d λεπτά",
+ hour: "περίπου μία ώρα",
+ hours: "περίπου %d ώρες",
+ day: "μία μέρα",
+ days: "%d μέρες",
+ month: "περίπου ένα μήνα",
+ months: "%d μήνες",
+ year: "περίπου ένα χρόνο",
+ years: "%d χρόνια"
+ };
+}));
diff --git a/locales/jquery.timeago.en-short.js b/locales/jquery.timeago.en-short.js
new file mode 100644
index 0000000..157aaa4
--- /dev/null
+++ b/locales/jquery.timeago.en-short.js
@@ -0,0 +1,30 @@
+(function (factory) {
+ if (typeof define === 'function' && define.amd) {
+ define(['jquery'], factory);
+ } else if (typeof module === 'object' && typeof module.exports === 'object') {
+ factory(require('jquery'));
+ } else {
+ factory(jQuery);
+ }
+}(function (jQuery) {
+ // English shortened
+ jQuery.timeago.settings.strings = {
+ prefixAgo: null,
+ prefixFromNow: null,
+ suffixAgo: "",
+ suffixFromNow: "",
+ seconds: "1m",
+ minute: "1m",
+ minutes: "%dm",
+ hour: "1h",
+ hours: "%dh",
+ day: "1d",
+ days: "%dd",
+ month: "1mo",
+ months: "%dmo",
+ year: "1yr",
+ years: "%dyr",
+ wordSeparator: " ",
+ numbers: []
+ };
+}));
diff --git a/locales/jquery.timeago.en.js b/locales/jquery.timeago.en.js
new file mode 100644
index 0000000..8ca50af
--- /dev/null
+++ b/locales/jquery.timeago.en.js
@@ -0,0 +1,30 @@
+(function (factory) {
+ if (typeof define === 'function' && define.amd) {
+ define(['jquery'], factory);
+ } else if (typeof module === 'object' && typeof module.exports === 'object') {
+ factory(require('jquery'));
+ } else {
+ factory(jQuery);
+ }
+}(function (jQuery) {
+ // English (Template)
+ jQuery.timeago.settings.strings = {
+ prefixAgo: null,
+ prefixFromNow: null,
+ suffixAgo: "ago",
+ suffixFromNow: "from now",
+ seconds: "less than a minute",
+ minute: "about a minute",
+ minutes: "%d minutes",
+ hour: "about an hour",
+ hours: "about %d hours",
+ day: "a day",
+ days: "%d days",
+ month: "about a month",
+ months: "%d months",
+ year: "about a year",
+ years: "%d years",
+ wordSeparator: " ",
+ numbers: []
+ };
+}));
diff --git a/locales/jquery.timeago.es-short.js b/locales/jquery.timeago.es-short.js
new file mode 100644
index 0000000..f762a06
--- /dev/null
+++ b/locales/jquery.timeago.es-short.js
@@ -0,0 +1,31 @@
+(function (factory) {
+ if (typeof define === 'function' && define.amd) {
+ define(['jquery'], factory);
+ } else if (typeof module === 'object' && typeof module.exports === 'object') {
+ factory(require('jquery'));
+ } else {
+ factory(jQuery);
+ }
+}(function (jQuery) {
+ // Spanish shortened
+ jQuery.timeago.settings.strings = {
+ prefixAgo: null,
+ prefixFromNow: null,
+ suffixAgo: "",
+ suffixFromNow: "",
+ seconds: "1m",
+ minute: "1m",
+ minutes: "%dm",
+ hour: "1h",
+ hours: "%dh",
+ day: "1d",
+ days: "%dd",
+ month: "1me",
+ months: "%dme",
+ year: "1a",
+ years: "%da",
+ wordSeparator: " ",
+ numbers: []
+ };
+}));
+
diff --git a/locales/jquery.timeago.es.js b/locales/jquery.timeago.es.js
new file mode 100644
index 0000000..0785b3f
--- /dev/null
+++ b/locales/jquery.timeago.es.js
@@ -0,0 +1,29 @@
+(function (factory) {
+ if (typeof define === 'function' && define.amd) {
+ define(['jquery'], factory);
+ } else if (typeof module === 'object' && typeof module.exports === 'object') {
+ factory(require('jquery'));
+ } else {
+ factory(jQuery);
+ }
+}(function (jQuery) {
+ // Spanish
+ jQuery.timeago.settings.strings = {
+ prefixAgo: "hace",
+ prefixFromNow: "dentro de",
+ suffixAgo: "",
+ suffixFromNow: "",
+ seconds: "menos de un minuto",
+ minute: "un minuto",
+ minutes: "unos %d minutos",
+ hour: "una hora",
+ hours: "%d horas",
+ day: "un día",
+ days: "%d días",
+ month: "un mes",
+ months: "%d meses",
+ year: "un año",
+ years: "%d años"
+ };
+}));
+
diff --git a/locales/jquery.timeago.et.js b/locales/jquery.timeago.et.js
new file mode 100644
index 0000000..ac2461e
--- /dev/null
+++ b/locales/jquery.timeago.et.js
@@ -0,0 +1,28 @@
+(function (factory) {
+ if (typeof define === 'function' && define.amd) {
+ define(['jquery'], factory);
+ } else if (typeof module === 'object' && typeof module.exports === 'object') {
+ factory(require('jquery'));
+ } else {
+ factory(jQuery);
+ }
+}(function (jQuery) {
+ // Estonian
+ jQuery.timeago.settings.strings = {
+ prefixAgo: null,
+ prefixFromNow: null,
+ suffixAgo: "tagasi",
+ suffixFromNow: "pärast",
+ seconds: function(n, d) { return d < 0 ? "vähem kui minuti aja" : "vähem kui minut aega"; },
+ minute: function(n, d) { return d < 0 ? "umbes minuti aja" : "umbes minut aega"; },
+ minutes: function(n, d) { return d < 0 ? "%d minuti" : "%d minutit"; },
+ hour: function(n, d) { return d < 0 ? "umbes tunni aja" : "umbes tund aega"; },
+ hours: function(n, d) { return d < 0 ? "%d tunni" : "%d tundi"; },
+ day: function(n, d) { return d < 0 ? "umbes päeva" : "umbes päev"; },
+ days: "%d päeva",
+ month: function(n, d) { return d < 0 ? "umbes kuu aja" : "umbes kuu aega"; },
+ months: function(n, d) { return d < 0 ? "%d kuu" : "%d kuud"; },
+ year: function(n, d) { return d < 0 ? "umbes aasta aja" : "umbes aasta aega"; },
+ years: function(n, d) { return d < 0 ? "%d aasta" : "%d aastat"; }
+ };
+}));
diff --git a/locales/jquery.timeago.eu.js b/locales/jquery.timeago.eu.js
new file mode 100644
index 0000000..5c2c32c
--- /dev/null
+++ b/locales/jquery.timeago.eu.js
@@ -0,0 +1,28 @@
+(function (factory) {
+ if (typeof define === 'function' && define.amd) {
+ define(['jquery'], factory);
+ } else if (typeof module === 'object' && typeof module.exports === 'object') {
+ factory(require('jquery'));
+ } else {
+ factory(jQuery);
+ }
+}(function (jQuery) {
+ jQuery.timeago.settings.strings = {
+ prefixAgo: "duela",
+ prefixFromNow: "hemendik",
+ suffixAgo: "",
+ suffixFromNow: "barru",
+ seconds: "minutu bat bainu gutxiago",
+ minute: "minutu bat",
+ minutes: "%d minutu inguru",
+ hour: "ordu bat",
+ hours: "%d ordu",
+ day: "egun bat",
+ days: "%d egun",
+ month: "hilabete bat",
+ months: "%d hilabete",
+ year: "urte bat",
+ years: "%d urte"
+ };
+}));
+
diff --git a/locales/jquery.timeago.fa-short.js b/locales/jquery.timeago.fa-short.js
new file mode 100644
index 0000000..fae3841
--- /dev/null
+++ b/locales/jquery.timeago.fa-short.js
@@ -0,0 +1,30 @@
+(function (factory) {
+ if (typeof define === 'function' && define.amd) {
+ define(['jquery'], factory);
+ } else if (typeof module === 'object' && typeof module.exports === 'object') {
+ factory(require('jquery'));
+ } else {
+ factory(jQuery);
+ }
+}(function (jQuery) {
+ // persion shortened
+ jQuery.timeago.settings.strings = {
+ prefixAgo: null,
+ prefixFromNow: null,
+ suffixAgo: "",
+ suffixFromNow: "",
+ seconds: "1دقیقه",
+ minute: "1دقیقه",
+ minutes: "%dدقیقه",
+ hour: "1ساعت",
+ hours: "%dساعت",
+ day: "1روز",
+ days: "%dروز",
+ month: "1ماه",
+ months: "%dماه",
+ year: "1سال",
+ years: "%dسال",
+ wordSeparator: " ",
+ numbers: ['۰', '۱', '۲', '۳', '۴', '۵', '۶', '۷', '۸', '۹']
+ };
+}));
diff --git a/locales/jquery.timeago.fa.js b/locales/jquery.timeago.fa.js
new file mode 100644
index 0000000..d3495aa
--- /dev/null
+++ b/locales/jquery.timeago.fa.js
@@ -0,0 +1,32 @@
+(function (factory) {
+ if (typeof define === 'function' && define.amd) {
+ define(['jquery'], factory);
+ } else if (typeof module === 'object' && typeof module.exports === 'object') {
+ factory(require('jquery'));
+ } else {
+ factory(jQuery);
+ }
+}(function (jQuery) {
+ // Persian
+ // Use DIR attribute for RTL text in Persian Language for ABBR tag .
+ // By MB.seifollahi@gmail.com
+ jQuery.timeago.settings.strings = {
+ prefixAgo: null,
+ prefixFromNow: null,
+ suffixAgo: "پیش",
+ suffixFromNow: "از حال",
+ seconds: "کمتر از یک دقیقه",
+ minute: "حدود یک دقیقه",
+ minutes: "%d دقیقه",
+ hour: "حدود یک ساعت",
+ hours: "حدود %d ساعت",
+ day: "یک روز",
+ days: "%d روز",
+ month: "حدود یک ماه",
+ months: "%d ماه",
+ year: "حدود یک سال",
+ years: "%d سال",
+ wordSeparator: " ",
+ numbers: ['۰', '۱', '۲', '۳', '۴', '۵', '۶', '۷', '۸', '۹']
+ };
+}));
diff --git a/locales/jquery.timeago.fi.js b/locales/jquery.timeago.fi.js
new file mode 100644
index 0000000..b5f7e69
--- /dev/null
+++ b/locales/jquery.timeago.fi.js
@@ -0,0 +1,38 @@
+(function (factory) {
+ if (typeof define === 'function' && define.amd) {
+ define(['jquery'], factory);
+ } else if (typeof module === 'object' && typeof module.exports === 'object') {
+ factory(require('jquery'));
+ } else {
+ factory(jQuery);
+ }
+}(function (jQuery) {
+ // Finnish
+ jQuery.timeago.settings.strings = {
+ prefixAgo: null,
+ prefixFromNow: null,
+ suffixAgo: "sitten",
+ suffixFromNow: "tulevaisuudessa",
+ seconds: "alle minuutti",
+ minute: "minuutti",
+ minutes: "%d minuuttia",
+ hour: "tunti",
+ hours: "%d tuntia",
+ day: "päivä",
+ days: "%d päivää",
+ month: "kuukausi",
+ months: "%d kuukautta",
+ year: "vuosi",
+ years: "%d vuotta"
+ };
+
+ // The above is not a great localization because one would usually
+ // write "2 days ago" in Finnish as "2 päivää sitten", however
+ // one would write "2 days into the future" as "2:n päivän päästä"
+ // which cannot be achieved with localization support this simple.
+ // This is because Finnish has word suffixes (attached directly
+ // to the end of the word). The word "day" is "päivä" in Finnish.
+ // As workaround, the above localizations will say
+ // "2 päivää tulevaisuudessa" which is understandable but
+ // not as fluent.
+}));
diff --git a/locales/jquery.timeago.fr-short.js b/locales/jquery.timeago.fr-short.js
new file mode 100644
index 0000000..a116ead
--- /dev/null
+++ b/locales/jquery.timeago.fr-short.js
@@ -0,0 +1,26 @@
+(function (factory) {
+ if (typeof define === 'function' && define.amd) {
+ define(['jquery'], factory);
+ } else if (typeof module === 'object' && typeof module.exports === 'object') {
+ factory(require('jquery'));
+ } else {
+ factory(jQuery);
+ }
+}(function (jQuery) {
+ // French shortened
+ jQuery.timeago.settings.strings = {
+ prefixAgo: "il y a",
+ prefixFromNow: "d'ici",
+ seconds: "moins d'une minute",
+ minute: "une minute",
+ minutes: "%d minutes",
+ hour: "une heure",
+ hours: "%d heures",
+ day: "un jour",
+ days: "%d jours",
+ month: "un mois",
+ months: "%d mois",
+ year: "un an",
+ years: "%d ans"
+ };
+}));
diff --git a/locales/jquery.timeago.fr.js b/locales/jquery.timeago.fr.js
new file mode 100644
index 0000000..1bb052a
--- /dev/null
+++ b/locales/jquery.timeago.fr.js
@@ -0,0 +1,27 @@
+(function (factory) {
+ if (typeof define === 'function' && define.amd) {
+ define(['jquery'], factory);
+ } else if (typeof module === 'object' && typeof module.exports === 'object') {
+ factory(require('jquery'));
+ } else {
+ factory(jQuery);
+ }
+}(function (jQuery) {
+ // French
+ jQuery.timeago.settings.strings = {
+ // environ ~= about, it's optional
+ prefixAgo: "il y a",
+ prefixFromNow: "d'ici",
+ seconds: "moins d'une minute",
+ minute: "environ une minute",
+ minutes: "environ %d minutes",
+ hour: "environ une heure",
+ hours: "environ %d heures",
+ day: "environ un jour",
+ days: "environ %d jours",
+ month: "environ un mois",
+ months: "environ %d mois",
+ year: "un an",
+ years: "%d ans"
+ };
+}));
diff --git a/locales/jquery.timeago.gl.js b/locales/jquery.timeago.gl.js
new file mode 100644
index 0000000..277bbf7
--- /dev/null
+++ b/locales/jquery.timeago.gl.js
@@ -0,0 +1,28 @@
+(function (factory) {
+ if (typeof define === 'function' && define.amd) {
+ define(['jquery'], factory);
+ } else if (typeof module === 'object' && typeof module.exports === 'object') {
+ factory(require('jquery'));
+ } else {
+ factory(jQuery);
+ }
+}(function (jQuery) {
+ // Galician
+ jQuery.timeago.settings.strings = {
+ prefixAgo: "hai",
+ prefixFromNow: "dentro de",
+ suffixAgo: "",
+ suffixFromNow: "",
+ seconds: "menos dun minuto",
+ minute: "un minuto",
+ minutes: "uns %d minutos",
+ hour: "unha hora",
+ hours: "%d horas",
+ day: "un día",
+ days: "%d días",
+ month: "un mes",
+ months: "%d meses",
+ year: "un ano",
+ years: "%d anos"
+ };
+}));
diff --git a/locales/jquery.timeago.he.js b/locales/jquery.timeago.he.js
new file mode 100644
index 0000000..2cd31ab
--- /dev/null
+++ b/locales/jquery.timeago.he.js
@@ -0,0 +1,26 @@
+(function (factory) {
+ if (typeof define === 'function' && define.amd) {
+ define(['jquery'], factory);
+ } else if (typeof module === 'object' && typeof module.exports === 'object') {
+ factory(require('jquery'));
+ } else {
+ factory(jQuery);
+ }
+}(function (jQuery) {
+ // Hebrew
+ jQuery.timeago.settings.strings = {
+ prefixAgo: "לפני",
+ prefixFromNow: "עוד",
+ seconds: "פחות מדקה",
+ minute: "דקה",
+ minutes: "%d דקות",
+ hour: "שעה",
+ hours: function(number){return (number===2) ? "שעתיים" : "%d שעות";},
+ day: "יום",
+ days: function(number){return (number===2) ? "יומיים" : "%d ימים";},
+ month: "חודש",
+ months: function(number){return (number===2) ? "חודשיים" : "%d חודשים";},
+ year: "שנה",
+ years: function(number){return (number===2) ? "שנתיים" : "%d שנים";}
+ };
+}));
diff --git a/locales/jquery.timeago.hr.js b/locales/jquery.timeago.hr.js
new file mode 100644
index 0000000..bd14297
--- /dev/null
+++ b/locales/jquery.timeago.hr.js
@@ -0,0 +1,54 @@
+(function (factory) {
+ if (typeof define === 'function' && define.amd) {
+ define(['jquery'], factory);
+ } else if (typeof module === 'object' && typeof module.exports === 'object') {
+ factory(require('jquery'));
+ } else {
+ factory(jQuery);
+ }
+}(function (jQuery) {
+ // Croatian
+ var numpf = function (n, f, s, t) {
+ var n10;
+ n10 = n % 10;
+ if (n10 === 1 && (n === 1 || n > 20)) {
+ return f;
+ } else if (n10 > 1 && n10 < 5 && (n > 20 || n < 10)) {
+ return s;
+ } else {
+ return t;
+ }
+ };
+
+ jQuery.timeago.settings.strings = {
+ prefixAgo: "prije",
+ prefixFromNow: "za",
+ suffixAgo: null,
+ suffixFromNow: null,
+ second: "sekundu",
+ seconds: function (value) {
+ return numpf(value, "%d sekundu", "%d sekunde", "%d sekundi");
+ },
+ minute: "oko minutu",
+ minutes: function (value) {
+ return numpf(value, "%d minutu", "%d minute", "%d minuta");
+ },
+ hour: "oko jedan sat",
+ hours: function (value) {
+ return numpf(value, "%d sat", "%d sata", "%d sati");
+ },
+ day: "jedan dan",
+ days: function (value) {
+ return numpf(value, "%d dan", "%d dana", "%d dana");
+ },
+ month: "mjesec dana",
+ months: function (value) {
+ return numpf(value, "%d mjesec", "%d mjeseca", "%d mjeseci");
+ },
+ year: "prije godinu dana",
+ years: function (value) {
+ return numpf(value, "%d godinu", "%d godine", "%d godina");
+ },
+ wordSeparator: " "
+ };
+}));
diff --git a/locales/jquery.timeago.hu.js b/locales/jquery.timeago.hu.js
new file mode 100644
index 0000000..0009de9
--- /dev/null
+++ b/locales/jquery.timeago.hu.js
@@ -0,0 +1,28 @@
+(function (factory) {
+ if (typeof define === 'function' && define.amd) {
+ define(['jquery'], factory);
+ } else if (typeof module === 'object' && typeof module.exports === 'object') {
+ factory(require('jquery'));
+ } else {
+ factory(jQuery);
+ }
+}(function (jQuery) {
+ // Hungarian
+ jQuery.timeago.settings.strings = {
+ prefixAgo: null,
+ prefixFromNow: null,
+ suffixAgo: null,
+ suffixFromNow: null,
+ seconds: "kevesebb mint egy perce",
+ minute: "körülbelül egy perce",
+ minutes: "%d perce",
+ hour: "körülbelül egy órája",
+ hours: "körülbelül %d órája",
+ day: "körülbelül egy napja",
+ days: "%d napja",
+ month: "körülbelül egy hónapja",
+ months: "%d hónapja",
+ year: "körülbelül egy éve",
+ years: "%d éve"
+ };
+}));
diff --git a/locales/jquery.timeago.hy.js b/locales/jquery.timeago.hy.js
new file mode 100644
index 0000000..3f0de6e
--- /dev/null
+++ b/locales/jquery.timeago.hy.js
@@ -0,0 +1,28 @@
+(function (factory) {
+ if (typeof define === 'function' && define.amd) {
+ define(['jquery'], factory);
+ } else if (typeof module === 'object' && typeof module.exports === 'object') {
+ factory(require('jquery'));
+ } else {
+ factory(jQuery);
+ }
+}(function (jQuery) {
+ // Armenian
+ jQuery.timeago.settings.strings = {
+ prefixAgo: null,
+ prefixFromNow: null,
+ suffixAgo: "առաջ",
+ suffixFromNow: "հետո",
+ seconds: "վայրկյաններ",
+ minute: "մեկ րոպե",
+ minutes: "%d րոպե",
+ hour: "մեկ ժամ",
+ hours: "%d ժամ",
+ day: "մեկ օր",
+ days: "%d օր",
+ month: "մեկ ամիս",
+ months: "%d ամիս",
+ year: "մեկ տարի",
+ years: "%d տարի"
+ };
+}));
diff --git a/locales/jquery.timeago.id.js b/locales/jquery.timeago.id.js
new file mode 100644
index 0000000..ca530cc
--- /dev/null
+++ b/locales/jquery.timeago.id.js
@@ -0,0 +1,29 @@
+(function (factory) {
+ if (typeof define === 'function' && define.amd) {
+ define(['jquery'], factory);
+ } else if (typeof module === 'object' && typeof module.exports === 'object') {
+ factory(require('jquery'));
+ } else {
+ factory(jQuery);
+ }
+}(function (jQuery) {
+ // Indonesian
+ jQuery.timeago.settings.strings = {
+ prefixAgo: null,
+ prefixFromNow: null,
+ suffixAgo: "yang lalu",
+ suffixFromNow: "dari sekarang",
+ seconds: "kurang dari semenit",
+ minute: "sekitar satu menit",
+ minutes: "%d menit",
+ hour: "sekitar sejam",
+ hours: "sekitar %d jam",
+ day: "sehari",
+ days: "%d hari",
+ month: "sekitar sebulan",
+ months: "%d bulan",
+ year: "sekitar setahun",
+ years: "%d tahun"
+ };
+}));
+
diff --git a/locales/jquery.timeago.is.js b/locales/jquery.timeago.is.js
new file mode 100644
index 0000000..e3d4b1f
--- /dev/null
+++ b/locales/jquery.timeago.is.js
@@ -0,0 +1,29 @@
+(function (factory) {
+ if (typeof define === 'function' && define.amd) {
+ define(['jquery'], factory);
+ } else if (typeof module === 'object' && typeof module.exports === 'object') {
+ factory(require('jquery'));
+ } else {
+ factory(jQuery);
+ }
+}(function (jQuery) {
+ jQuery.timeago.settings.strings = {
+ prefixAgo: "fyrir",
+ prefixFromNow: "eftir",
+ suffixAgo: "síðan",
+ suffixFromNow: null,
+ seconds: "minna en mínútu",
+ minute: "mínútu",
+ minutes: "%d mínútum",
+ hour: "klukkutíma",
+ hours: "um %d klukkutímum",
+ day: "degi",
+ days: "%d dögum",
+ month: "mánuði",
+ months: "%d mánuðum",
+ year: "ári",
+ years: "%d árum",
+ wordSeparator: " ",
+ numbers: []
+ };
+}));
diff --git a/locales/jquery.timeago.it-short.js b/locales/jquery.timeago.it-short.js
new file mode 100644
index 0000000..f1da0cc
--- /dev/null
+++ b/locales/jquery.timeago.it-short.js
@@ -0,0 +1,30 @@
+(function (factory) {
+ if (typeof define === 'function' && define.amd) {
+ define(['jquery'], factory);
+ } else if (typeof module === 'object' && typeof module.exports === 'object') {
+ factory(require('jquery'));
+ } else {
+ factory(jQuery);
+ }
+}(function (jQuery) {
+ // Italian shortened
+ jQuery.timeago.settings.strings = {
+ prefixAgo: null,
+ prefixFromNow: null,
+ suffixAgo: "",
+ suffixFromNow: "",
+ seconds: "1m",
+ minute: "1m",
+ minutes: "%dm",
+ hour: "1h",
+ hours: "%dh",
+ day: "1g",
+ days: "%dg",
+ month: "1me",
+ months: "%dme",
+ year: "1a",
+ years: "%da",
+ wordSeparator: " ",
+ numbers: []
+ };
+}));
diff --git a/locales/jquery.timeago.it.js b/locales/jquery.timeago.it.js
new file mode 100644
index 0000000..32ee943
--- /dev/null
+++ b/locales/jquery.timeago.it.js
@@ -0,0 +1,28 @@
+(function (factory) {
+ if (typeof define === 'function' && define.amd) {
+ define(['jquery'], factory);
+ } else if (typeof module === 'object' && typeof module.exports === 'object') {
+ factory(require('jquery'));
+ } else {
+ factory(jQuery);
+ }
+}(function (jQuery) {
+ // Italian
+ jQuery.timeago.settings.strings = {
+ prefixAgo: null,
+ prefixFromNow: "fra",
+ suffixAgo: "fa",
+ suffixFromNow: null,
+ seconds: "meno di un minuto",
+ minute: "circa un minuto",
+ minutes: "%d minuti",
+ hour: "circa un'ora",
+ hours: "circa %d ore",
+ day: "un giorno",
+ days: "%d giorni",
+ month: "circa un mese",
+ months: "%d mesi",
+ year: "circa un anno",
+ years: "%d anni"
+ };
+}));
diff --git a/locales/jquery.timeago.ja.js b/locales/jquery.timeago.ja.js
new file mode 100644
index 0000000..30f3308
--- /dev/null
+++ b/locales/jquery.timeago.ja.js
@@ -0,0 +1,29 @@
+(function (factory) {
+ if (typeof define === 'function' && define.amd) {
+ define(['jquery'], factory);
+ } else if (typeof module === 'object' && typeof module.exports === 'object') {
+ factory(require('jquery'));
+ } else {
+ factory(jQuery);
+ }
+}(function (jQuery) {
+ // Japanese
+ jQuery.timeago.settings.strings = {
+ prefixAgo: "",
+ prefixFromNow: "今から",
+ suffixAgo: "前",
+ suffixFromNow: "後",
+ seconds: "1 分未満",
+ minute: "約 1 分",
+ minutes: "%d 分",
+ hour: "約 1 時間",
+ hours: "約 %d 時間",
+ day: "約 1 日",
+ days: "約 %d 日",
+ month: "約 1 ヶ月",
+ months: "約 %d ヶ月",
+ year: "約 1 年",
+ years: "約 %d 年",
+ wordSeparator: ""
+ };
+}));
diff --git a/locales/jquery.timeago.jv.js b/locales/jquery.timeago.jv.js
new file mode 100644
index 0000000..0344053
--- /dev/null
+++ b/locales/jquery.timeago.jv.js
@@ -0,0 +1,28 @@
+(function (factory) {
+ if (typeof define === 'function' && define.amd) {
+ define(['jquery'], factory);
+ } else if (typeof module === 'object' && typeof module.exports === 'object') {
+ factory(require('jquery'));
+ } else {
+ factory(jQuery);
+ }
+}(function (jQuery) {
+ // Javanesse (Boso Jowo)
+ jQuery.timeago.settings.strings = {
+ prefixAgo: null,
+ prefixFromNow: null,
+ suffixAgo: "kepungkur",
+ suffixFromNow: "seko saiki",
+ seconds: "kurang seko sakmenit",
+ minute: "kurang luwih sakmenit",
+ minutes: "%d menit",
+ hour: "kurang luwih sakjam",
+ hours: "kurang luwih %d jam",
+ day: "sedina",
+ days: "%d dina",
+ month: "kurang luwih sewulan",
+ months: "%d wulan",
+ year: "kurang luwih setahun",
+ years: "%d tahun"
+ };
+}));
diff --git a/locales/jquery.timeago.ko.js b/locales/jquery.timeago.ko.js
new file mode 100644
index 0000000..23d1d37
--- /dev/null
+++ b/locales/jquery.timeago.ko.js
@@ -0,0 +1,31 @@
+(function (factory) {
+ if (typeof define === 'function' && define.amd) {
+ define(['jquery'], factory);
+ } else if (typeof module === 'object' && typeof module.exports === 'object') {
+ factory(require('jquery'));
+ } else {
+ factory(jQuery);
+ }
+}(function (jQuery) {
+ // Korean
+ jQuery.timeago.settings.strings = {
+ prefixAgo: null,
+ prefixFromNow: null,
+ suffixAgo: "전",
+ suffixFromNow: "후",
+ seconds: "1분",
+ minute: "약 1분",
+ minutes: "%d분",
+ hour: "약 1시간",
+ hours: "약 %d시간",
+ day: "하루",
+ days: "%d일",
+ month: "약 1개월",
+ months: "%d개월",
+ year: "약 1년",
+ years: "%d년",
+ wordSeparator: " ",
+ numbers: []
+ };
+}));
+
diff --git a/locales/jquery.timeago.ky.js b/locales/jquery.timeago.ky.js
new file mode 100644
index 0000000..58dba29
--- /dev/null
+++ b/locales/jquery.timeago.ky.js
@@ -0,0 +1,42 @@
+(function (factory) {
+ if (typeof define === 'function' && define.amd) {
+ define(['jquery'], factory);
+ } else if (typeof module === 'object' && typeof module.exports === 'object') {
+ factory(require('jquery'));
+ } else {
+ factory(jQuery);
+ }
+}(function (jQuery) {
+ // Russian
+ function numpf(n, f, s, t) {
+ // f - 1, 21, 31, ...
+ // s - 2-4, 22-24, 32-34 ...
+ // t - 5-20, 25-30, ...
+ var n10 = n % 10;
+ if ( (n10 === 1) && ( (n === 1) || (n > 20) ) ) {
+ return f;
+ } else if ( (n10 > 1) && (n10 < 5) && ( (n > 20) || (n < 10) ) ) {
+ return s;
+ } else {
+ return t;
+ }
+ }
+
+ jQuery.timeago.settings.strings = {
+ prefixAgo: null,
+ prefixFromNow: "через",
+ suffixAgo: "мурун",
+ suffixFromNow: null,
+ seconds: "1 минуттан аз",
+ minute: "минута",
+ minutes: function(value) { return numpf(value, "%d минута", "%d минута", "%d минут"); },
+ hour: "саат",
+ hours: function(value) { return numpf(value, "%d саат", "%d саат", "%d саат"); },
+ day: "күн",
+ days: function(value) { return numpf(value, "%d күн", "%d күн", "%d күн"); },
+ month: "ай",
+ months: function(value) { return numpf(value, "%d ай", "%d ай", "%d ай"); },
+ year: "жыл",
+ years: function(value) { return numpf(value, "%d жыл", "%d жыл", "%d жыл"); }
+ };
+}));
diff --git a/locales/jquery.timeago.lt.js b/locales/jquery.timeago.lt.js
new file mode 100644
index 0000000..2079fcc
--- /dev/null
+++ b/locales/jquery.timeago.lt.js
@@ -0,0 +1,30 @@
+(function (factory) {
+ if (typeof define === 'function' && define.amd) {
+ define(['jquery'], factory);
+ } else if (typeof module === 'object' && typeof module.exports === 'object') {
+ factory(require('jquery'));
+ } else {
+ factory(jQuery);
+ }
+}(function (jQuery) {
+ //Lithuanian
+ jQuery.timeago.settings.strings = {
+ prefixAgo: "prieš",
+ prefixFromNow: null,
+ suffixAgo: null,
+ suffixFromNow: "nuo dabar",
+ seconds: "%d sek.",
+ minute: "min.",
+ minutes: "%d min.",
+ hour: "val.",
+ hours: "%d val.",
+ day: "1 d.",
+ days: "%d d.",
+ month: "mėn.",
+ months: "%d mėn.",
+ year: "metus",
+ years: "%d metus",
+ wordSeparator: " ",
+ numbers: []
+ };
+}));
diff --git a/locales/jquery.timeago.lv.js b/locales/jquery.timeago.lv.js
new file mode 100644
index 0000000..855d1a4
--- /dev/null
+++ b/locales/jquery.timeago.lv.js
@@ -0,0 +1,30 @@
+(function (factory) {
+ if (typeof define === 'function' && define.amd) {
+ define(['jquery'], factory);
+ } else if (typeof module === 'object' && typeof module.exports === 'object') {
+ factory(require('jquery'));
+ } else {
+ factory(jQuery);
+ }
+}(function (jQuery) {
+ //Latvian
+ jQuery.timeago.settings.strings = {
+ prefixAgo: "pirms",
+ prefixFromNow: null,
+ suffixAgo: null,
+ suffixFromNow: "no šī brīža",
+ seconds: "%d sek.",
+ minute: "min.",
+ minutes: "%d min.",
+ hour: "st.",
+ hours: "%d st.",
+ day: "1 d.",
+ days: "%d d.",
+ month: "mēnesis.",
+ months: "%d mēnesis.",
+ year: "gads",
+ years: "%d gads",
+ wordSeparator: " ",
+ numbers: []
+ };
+}));
diff --git a/locales/jquery.timeago.mk.js b/locales/jquery.timeago.mk.js
new file mode 100644
index 0000000..301a5da
--- /dev/null
+++ b/locales/jquery.timeago.mk.js
@@ -0,0 +1,30 @@
+(function (factory) {
+ if (typeof define === 'function' && define.amd) {
+ define(['jquery'], factory);
+ } else if (typeof module === 'object' && typeof module.exports === 'object') {
+ factory(require('jquery'));
+ } else {
+ factory(jQuery);
+ }
+}(function (jQuery) {
+ // Macedonian
+ (function() {
+ jQuery.timeago.settings.strings={
+ prefixAgo: "пред",
+ prefixFromNow: "за",
+ suffixAgo: null,
+ suffixFromNow: null,
+ seconds: "%d секунди",
+ minute: "%d минута",
+ minutes: "%d минути",
+ hour: "%d час",
+ hours: "%d часа",
+ day: "%d ден",
+ days: "%d денови" ,
+ month: "%d месец",
+ months: "%d месеци",
+ year: "%d година",
+ years: "%d години"
+ };
+ })();
+}));
diff --git a/locales/jquery.timeago.nl.js b/locales/jquery.timeago.nl.js
new file mode 100644
index 0000000..2c5de89
--- /dev/null
+++ b/locales/jquery.timeago.nl.js
@@ -0,0 +1,30 @@
+(function (factory) {
+ if (typeof define === 'function' && define.amd) {
+ define(['jquery'], factory);
+ } else if (typeof module === 'object' && typeof module.exports === 'object') {
+ factory(require('jquery'));
+ } else {
+ factory(jQuery);
+ }
+}(function (jQuery) {
+ // Dutch
+ jQuery.timeago.settings.strings = {
+ prefixAgo: null,
+ prefixFromNow: "over",
+ suffixAgo: "geleden",
+ suffixFromNow: null,
+ seconds: "minder dan een minuut",
+ minute: "ongeveer een minuut",
+ minutes: "%d minuten",
+ hour: "ongeveer een uur",
+ hours: "ongeveer %d uur",
+ day: "een dag",
+ days: "%d dagen",
+ month: "ongeveer een maand",
+ months: "%d maanden",
+ year: "ongeveer een jaar",
+ years: "%d jaar",
+ wordSeparator: " ",
+ numbers: []
+ };
+}));
diff --git a/locales/jquery.timeago.no.js b/locales/jquery.timeago.no.js
new file mode 100644
index 0000000..c896337
--- /dev/null
+++ b/locales/jquery.timeago.no.js
@@ -0,0 +1,28 @@
+(function (factory) {
+ if (typeof define === 'function' && define.amd) {
+ define(['jquery'], factory);
+ } else if (typeof module === 'object' && typeof module.exports === 'object') {
+ factory(require('jquery'));
+ } else {
+ factory(jQuery);
+ }
+}(function (jQuery) {
+ // Norwegian
+ jQuery.timeago.settings.strings = {
+ prefixAgo: "for",
+ prefixFromNow: "om",
+ suffixAgo: "siden",
+ suffixFromNow: "",
+ seconds: "mindre enn et minutt",
+ minute: "ca. et minutt",
+ minutes: "%d minutter",
+ hour: "ca. en time",
+ hours: "ca. %d timer",
+ day: "en dag",
+ days: "%d dager",
+ month: "ca. en måned",
+ months: "%d måneder",
+ year: "ca. et år",
+ years: "%d år"
+ };
+}));
diff --git a/locales/jquery.timeago.pl.js b/locales/jquery.timeago.pl.js
new file mode 100644
index 0000000..4842784
--- /dev/null
+++ b/locales/jquery.timeago.pl.js
@@ -0,0 +1,39 @@
+(function (factory) {
+ if (typeof define === 'function' && define.amd) {
+ define(['jquery'], factory);
+ } else if (typeof module === 'object' && typeof module.exports === 'object') {
+ factory(require('jquery'));
+ } else {
+ factory(jQuery);
+ }
+}(function (jQuery) {
+ // Polish
+ function numpf(n, s, t) {
+ // s - 2-4, 22-24, 32-34 ...
+ // t - 5-21, 25-31, ...
+ var n10 = n % 10;
+ if ( (n10 > 1) && (n10 < 5) && ( (n > 20) || (n < 10) ) ) {
+ return s;
+ } else {
+ return t;
+ }
+ }
+
+ jQuery.timeago.settings.strings = {
+ prefixAgo: null,
+ prefixFromNow: "za",
+ suffixAgo: "temu",
+ suffixFromNow: null,
+ seconds: "mniej niż minutę",
+ minute: "minutę",
+ minutes: function(value) { return numpf(value, "%d minuty", "%d minut"); },
+ hour: "godzinę",
+ hours: function(value) { return numpf(value, "%d godziny", "%d godzin"); },
+ day: "dzień",
+ days: "%d dni",
+ month: "miesiąc",
+ months: function(value) { return numpf(value, "%d miesiące", "%d miesięcy"); },
+ year: "rok",
+ years: function(value) { return numpf(value, "%d lata", "%d lat"); }
+ };
+}));
diff --git a/locales/jquery.timeago.pt-br-short.js b/locales/jquery.timeago.pt-br-short.js
new file mode 100644
index 0000000..f7cd7e8
--- /dev/null
+++ b/locales/jquery.timeago.pt-br-short.js
@@ -0,0 +1,30 @@
+(function (factory) {
+ if (typeof define === 'function' && define.amd) {
+ define(['jquery'], factory);
+ } else if (typeof module === 'object' && typeof module.exports === 'object') {
+ factory(require('jquery'));
+ } else {
+ factory(jQuery);
+ }
+}(function (jQuery) {
+ // Portuguese Brasil shortened
+ jQuery.timeago.settings.strings = {
+ prefixAgo: null,
+ prefixFromNow: null,
+ suffixAgo: "",
+ suffixFromNow: "",
+ seconds: "1m",
+ minute: "1m",
+ minutes: "%dm",
+ hour: "1h",
+ hours: "%dh",
+ day: "1d",
+ days: "%dd",
+ month: "1M",
+ months: "%dM",
+ year: "1a",
+ years: "%da",
+ wordSeparator: " ",
+ numbers: []
+ };
+}));
diff --git a/locales/jquery.timeago.pt-br.js b/locales/jquery.timeago.pt-br.js
new file mode 100644
index 0000000..a8701a8
--- /dev/null
+++ b/locales/jquery.timeago.pt-br.js
@@ -0,0 +1,28 @@
+(function (factory) {
+ if (typeof define === 'function' && define.amd) {
+ define(['jquery'], factory);
+ } else if (typeof module === 'object' && typeof module.exports === 'object') {
+ factory(require('jquery'));
+ } else {
+ factory(jQuery);
+ }
+}(function (jQuery) {
+ // Brazilian Portuguese
+ jQuery.timeago.settings.strings = {
+ prefixAgo: "há",
+ prefixFromNow: "em",
+ suffixAgo: null,
+ suffixFromNow: null,
+ seconds: "alguns segundos",
+ minute: "um minuto",
+ minutes: "%d minutos",
+ hour: "uma hora",
+ hours: "%d horas",
+ day: "um dia",
+ days: "%d dias",
+ month: "um mês",
+ months: "%d meses",
+ year: "um ano",
+ years: "%d anos"
+ };
+}));
diff --git a/locales/jquery.timeago.pt-short.js b/locales/jquery.timeago.pt-short.js
new file mode 100644
index 0000000..0b146a7
--- /dev/null
+++ b/locales/jquery.timeago.pt-short.js
@@ -0,0 +1,30 @@
+(function (factory) {
+ if (typeof define === 'function' && define.amd) {
+ define(['jquery'], factory);
+ } else if (typeof module === 'object' && typeof module.exports === 'object') {
+ factory(require('jquery'));
+ } else {
+ factory(jQuery);
+ }
+}(function (jQuery) {
+ // Portuguese shortened
+ jQuery.timeago.settings.strings = {
+ prefixAgo: null,
+ prefixFromNow: null,
+ suffixAgo: "",
+ suffixFromNow: "",
+ seconds: "1m",
+ minute: "1m",
+ minutes: "%dm",
+ hour: "1h",
+ hours: "%dh",
+ day: "1d",
+ days: "%dd",
+ month: "1M",
+ months: "%dM",
+ year: "1a",
+ years: "%da",
+ wordSeparator: " ",
+ numbers: []
+ };
+}));
diff --git a/locales/jquery.timeago.pt.js b/locales/jquery.timeago.pt.js
new file mode 100644
index 0000000..e060bbf
--- /dev/null
+++ b/locales/jquery.timeago.pt.js
@@ -0,0 +1,26 @@
+(function (factory) {
+ if (typeof define === 'function' && define.amd) {
+ define(['jquery'], factory);
+ } else if (typeof module === 'object' && typeof module.exports === 'object') {
+ factory(require('jquery'));
+ } else {
+ factory(jQuery);
+ }
+}(function (jQuery) {
+ // Portuguese
+ jQuery.timeago.settings.strings = {
+ prefixAgo: "há",
+ prefixFromNow: "daqui a",
+ seconds: "menos de um minuto",
+ minute: "cerca de um minuto",
+ minutes: "%d minutos",
+ hour: "cerca de uma hora",
+ hours: "cerca de %d horas",
+ day: "um dia",
+ days: "%d dias",
+ month: "cerca de um mês",
+ months: "%d meses",
+ year: "cerca de um ano",
+ years: "%d anos"
+ };
+}));
diff --git a/locales/jquery.timeago.ro.js b/locales/jquery.timeago.ro.js
new file mode 100644
index 0000000..fe59db9
--- /dev/null
+++ b/locales/jquery.timeago.ro.js
@@ -0,0 +1,29 @@
+(function (factory) {
+ if (typeof define === 'function' && define.amd) {
+ define(['jquery'], factory);
+ } else if (typeof module === 'object' && typeof module.exports === 'object') {
+ factory(require('jquery'));
+ } else {
+ factory(jQuery);
+ }
+}(function (jQuery) {
+ // Romanian
+ jQuery.timeago.settings.strings = {
+ prefixAgo: "acum",
+ prefixFromNow: "in timp de",
+ suffixAgo: "",
+ suffixFromNow: "",
+ seconds: "mai putin de un minut",
+ minute: "un minut",
+ minutes: "%d minute",
+ hour: "o ora",
+ hours: "%d ore",
+ day: "o zi",
+ days: "%d zile",
+ month: "o luna",
+ months: "%d luni",
+ year: "un an",
+ years: "%d ani"
+ };
+}));
+
diff --git a/locales/jquery.timeago.rs.js b/locales/jquery.timeago.rs.js
new file mode 100644
index 0000000..b9e5188
--- /dev/null
+++ b/locales/jquery.timeago.rs.js
@@ -0,0 +1,54 @@
+(function (factory) {
+ if (typeof define === 'function' && define.amd) {
+ define(['jquery'], factory);
+ } else if (typeof module === 'object' && typeof module.exports === 'object') {
+ factory(require('jquery'));
+ } else {
+ factory(jQuery);
+ }
+}(function (jQuery) {
+ // Serbian
+ var numpf = function (n, f, s, t) {
+ var n10;
+ n10 = n % 10;
+ if (n10 === 1 && (n === 1 || n > 20)) {
+ return f;
+ } else if (n10 > 1 && n10 < 5 && (n > 20 || n < 10)) {
+ return s;
+ } else {
+ return t;
+ }
+ };
+
+ jQuery.timeago.settings.strings = {
+ prefixAgo: "pre",
+ prefixFromNow: "za",
+ suffixAgo: null,
+ suffixFromNow: null,
+ second: "sekund",
+ seconds: function (value) {
+ return numpf(value, "%d sekund", "%d sekunde", "%d sekundi");
+ },
+ minute: "oko minut",
+ minutes: function (value) {
+ return numpf(value, "%d minut", "%d minuta", "%d minuta");
+ },
+ hour: "oko jedan sat",
+ hours: function (value) {
+ return numpf(value, "%d sat", "%d sata", "%d sati");
+ },
+ day: "jedan dan",
+ days: function (value) {
+ return numpf(value, "%d dan", "%d dana", "%d dana");
+ },
+ month: "mesec dana",
+ months: function (value) {
+ return numpf(value, "%d mesec", "%d meseca", "%d meseci");
+ },
+ year: "godinu dana",
+ years: function (value) {
+ return numpf(value, "%d godinu", "%d godine", "%d godina");
+ },
+ wordSeparator: " "
+ };
+}));
diff --git a/locales/jquery.timeago.ru.js b/locales/jquery.timeago.ru.js
new file mode 100644
index 0000000..4ff3f8d
--- /dev/null
+++ b/locales/jquery.timeago.ru.js
@@ -0,0 +1,43 @@
+(function (factory) {
+ if (typeof define === 'function' && define.amd) {
+ define(['jquery'], factory);
+ } else if (typeof module === 'object' && typeof module.exports === 'object') {
+ factory(require('jquery'));
+ } else {
+ factory(jQuery);
+ }
+}(function (jQuery) {
+ // Russian
+ function numpf(n, f, s, t) {
+ // f - 1, 21, 31, ...
+ // s - 2-4, 22-24, 32-34 ...
+ // t - 5-20, 25-30, ...
+ n = n % 100;
+ var n10 = n % 10;
+ if ( (n10 === 1) && ( (n === 1) || (n > 20) ) ) {
+ return f;
+ } else if ( (n10 > 1) && (n10 < 5) && ( (n > 20) || (n < 10) ) ) {
+ return s;
+ } else {
+ return t;
+ }
+ }
+
+ jQuery.timeago.settings.strings = {
+ prefixAgo: null,
+ prefixFromNow: "через",
+ suffixAgo: "назад",
+ suffixFromNow: null,
+ seconds: "меньше минуты",
+ minute: "минуту",
+ minutes: function(value) { return numpf(value, "%d минуту", "%d минуты", "%d минут"); },
+ hour: "час",
+ hours: function(value) { return numpf(value, "%d час", "%d часа", "%d часов"); },
+ day: "день",
+ days: function(value) { return numpf(value, "%d день", "%d дня", "%d дней"); },
+ month: "месяц",
+ months: function(value) { return numpf(value, "%d месяц", "%d месяца", "%d месяцев"); },
+ year: "год",
+ years: function(value) { return numpf(value, "%d год", "%d года", "%d лет"); }
+ };
+}));
diff --git a/locales/jquery.timeago.rw.js b/locales/jquery.timeago.rw.js
new file mode 100644
index 0000000..50119e1
--- /dev/null
+++ b/locales/jquery.timeago.rw.js
@@ -0,0 +1,30 @@
+(function (factory) {
+ if (typeof define === 'function' && define.amd) {
+ define(['jquery'], factory);
+ } else if (typeof module === 'object' && typeof module.exports === 'object') {
+ factory(require('jquery'));
+ } else {
+ factory(jQuery);
+ }
+}(function (jQuery) {
+ // Kinyarwanda
+ jQuery.timeago.settings.strings = {
+ prefixAgo: "hashize",
+ prefixFromNow: "mu",
+ suffixAgo: null,
+ suffixFromNow: null,
+ seconds: "amasegonda macye",
+ minute: "umunota",
+ minutes: "iminota %d",
+ hour: "isaha",
+ hours: "amasaha %d",
+ day: "umunsi",
+ days: "iminsi %d",
+ month: "ukwezi",
+ months: "amezi %d",
+ year: "umwaka",
+ years: "imyaka %d",
+ wordSeparator: " ",
+ numbers: []
+ };
+}));
diff --git a/locales/jquery.timeago.si.js b/locales/jquery.timeago.si.js
new file mode 100644
index 0000000..6fa215e
--- /dev/null
+++ b/locales/jquery.timeago.si.js
@@ -0,0 +1,28 @@
+(function (factory) {
+ if (typeof define === 'function' && define.amd) {
+ define(['jquery'], factory);
+ } else if (typeof module === 'object' && typeof module.exports === 'object') {
+ factory(require('jquery'));
+ } else {
+ factory(jQuery);
+ }
+}(function (jQuery) {
+ // Sinhalese (SI)
+ jQuery.timeago.settings.strings = {
+ prefixAgo: null,
+ prefixFromNow: null,
+ suffixAgo: "පෙර",
+ suffixFromNow: "පසුව",
+ seconds: "තත්පර කිහිපයකට",
+ minute: "මිනිත්තුවකට පමණ",
+ minutes: "මිනිත්තු %d කට",
+ hour: "පැයක් පමණ ",
+ hours: "පැය %d කට පමණ",
+ day: "දවසක ට",
+ days: "දවස් %d කට ",
+ month: "මාසයක් පමණ",
+ months: "මාස %d කට",
+ year: "වසරක් පමණ",
+ years: "වසරක් %d කට පමණ"
+ };
+}));
diff --git a/locales/jquery.timeago.sk.js b/locales/jquery.timeago.sk.js
new file mode 100644
index 0000000..e28ab7c
--- /dev/null
+++ b/locales/jquery.timeago.sk.js
@@ -0,0 +1,34 @@
+(function (factory) {
+ if (typeof define === 'function' && define.amd) {
+ define(['jquery'], factory);
+ } else if (typeof module === 'object' && typeof module.exports === 'object') {
+ factory(require('jquery'));
+ } else {
+ factory(jQuery);
+ }
+}(function (jQuery) {
+ // Slovak
+ (function() {
+ function f(n, d, a) {
+ return a[d>=0 ? 0 : a.length===2 || n<5 ? 1 : 2];
+ }
+
+ jQuery.timeago.settings.strings = {
+ prefixAgo: 'pred',
+ prefixFromNow: 'o',
+ suffixAgo: null,
+ suffixFromNow: null,
+ seconds: function(n, d) {return f(n, d, ['menej ako minútou', 'menej ako minútu']);},
+ minute: function(n, d) {return f(n, d, ['minútou', 'minútu']);},
+ minutes: function(n, d) {return f(n, d, ['%d minútami', '%d minúty', '%d minút']);},
+ hour: function(n, d) {return f(n, d, ['hodinou', 'hodinu']);},
+ hours: function(n, d) {return f(n, d, ['%d hodinami', '%d hodiny', '%d hodín']);},
+ day: function(n, d) {return f(n, d, ['%d dňom', '%d deň']);},
+ days: function(n, d) {return f(n, d, ['%d dňami', '%d dni', '%d dní']);},
+ month: function(n, d) {return f(n, d, ['%d mesiacom', '%d mesiac']);},
+ months: function(n, d) {return f(n, d, ['%d mesiacmi', '%d mesiace', '%d mesiacov']);},
+ year: function(n, d) {return f(n, d, ['%d rokom', '%d rok']);},
+ years: function(n, d) {return f(n, d, ['%d rokmi', '%d roky', '%d rokov']);}
+ };
+ })();
+}));
diff --git a/locales/jquery.timeago.sl.js b/locales/jquery.timeago.sl.js
new file mode 100644
index 0000000..9f0329a
--- /dev/null
+++ b/locales/jquery.timeago.sl.js
@@ -0,0 +1,46 @@
+(function (factory) {
+ if (typeof define === 'function' && define.amd) {
+ define(['jquery'], factory);
+ } else if (typeof module === 'object' && typeof module.exports === 'object') {
+ factory(require('jquery'));
+ } else {
+ factory(jQuery);
+ }
+}(function (jQuery) {
+ // Slovenian with support for dual
+ var numpf = function (n, a) {
+ return a[n%100===1 ? 1 : n%100===2 ? 2 : n%100===3 || n%100===4 ? 3 : 0];
+ };
+
+ jQuery.timeago.settings.strings = {
+ prefixAgo: null,
+ prefixFromNow: "čez",
+ suffixAgo: "nazaj",
+ suffixFromNow: null,
+ second: "sekundo",
+ seconds: function (value) {
+ return numpf(value, ["%d sekund", "%d sekundo", "%d sekundi", "%d sekunde"]);
+ },
+ minute: "minuto",
+ minutes: function (value) {
+ return numpf(value, ["%d minut", "%d minuto", "%d minuti", "%d minute"]);
+ },
+ hour: "eno uro",
+ hours: function (value) {
+ return numpf(value, ["%d ur", "%d uro", "%d uri", "%d ure"]);
+ },
+ day: "en dan",
+ days: function (value) {
+ return numpf(value, ["%d dni", "%d dan", "%d dneva", "%d dni"]);
+ },
+ month: "en mesec",
+ months: function (value) {
+ return numpf(value, ["%d mesecev", "%d mesec", "%d meseca", "%d mesece"]);
+ },
+ year: "eno leto",
+ years: function (value) {
+ return numpf(value, ["%d let", "%d leto", "%d leti", "%d leta"]);
+ },
+ wordSeparator: " "
+ };
+}));
diff --git a/locales/jquery.timeago.sq.js b/locales/jquery.timeago.sq.js
new file mode 100644
index 0000000..cb8ae70
--- /dev/null
+++ b/locales/jquery.timeago.sq.js
@@ -0,0 +1,26 @@
+(function (factory) {
+ if (typeof define === 'function' && define.amd) {
+ define(['jquery'], factory);
+ } else if (typeof module === 'object' && typeof module.exports === 'object') {
+ factory(require('jquery'));
+ } else {
+ factory(jQuery);
+ }
+}(function (jQuery) {
+ // Albanian SQ
+ jQuery.timeago.settings.strings = {
+ suffixAgo: "më parë",
+ suffixFromNow: "tani",
+ seconds: "më pak se një minutë",
+ minute: "rreth një minutë",
+ minutes: "%d minuta",
+ hour: "rreth një orë",
+ hours: "rreth %d orë",
+ day: "një ditë",
+ days: "%d ditë",
+ month: "rreth një muaj",
+ months: "%d muaj",
+ year: "rreth një vit",
+ years: "%d vjet"
+ };
+}));
diff --git a/locales/jquery.timeago.sr.js b/locales/jquery.timeago.sr.js
new file mode 100644
index 0000000..bd1efe7
--- /dev/null
+++ b/locales/jquery.timeago.sr.js
@@ -0,0 +1,54 @@
+(function (factory) {
+ if (typeof define === 'function' && define.amd) {
+ define(['jquery'], factory);
+ } else if (typeof module === 'object' && typeof module.exports === 'object') {
+ factory(require('jquery'));
+ } else {
+ factory(jQuery);
+ }
+}(function (jQuery) {
+ // Serbian
+ var numpf = function (n, f, s, t) {
+ var n10;
+ n10 = n % 10;
+ if (n10 === 1 && (n === 1 || n > 20)) {
+ return f;
+ } else if (n10 > 1 && n10 < 5 && (n > 20 || n < 10)) {
+ return s;
+ } else {
+ return t;
+ }
+ };
+
+ jQuery.timeago.settings.strings = {
+ prefixAgo: "пре",
+ prefixFromNow: "за",
+ suffixAgo: null,
+ suffixFromNow: null,
+ second: "секунд",
+ seconds: function (value) {
+ return numpf(value, "%d секунд", "%d секунде", "%d секунди");
+ },
+ minute: "један минут",
+ minutes: function (value) {
+ return numpf(value, "%d минут", "%d минута", "%d минута");
+ },
+ hour: "један сат",
+ hours: function (value) {
+ return numpf(value, "%d сат", "%d сата", "%d сати");
+ },
+ day: "један дан",
+ days: function (value) {
+ return numpf(value, "%d дан", "%d дана", "%d дана");
+ },
+ month: "месец дана",
+ months: function (value) {
+ return numpf(value, "%d месец", "%d месеца", "%d месеци");
+ },
+ year: "годину дана",
+ years: function (value) {
+ return numpf(value, "%d годину", "%d године", "%d година");
+ },
+ wordSeparator: " "
+ };
+}));
diff --git a/locales/jquery.timeago.sv.js b/locales/jquery.timeago.sv.js
new file mode 100644
index 0000000..caf09db
--- /dev/null
+++ b/locales/jquery.timeago.sv.js
@@ -0,0 +1,28 @@
+(function (factory) {
+ if (typeof define === 'function' && define.amd) {
+ define(['jquery'], factory);
+ } else if (typeof module === 'object' && typeof module.exports === 'object') {
+ factory(require('jquery'));
+ } else {
+ factory(jQuery);
+ }
+}(function (jQuery) {
+ // Swedish
+ jQuery.timeago.settings.strings = {
+ prefixAgo: "för",
+ prefixFromNow: "om",
+ suffixAgo: "sedan",
+ suffixFromNow: "",
+ seconds: "mindre än en minut",
+ minute: "ungefär en minut",
+ minutes: "%d minuter",
+ hour: "ungefär en timme",
+ hours: "ungefär %d timmar",
+ day: "en dag",
+ days: "%d dagar",
+ month: "ungefär en månad",
+ months: "%d månader",
+ year: "ungefär ett år",
+ years: "%d år"
+ };
+}));
diff --git a/locales/jquery.timeago.th.js b/locales/jquery.timeago.th.js
new file mode 100644
index 0000000..23d59d4
--- /dev/null
+++ b/locales/jquery.timeago.th.js
@@ -0,0 +1,30 @@
+(function (factory) {
+ if (typeof define === 'function' && define.amd) {
+ define(['jquery'], factory);
+ } else if (typeof module === 'object' && typeof module.exports === 'object') {
+ factory(require('jquery'));
+ } else {
+ factory(jQuery);
+ }
+}(function (jQuery) {
+ // Thai
+ jQuery.timeago.settings.strings = {
+ prefixAgo: null,
+ prefixFromNow: null,
+ suffixAgo: "ที่แล้ว",
+ suffixFromNow: "จากตอนนี้",
+ seconds: "น้อยกว่าหนึ่งนาที",
+ minute: "ประมาณหนึ่งนาที",
+ minutes: "%d นาที",
+ hour: "ประมาณหนึ่งชั่วโมง",
+ hours: "ประมาณ %d ชั่วโมง",
+ day: "หนึ่งวัน",
+ days: "%d วัน",
+ month: "ประมาณหนึ่งเดือน",
+ months: "%d เดือน",
+ year: "ประมาณหนึ่งปี",
+ years: "%d ปี",
+ wordSeparator: "",
+ numbers: []
+ };
+}));
diff --git a/locales/jquery.timeago.tr-short.js b/locales/jquery.timeago.tr-short.js
new file mode 100644
index 0000000..ba290dd
--- /dev/null
+++ b/locales/jquery.timeago.tr-short.js
@@ -0,0 +1,30 @@
+(function (factory) {
+ if (typeof define === 'function' && define.amd) {
+ define(['jquery'], factory);
+ } else if (typeof module === 'object' && typeof module.exports === 'object') {
+ factory(require('jquery'));
+ } else {
+ factory(jQuery);
+ }
+}(function (jQuery) {
+ // Turkish shortened
+ jQuery.timeago.settings.strings = {
+ prefixAgo: null,
+ prefixFromNow: null,
+ suffixAgo: "",
+ suffixFromNow: "",
+ seconds: "1dk",
+ minute: "1dk",
+ minutes: "%ddk",
+ hour: "1s",
+ hours: "%ds",
+ day: "1g",
+ days: "%dg",
+ month: "1ay",
+ months: "%day",
+ year: "1y",
+ years: "%dy",
+ wordSeparator: " ",
+ numbers: []
+ };
+}));
diff --git a/locales/jquery.timeago.tr.js b/locales/jquery.timeago.tr.js
new file mode 100644
index 0000000..8e0d2d4
--- /dev/null
+++ b/locales/jquery.timeago.tr.js
@@ -0,0 +1,26 @@
+(function (factory) {
+ if (typeof define === 'function' && define.amd) {
+ define(['jquery'], factory);
+ } else if (typeof module === 'object' && typeof module.exports === 'object') {
+ factory(require('jquery'));
+ } else {
+ factory(jQuery);
+ }
+}(function (jQuery) {
+ // Turkish
+ jQuery.timeago.settings.strings = {
+ suffixAgo: 'önce',
+ suffixFromNow: null,
+ seconds: 'birkaç saniye',
+ minute: '1 dakika',
+ minutes: '%d dakika',
+ hour: '1 saat',
+ hours: '%d saat',
+ day: '1 gün',
+ days: '%d gün',
+ month: '1 ay',
+ months: '%d ay',
+ year: '1 yıl',
+ years: '%d yıl'
+ };
+}));
diff --git a/locales/jquery.timeago.uk.js b/locales/jquery.timeago.uk.js
new file mode 100644
index 0000000..489963b
--- /dev/null
+++ b/locales/jquery.timeago.uk.js
@@ -0,0 +1,42 @@
+(function (factory) {
+ if (typeof define === 'function' && define.amd) {
+ define(['jquery'], factory);
+ } else if (typeof module === 'object' && typeof module.exports === 'object') {
+ factory(require('jquery'));
+ } else {
+ factory(jQuery);
+ }
+}(function (jQuery) {
+ // Ukrainian
+ function numpf(n, f, s, t) {
+ // f - 1, 21, 31, ...
+ // s - 2-4, 22-24, 32-34 ...
+ // t - 5-20, 25-30, ...
+ var n10 = n % 10;
+ if ( (n10 === 1) && ( (n === 1) || (n > 20) ) ) {
+ return f;
+ } else if ( (n10 > 1) && (n10 < 5) && ( (n > 20) || (n < 10) ) ) {
+ return s;
+ } else {
+ return t;
+ }
+ }
+
+ jQuery.timeago.settings.strings = {
+ prefixAgo: null,
+ prefixFromNow: "через",
+ suffixAgo: "тому",
+ suffixFromNow: null,
+ seconds: "менше хвилини",
+ minute: "хвилина",
+ minutes: function(value) { return numpf(value, "%d хвилина", "%d хвилини", "%d хвилин"); },
+ hour: "година",
+ hours: function(value) { return numpf(value, "%d година", "%d години", "%d годин"); },
+ day: "день",
+ days: function(value) { return numpf(value, "%d день", "%d дні", "%d днів"); },
+ month: "місяць",
+ months: function(value) { return numpf(value, "%d місяць", "%d місяці", "%d місяців"); },
+ year: "рік",
+ years: function(value) { return numpf(value, "%d рік", "%d роки", "%d років"); }
+ };
+}));
diff --git a/locales/jquery.timeago.ur.js b/locales/jquery.timeago.ur.js
new file mode 100644
index 0000000..9d0cd40
--- /dev/null
+++ b/locales/jquery.timeago.ur.js
@@ -0,0 +1,30 @@
+(function (factory) {
+ if (typeof define === 'function' && define.amd) {
+ define(['jquery'], factory);
+ } else if (typeof module === 'object' && typeof module.exports === 'object') {
+ factory(require('jquery'));
+ } else {
+ factory(jQuery);
+ }
+}(function (jQuery) {
+ // Urdu
+ jQuery.timeago.settings.strings = {
+ prefixAgo: null,
+ prefixFromNow: null,
+ suffixAgo: "پہلے",
+ suffixFromNow: "اب سے",
+ seconds: "کچھ سیکنڈز",
+ minute: "تقریباً ایک منٹ",
+ minutes: "%d منٹ",
+ hour: "تقریباً ایک گھنٹہ",
+ hours: "تقریباً %d گھنٹے",
+ day: "ایک دن",
+ days: "%d دن",
+ month: "تقریباً ایک مہینہ",
+ months: "%d مہینے",
+ year: "تقریباً ایک سال",
+ years: "%d سال",
+ wordSeparator: " ",
+ numbers: []
+ };
+}));
diff --git a/locales/jquery.timeago.uz.js b/locales/jquery.timeago.uz.js
new file mode 100755
index 0000000..f4ce8b3
--- /dev/null
+++ b/locales/jquery.timeago.uz.js
@@ -0,0 +1,29 @@
+(function (factory) {
+ if (typeof define === 'function' && define.amd) {
+ define(['jquery'], factory);
+ } else if (typeof module === 'object' && typeof module.exports === 'object') {
+ factory(require('jquery'));
+ } else {
+ factory(jQuery);
+ }
+}(function (jQuery) {
+ //Uzbek
+ jQuery.timeago.settings.strings = {
+ prefixAgo: null,
+ prefixFromNow: "keyin",
+ suffixAgo: "avval",
+ suffixFromNow: null,
+ seconds: "bir necha soniya",
+ minute: "1 daqiqa",
+ minutes: function(value) { return "%d daqiqa"; },
+ hour: "1 soat",
+ hours: function(value) { return "%d soat"; },
+ day: "1 kun",
+ days: function(value) { return "%d kun"; },
+ month: "1 oy",
+ months: function(value) { return "%d oy"; },
+ year: "1 yil",
+ years: function(value) { return "%d yil"; },
+ wordSeparator: " "
+ };
+}));
diff --git a/locales/jquery.timeago.vi.js b/locales/jquery.timeago.vi.js
new file mode 100644
index 0000000..1230b1e
--- /dev/null
+++ b/locales/jquery.timeago.vi.js
@@ -0,0 +1,30 @@
+(function (factory) {
+ if (typeof define === 'function' && define.amd) {
+ define(['jquery'], factory);
+ } else if (typeof module === 'object' && typeof module.exports === 'object') {
+ factory(require('jquery'));
+ } else {
+ factory(jQuery);
+ }
+}(function (jQuery) {
+ // Vietnamese
+ jQuery.timeago.settings.strings = {
+ prefixAgo: 'cách đây',
+ prefixFromNow: null,
+ suffixAgo: "trước",
+ suffixFromNow: "kể từ bây giờ",
+ seconds: "chưa đến một phút",
+ minute: "khoảng một phút",
+ minutes: "%d phút",
+ hour: "khoảng một tiếng",
+ hours: "khoảng %d tiếng",
+ day: "một ngày",
+ days: "%d ngày",
+ month: "khoảng một tháng",
+ months: "%d tháng",
+ year: "khoảng một năm",
+ years: "%d năm",
+ wordSeparator: " ",
+ numbers: []
+ };
+}));
diff --git a/locales/jquery.timeago.zh-CN.js b/locales/jquery.timeago.zh-CN.js
new file mode 100644
index 0000000..c21a287
--- /dev/null
+++ b/locales/jquery.timeago.zh-CN.js
@@ -0,0 +1,31 @@
+(function (factory) {
+ if (typeof define === 'function' && define.amd) {
+ define(['jquery'], factory);
+ } else if (typeof module === 'object' && typeof module.exports === 'object') {
+ factory(require('jquery'));
+ } else {
+ factory(jQuery);
+ }
+}(function (jQuery) {
+ // Simplified Chinese
+ jQuery.timeago.settings.strings = {
+ prefixAgo: null,
+ prefixFromNow: null,
+ suffixAgo: "之前",
+ suffixFromNow: "之后",
+ seconds: "不到1分钟",
+ minute: "大约1分钟",
+ minutes: "%d分钟",
+ hour: "大约1小时",
+ hours: "大约%d小时",
+ day: "1天",
+ days: "%d天",
+ month: "大约1个月",
+ months: "%d月",
+ year: "大约1年",
+ years: "%d年",
+ numbers: [],
+ wordSeparator: ""
+ };
+}));
+
diff --git a/locales/jquery.timeago.zh-TW.js b/locales/jquery.timeago.zh-TW.js
new file mode 100644
index 0000000..15f5626
--- /dev/null
+++ b/locales/jquery.timeago.zh-TW.js
@@ -0,0 +1,30 @@
+(function (factory) {
+ if (typeof define === 'function' && define.amd) {
+ define(['jquery'], factory);
+ } else if (typeof module === 'object' && typeof module.exports === 'object') {
+ factory(require('jquery'));
+ } else {
+ factory(jQuery);
+ }
+}(function (jQuery) {
+ // Traditional Chinese, zh-tw
+ jQuery.timeago.settings.strings = {
+ prefixAgo: null,
+ prefixFromNow: null,
+ suffixAgo: "之前",
+ suffixFromNow: "之後",
+ seconds: "不到1分鐘",
+ minute: "大約1分鐘",
+ minutes: "%d分鐘",
+ hour: "大約1小時",
+ hours: "%d小時",
+ day: "大約1天",
+ days: "%d天",
+ month: "大約1個月",
+ months: "%d個月",
+ year: "大約1年",
+ years: "%d年",
+ numbers: [],
+ wordSeparator: ""
+ };
+}));
diff --git a/package.json b/package.json
new file mode 100644
index 0000000..9f32977
--- /dev/null
+++ b/package.json
@@ -0,0 +1,37 @@
+{
+ "name": "timeago",
+ "version": "1.6.7",
+ "title": "jQuery Timeago",
+ "author": {
+ "name": "Ryan McGeary",
+ "email": "ryan@mcgeary.org",
+ "url": "http://ryan.mcgeary.org/"
+ },
+ "licenses": [
+ {
+ "type": "MIT",
+ "url": "http://opensource.org/licenses/mit-license.php"
+ }
+ ],
+ "dependencies": {
+ "jquery": ">=1.5.0 <4.0"
+ },
+ "description": "jQuery plugin that makes it easy to support automatically updating fuzzy timestamps (e.g. \"4 minutes ago\" or \"about 1 day ago\").",
+ "keywords": [
+ "time",
+ "microformat"
+ ],
+ "homepage": "http://timeago.yarp.com/",
+ "docs": "https://github.com/rmm5t/jquery-timeago",
+ "demo": "http://timeago.yarp.com/",
+ "download": "http://timeago.yarp.com/jquery.timeago.js",
+ "bugs": "https://github.com/rmm5t/jquery-timeago/issues",
+ "maintainers": [],
+ "spm": {
+ "main": "jquery.timeago.js"
+ },
+ "browser": {
+ "timeago": "./node_modules/timeago/jquery.timeago.js"
+ },
+ "main": "jquery.timeago.js"
+}
diff --git a/test/index.html b/test/index.html
new file mode 100644
index 0000000..e51b614
--- /dev/null
+++ b/test/index.html
@@ -0,0 +1,732 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta charset="utf-8">
+ <title>jQuery-Timeago Test Suite</title>
+ <link rel="stylesheet" href="http://code.jquery.com/qunit/qunit-1.11.0.css">
+</head>
+<body>
+ <div id="qunit"></div>
+ <div id="qunit-fixture"></div>
+
+ <div id="main">
+ <h2>Short term</h2>
+
+ <p>You opened this page <time class="loaded timeago testShortTerm">(you shouldn't see this)</time>.</p>
+
+ <p>
+ This page was last modified <time class="modified timeago">sometime before
+ now (your browser might not support document.lastModified for local resources)</time>.
+ </p>
+
+ <h2>Long term</h2>
+
+ <p>
+ Jett was born
+ <abbr class="timeago testLongTerm" title="2008-02-27T00:23:00Z">(you shouldn't see this)</abbr>
+ [from Z].
+ </p>
+ <p>
+ Jett was born
+ <abbr class="timeago testLongTerm" title="2008-02-26T19:23:00-0500">(you shouldn't see this)</abbr>
+ [from -0500].
+ </p>
+ <p>
+ Logan was born
+ <abbr class="timeago testLongTerm" title="2005-06-17T23:42:00Z">(you shouldn't see this)</abbr>
+ [from Z].
+ </p>
+ <p>
+ Logan was born
+ <abbr class="timeago testLongTerm" title="2005-06-17T19:42:00-0400">(you shouldn't see this)</abbr>
+ [from -0400].
+ </p>
+ <p>
+ Ryan was born
+ <abbr class="timeago testLongTerm" title="1978-12-18T17:17:00Z">(you shouldn't see this)</abbr>
+ [from Z].
+ </p>
+ <p>
+ Ryan was born
+ <abbr class="timeago testLongTerm" title="1978-12-18T12:17:00-05:00">(you shouldn't see this)</abbr>
+ [from -0500].
+ </p>
+
+ <h2>Other formats</h2>
+
+ <p>Date only (abbr element): <abbr class="timeago" title="2008-02-26">(you shouldn't see this)</abbr>.</p>
+ <p>Date only (time element): <time class="timeago" datetime="2008-02-26">(you shouldn't see this)</time>.</p>
+ <p>Date only (friendly tooltip): <abbr id="testTooltip" class="timeago" title="2008-02-26">February 26th</abbr>.</p>
+ <p>Date only (default tooltip): <abbr id="defaultTooltip" class="timeago" title="2008-02-26"> </abbr>.</p>
+ <p>Timestsamp (with millis): <abbr class="timeago" title="1978-12-18T17:17:00.021Z">(you shouldn't see this)</abbr>.</p>
+
+ <p><time id="testTimeTitle" class="timeago" datetime="2012-05-07T10:06:02+02:00" title="May 10, 2012 10:06">May 10, 2012</time></p>
+ <p><time id="testTimeTitle2" class="timeago" datetime="2012-05-07T10:06:02+02:00">May 10, 2012</time></p>
+
+ <h2>Cutoff</h2>
+
+ <p>Date that is before a past cutoff: <abbr class="timeago cutoff doCutoffPast" title="1978-12-18">(this should be displayed)</abbr></p>
+
+ <p>Date that is after a past cutoff: <time class="timeago loaded cutoff dontCutoffPast">(you shouldn't see this)</time></p>
+
+ <p>Date that is past a future cutoff: <abbr class="timeago cutoff doCutoffFuture" title="2999-12-18">(this should be displayed)</abbr></p>
+
+ <p>Date that is before a future cutoff: <time class="timeago loaded cutoff dontCutoffFuture">(you shouldn't see this)</time></p>
+
+ <h2>Errors</h2>
+
+ <p>Bad (letters): <abbr class="bad timeago" title="bleh">(this should be displayed)</abbr>.</p>
+ <p>Bad (blank): <abbr class="bad timeago" title="">(this should be displayed)</abbr>.</p>
+ <p>Bad (missing): <abbr class="bad timeago">(this should be displayed)</abbr>.</p>
+
+ <h2>Parsing</h2>
+
+ <p>Ryan was born&#133;</p>
+ <ul>
+ <li><abbr id="testParsing1" class="todate" title="1978-12-18T17:17:00Z"></abbr> [from Z]</li>
+ <li><abbr id="testParsing2" class="todate" title="1978-12-18T17:17:00-00:00"></abbr> [from -00:00]</li>
+ <li><abbr id="testParsing3" class="todate" title="1978-12-18T12:17:00-05:00"></abbr> [from -05:00]</li>
+ <li><abbr id="testParsing4" class="todate" title="1978-12-18T12:17:00-0500"></abbr> [from -0500]</li>
+ <li><abbr id="testParsing5" class="todate" title="1978-12-19T02:17:00+09:00"></abbr> [from +09:00]</li>
+ <li><abbr id="testParsing6" class="todate" title="1978-12-19T02:17:00+0900"></abbr> [from +0900]</li>
+ <li><abbr id="testParsing7" class="todate" title="1978-12-18 17:17:00"></abbr> [from blank TZ]</li>
+ <li><abbr id="testParsing8" class="todate" title="1978-12-18 17:17:00.021Z"></abbr> [from Z with milliseconds]</li>
+ <li><abbr id="testParsing9" class="todate" title="1978-12-18 17:17:00.021432Z"></abbr> [from Z with microseconds]</li>
+ <li><abbr id="testParsing10" class="todate" title="1978-12-18 17:17:00.0Z"></abbr> [from Z with tenths of a second]</li>
+ <li><abbr id="testParsing11" class="todate" title="1978-12-18 17:17:00.02Z"></abbr> [from Z with hundreths of a second]</li>
+ <li><abbr id="testParsing12" class="todate" title="1978-12-19T02:17:00+09"></abbr> [from +09]</li>
+ </ul>
+
+ <h2>Wording</h2>
+
+ <ul>
+ <li><abbr id="testWording1" class="towords" title="-7200"></abbr> [-120 min]</li>
+ <li><abbr id="testWording2" class="towords" title="-60"></abbr> [-60 sec]</li>
+ <li><abbr id="testWording3" class="towords" title="-30"></abbr> [-30 sec]</li>
+ <li><abbr id="testWording4" class="towords" title="-1"></abbr> [-1 sec]</li>
+ <li><abbr id="testWording5" class="towords" title="0"></abbr> [0 sec]</li>
+ <li><abbr id="testWording6" class="towords" title="30"></abbr> [30 sec]</li>
+ <li><abbr id="testWording7" class="towords" title="45"></abbr> [45 sec]</li>
+ <li><abbr id="testWording8" class="towords" title="90"></abbr> [90 sec]</li>
+ <li><abbr id="testWording9" class="towords" title="120"></abbr> [120 sec]</li>
+ <li><abbr id="testWording10" class="towords" title="2700"></abbr> [45 min]</li>
+ <li><abbr id="testWording11" class="towords" title="5340"></abbr> [89 min]</li>
+ <li><abbr id="testWording12" class="towords" title="5400"></abbr> [90 min]</li>
+ <li><abbr id="testWording13" class="towords" title="7200"></abbr> [120 min]</li>
+ <li><abbr id="testWording14" class="towords" title="82800"></abbr> [1380 min]</li>
+ <li><abbr id="testWording15" class="towords" title="90000"></abbr> [25 hours]</li>
+ <li><abbr id="testWording16a" class="towords" title="147600"></abbr> [41 hours]</li>
+ <li><abbr id="testWording16b" class="towords" title="151200"></abbr> [42 hours]</li>
+ <li><abbr id="testWording16c" class="towords" title="172800"></abbr> [48 hours]</li>
+ <li><abbr id="testWording17" class="towords" title="2505600"></abbr> [696 hours]</li>
+ <li><abbr id="testWording18" class="towords" title="2592000"></abbr> [30 days]</li>
+ <li><abbr id="testWording19" class="towords" title="16416000"></abbr> [190 days]</li>
+ <li><abbr id="testWording20" class="towords" title="31622400"></abbr> [366 days]</li>
+ <li><abbr id="testWording21" class="towords" title="62640000"></abbr> [725 days]</li>
+ <li><abbr id="testWording22" class="towords" title="94608000"></abbr> [1095 days]</li>
+ </ul>
+
+ <h2>Settings</h2>
+
+ <ul>
+ <li><abbr id="testNumbersSettings1" class="tonumbers" title="120"></abbr> [2 min]</li>
+ <li><abbr id="testNumbersSettings2" class="tonumbers" title="540"></abbr> [9 min]</li>
+ <li><abbr id="testNumbersSettings3" class="tonumbers" title="600"></abbr> [10 min]</li>
+
+ <li><abbr id="testYoungOldSettings1" class="toyoungold" title="504576000"></abbr> [5840 days]</li>
+ <li><abbr id="testYoungOldSettings2" class="toyoungold" title="2018304000"></abbr> [23360 days]</li>
+
+ <li><abbr id="testNoSpaces1" class="nospaces" title="120"></abbr> [120 sec]</li>
+ <li><abbr id="testNullSpaces1" class="nullspaces" title="120"></abbr> [120 sec]</li>
+
+ <li><abbr id="testLatinSettings1" class="tolatin" title="-7200"></abbr> [-120 min]</li>
+ <li><abbr id="testLatinSettings2" class="tolatin" title="-60"></abbr> [-60 sec]</li>
+ <li><abbr id="testLatinSettings3" class="tolatin" title="-30"></abbr> [-30 sec]</li>
+ <li><abbr id="testLatinSettings4" class="tolatin" title="-1"></abbr> [-1 sec]</li>
+ <li><abbr id="testLatinSettings5" class="tolatin" title="0"></abbr> [0 sec]</li>
+ <li><abbr id="testLatinSettings6" class="tolatin" title="30"></abbr> [30 sec]</li>
+ <li><abbr id="testLatinSettings7" class="tolatin" title="45"></abbr> [45 sec]</li>
+ <li><abbr id="testLatinSettings8" class="tolatin" title="90"></abbr> [90 sec]</li>
+ <li><abbr id="testLatinSettings9" class="tolatin" title="120"></abbr> [120 sec]</li>
+ <li><abbr id="testLatinSettings10" class="tolatin" title="2700"></abbr> [45 min]</li>
+ <li><abbr id="testLatinSettings11" class="tolatin" title="5340"></abbr> [89 min]</li>
+ <li><abbr id="testLatinSettings12" class="tolatin" title="5400"></abbr> [90 min]</li>
+ <li><abbr id="testLatinSettings13" class="tolatin" title="7200"></abbr> [120 min]</li>
+ <li><abbr id="testLatinSettings14" class="tolatin" title="82800"></abbr> [1380 min]</li>
+ <li><abbr id="testLatinSettings15" class="tolatin" title="90000"></abbr> [25 hours]</li>
+ <li><abbr id="testLatinSettings16" class="tolatin" title="172800"></abbr> [48 hours]</li>
+ <li><abbr id="testLatinSettings17" class="tolatin" title="2505600"></abbr> [696 hours]</li>
+ <li><abbr id="testLatinSettings18" class="tolatin" title="2592000"></abbr> [30 days]</li>
+ <li><abbr id="testLatinSettings19" class="tolatin" title="16416000"></abbr> [190 days]</li>
+ <li><abbr id="testLatinSettings20" class="tolatin" title="31622400"></abbr> [366 days]</li>
+ <li><abbr id="testLatinSettings21" class="tolatin" title="94608000"></abbr> [1095 days]</li>
+
+ <li><abbr id="testRussianSettings1" class="torussian" title="-7200"></abbr> [-120 min]</li>
+ <li><abbr id="testRussianSettings2" class="torussian" title="-60"></abbr> [-60 sec]</li>
+ <li><abbr id="testRussianSettings3" class="torussian" title="-30"></abbr> [-30 sec]</li>
+ <li><abbr id="testRussianSettings4" class="torussian" title="-1"></abbr> [-1 sec]</li>
+ <li><abbr id="testRussianSettings5" class="torussian" title="0"></abbr> [0 sec]</li>
+ <li><abbr id="testRussianSettings6" class="torussian" title="30"></abbr> [30 sec]</li>
+ <li><abbr id="testRussianSettings7" class="torussian" title="45"></abbr> [45 sec]</li>
+ <li><abbr id="testRussianSettings8" class="torussian" title="90"></abbr> [90 sec]</li>
+ <li><abbr id="testRussianSettings9" class="torussian" title="120"></abbr> [120 sec]</li>
+ <li><abbr id="testRussianSettings10" class="torussian" title="2700"></abbr> [45 min]</li>
+ <li><abbr id="testRussianSettings11" class="torussian" title="5340"></abbr> [89 min]</li>
+ <li><abbr id="testRussianSettings12" class="torussian" title="5400"></abbr> [90 min]</li>
+ <li><abbr id="testRussianSettings13" class="torussian" title="7200"></abbr> [120 min]</li>
+ <li><abbr id="testRussianSettings14" class="torussian" title="82800"></abbr> [1380 min]</li>
+ <li><abbr id="testRussianSettings15" class="torussian" title="90000"></abbr> [25 hours]</li>
+ <li><abbr id="testRussianSettings16" class="torussian" title="172800"></abbr> [48 hours]</li>
+ <li><abbr id="testRussianSettings17" class="torussian" title="2505600"></abbr> [696 hours]</li>
+ <li><abbr id="testRussianSettings18" class="torussian" title="2592000"></abbr> [30 days]</li>
+ <li><abbr id="testRussianSettings19" class="torussian" title="16416000"></abbr> [190 days]</li>
+ <li><abbr id="testRussianSettings20" class="torussian" title="31622400"></abbr> [366 days]</li>
+ <li><abbr id="testRussianSettings21" class="torussian" title="94608000"></abbr> [1095 days]</li>
+
+ <li><abbr id="testMillisSettings1" class="tomillis" title="-7200"></abbr> [-120 min]</li>
+ <li><abbr id="testMillisSettings2" class="tomillis" title="-60"></abbr> [-60 sec]</li>
+ <li><abbr id="testMillisSettings3" class="tomillis" title="-30"></abbr> [-30 sec]</li>
+ <li><abbr id="testMillisSettings4" class="tomillis" title="-1"></abbr> [-1 sec]</li>
+ <li><abbr id="testMillisSettings5" class="tomillis" title="0"></abbr> [0 sec]</li>
+ <li><abbr id="testMillisSettings6" class="tomillis" title="30"></abbr> [30 sec]</li>
+ <li><abbr id="testMillisSettings7" class="tomillis" title="45"></abbr> [45 sec]</li>
+ <li><abbr id="testMillisSettings8" class="tomillis" title="90"></abbr> [90 sec]</li>
+ <li><abbr id="testMillisSettings9" class="tomillis" title="120"></abbr> [120 sec]</li>
+
+ <li><abbr id="testBelarusianSettings1" class="tobelarusian" title="-7200"></abbr> [-120 min]</li>
+ <li><abbr id="testBelarusianSettings2" class="tobelarusian" title="-60"></abbr> [-60 sec]</li>
+ <li><abbr id="testBelarusianSettings3" class="tobelarusian" title="-30"></abbr> [-30 sec]</li>
+ <li><abbr id="testBelarusianSettings4" class="tobelarusian" title="-1"></abbr> [-1 sec]</li>
+ <li><abbr id="testBelarusianSettings5" class="tobelarusian" title="0"></abbr> [0 sec]</li>
+ <li><abbr id="testBelarusianSettings6" class="tobelarusian" title="30"></abbr> [30 sec]</li>
+ <li><abbr id="testBelarusianSettings7" class="tobelarusian" title="45"></abbr> [45 sec]</li>
+ <li><abbr id="testBelarusianSettings8" class="tobelarusian" title="90"></abbr> [90 sec]</li>
+ <li><abbr id="testBelarusianSettings9" class="tobelarusian" title="120"></abbr> [120 sec]</li>
+ <li><abbr id="testBelarusianSettings10" class="tobelarusian" title="2700"></abbr> [45 min]</li>
+ <li><abbr id="testBelarusianSettings11" class="tobelarusian" title="5340"></abbr> [89 min]</li>
+ <li><abbr id="testBelarusianSettings12" class="tobelarusian" title="5400"></abbr> [90 min]</li>
+ <li><abbr id="testBelarusianSettings13" class="tobelarusian" title="7200"></abbr> [120 min]</li>
+ <li><abbr id="testBelarusianSettings14" class="tobelarusian" title="82800"></abbr> [1380 min]</li>
+ <li><abbr id="testBelarusianSettings15" class="tobelarusian" title="90000"></abbr> [25 hours]</li>
+ <li><abbr id="testBelarusianSettings16" class="tobelarusian" title="172800"></abbr> [48 hours]</li>
+ <li><abbr id="testBelarusianSettings17" class="tobelarusian" title="2505600"></abbr> [696 hours]</li>
+ <li><abbr id="testBelarusianSettings18" class="tobelarusian" title="2592000"></abbr> [30 days]</li>
+ <li><abbr id="testBelarusianSettings19" class="tobelarusian" title="16416000"></abbr> [190 days]</li>
+ <li><abbr id="testBelarusianSettings20" class="tobelarusian" title="31622400"></abbr> [366 days]</li>
+ <li><abbr id="testBelarusianSettings21" class="tobelarusian" title="94608000"></abbr> [1095 days]</li>
+ </ul>
+
+ <h2>Do Not Allow Future</h2>
+
+ <ul>
+ <li><abbr id="testAllowFutureFalse1" class="doNotAllowFuture" title="2012-01-01T09:24:17Z">(you shouldn't see this)</abbr></li>
+ </ul>
+
+ <h2>Do Not Allow Past</h2>
+
+ <ul>
+ <li><abbr id="testAllowPastFalse1" class="doNotAllowPast" title="2008-01-01T09:24:17Z">(you shouldn't see this)</abbr></li>
+ <li><abbr id="testAllowPastAndFutureFalse" title="2008-01-01T09:24:17Z"></abbr></li>
+ </ul>
+
+ <h2>Disposal</h2>
+ <p><abbr id="testDisposed" class="disposal"></abbr></p>
+ </div>
+
+ <script src="http://ajax.googleapis.com/ajax/libs/jquery/3.4.0/jquery.min.js"></script>
+ <!-- <script src="http://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> -->
+ <!-- <script src="http://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> -->
+ <!-- <script src="http://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script> -->
+ <!-- <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script> -->
+ <!-- <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.0/jquery.min.js"></script> -->
+ <script src="http://code.jquery.com/qunit/qunit-1.11.0.js"></script>
+ <script src="../jquery.timeago.js"></script>
+ <script src="test_helpers.js" type="text/javascript"></script>
+ <script type="text/javascript">
+ (function ($) {
+ function testElements(selector, test) {
+ var elements = $(selector);
+ var numberOfTests = elements.length;
+ var numberOfPasses = 0;
+
+ elements.each(function () {
+ if (test($(this))) { numberOfPasses++; }
+ });
+
+ return (numberOfTests === numberOfPasses);
+ }
+
+ function toWords() {
+ var string = $.timeago.inWords(parseInt(this.title, 10) * 1000);
+ $(this).text(string);
+ }
+
+ $.timeago.settings.allowFuture = true;
+
+ prepareDynamicDates();
+
+ $("abbr.timeago").not("abbr.cutoff").timeago();
+ $("time.timeago").timeago();
+
+ loadCutoffSetting();
+ $("abbr.cutoff").timeago();
+ unloadCutoffSetting();
+
+ var tooltip = $("#testTooltip").data("timeago");
+
+ $("abbr.todate").each(function () {
+ var date = $.timeago.parse(this.title);
+ $(this).text(date.toUTCString());
+ });
+
+ $("abbr.towords").each(toWords);
+
+ loadNumbers();
+ $("abbr.tonumbers").each(toWords);
+ unloadNumbers();
+
+ loadDoNotAllowFuture();
+ $("abbr.doNotAllowFuture").timeago();
+ unloadDoNotAllowFuture();
+
+ loadDoNotAllowPast();
+ $("abbr.doNotAllowPast").timeago();
+ unloadDoNotAllowPast();
+
+ setupDisposal();
+
+ loadYoungOldYears();
+ $("abbr.toyoungold").each(toWords);
+
+ loadNoSpaces();
+ $("abbr.nospaces").each(toWords);
+
+ loadNullSpaces();
+ $("abbr.nullspaces").each(toWords);
+
+ loadPigLatin();
+ $("abbr.tolatin").each(toWords);
+
+ loadRussian();
+ $("abbr.torussian").each(toWords);
+
+ loadMillis();
+ $("abbr.tomillis").each(toWords);
+
+ loadBelarusian();
+ $("abbr.tobelarusian").each(toWords);
+
+ module("Valid date");
+
+ test("Text in abbr tag should be replaced", function () {
+ ok(testElements("abbr.timeago", function (element) {
+ return (element.html() !== "(you shouldn't see this)");
+ }), "All text was replaced");
+ });
+
+ test("Text in time tag should be replaced", function () {
+ ok(testElements("time.timeago", function (element) {
+ return (element.html() !== "(you shouldn't see this)");
+ }), "All text was replaced");
+ });
+
+ module("Invalid date");
+
+ test("Text in abbr should not be replaced", function () {
+ ok(testElements("abbr.bad", function (element) {
+ return (element.html() === "(this should be displayed)");
+ }), "No text was replaced");
+ });
+
+ module("Short term");
+
+ test("Dates shorter than a minute should be replaced with short term text", function () {
+ ok(testElements("abbr.testShortTerm", function (element) {
+ return (element.html() === "less than a minute ago");
+ }), "All short term dates correctly parsed");
+ });
+
+ module("Long term");
+
+ test("Dates older than one year should contain the word 'year'", function () {
+ ok(testElements("abbr.testLongTerm", function (element) {
+ return (element.html().match(/year/));
+ }), "All long term dates correctly parsed");
+ });
+
+ module("Data object");
+
+ test("should set timeago data object", function () {
+ ok(tooltip, "data set");
+ ok(tooltip.datetime, "datetime set");
+ });
+
+ module("Cutoff");
+
+ test("should not change dates older than cutoff setting", function () {
+ ok(testElements("abbr.doCutoffPast", function (element) {
+ return (element.html() === "(this should be displayed)");
+ }), "Cutoff setting working fine");
+ });
+
+ test("should change dates newer than cutoff setting", function () {
+ ok(testElements("abbr.dontCutoffPast", function (element) {
+ return (element.html() === "less than a minute ago");
+ }), "Cutoff setting working fine");
+ });
+
+ test("should not change dates older than cutoff setting", function () {
+ ok(testElements("abbr.doCutoffFuture", function (element) {
+ return (element.html() === "(this should be displayed)");
+ }), "Cutoff setting working fine");
+ });
+
+ test("should change dates newer than cutoff setting", function () {
+ ok(testElements("abbr.dontCutoffFuture", function (element) {
+ return (element.html() === "less than a minute ago");
+ }), "Cutoff setting working fine");
+ });
+
+ module("Tooltip");
+
+ test("should set title to original text contents", function () {
+ ok($("#testTooltip").attr("title") === "February 26th", "correctly set");
+ });
+
+ test("should leave title alone if no text text content", function () {
+ ok($("#defaultTooltip").attr("title") === "2008-02-26", "correctly set");
+ });
+
+ test("should preserve title in time tags", function () {
+ ok(($("#testTimeTitle").attr('title') === "May 10, 2012 10:06"), "title preserved")
+ });
+
+ test("should set title in time tags without a title", function () {
+ ok(($("#testTimeTitle2").attr('title') === "May 10, 2012"), "title set")
+ });
+
+ module("Parsing");
+
+ // Note, different browsers behave slightly different
+ var correctMatch = /Mon, 18 Dec 1978 17:17:00 (GMT|UTC)/;
+
+ test("From Z", function () {
+ var time = $("#testParsing1");
+ ok((time.html().match(correctMatch)), "Incorrectly parsed " + time.attr("title"));
+ });
+
+ test("From -00:00", function () {
+ var time = $("#testParsing2");
+ ok((time.html().match(correctMatch)), "Incorrectly parsed " + time.attr("title"));
+ });
+
+ test("From -05:00", function () {
+ var time = $("#testParsing3");
+ ok((time.html().match(correctMatch)), "Incorrectly parsed " + time.attr("title"));
+ });
+
+ test("From -0500", function () {
+ var time = $("#testParsing4");
+ ok((time.html().match(correctMatch)), "Incorrectly parsed " + time.attr("title"));
+ });
+
+ test("From +09:00", function () {
+ var time = $("#testParsing5");
+ ok((time.html().match(correctMatch)), "Incorrectly parsed " + time.attr("title"));
+ });
+
+ test("From +0900", function () {
+ var time = $("#testParsing6");
+ ok((time.html().match(correctMatch)), "Incorrectly parsed " + time.attr("title"));
+ });
+
+ // We no longer support blank TZs. From ISO 8601: If no UTC relation
+ // information is given with a time representation, the time is assumed to
+ // be in local time. While it may be safe to assume local time when
+ // communicating in the same time zone, it is ambiguous when used in
+ // communicating across different time zones. It is usually preferable to
+ // indicate a time zone (zone designator) using the standard's notation.
+ //
+ // test("From blank TZ", function () {
+ // var time = $("#testParsing7");
+ // var correctMatch = /Mon, 18 Dec 1978 \d\d:17:00 (GMT|UTC)/;
+ // ok((time.html().match(correctMatch)), "Incorrectly parsed " + time.attr("title"));
+ // });
+
+ test("From Z with milliseconds", function () {
+ var time = $("#testParsing8");
+ ok((time.html().match(correctMatch)), "Incorrectly parsed " + time.attr("title"));
+ });
+
+ test("From Z with microseconds", function () {
+ var time = $("#testParsing9");
+ ok((time.html().match(correctMatch)), "Incorrectly parsed " + time.attr("title"));
+ });
+
+ test("From Z with tenths of a second", function () {
+ var time = $("#testParsing10");
+ ok((time.html().match(correctMatch)), "Incorrectly parsed " + time.attr("title"));
+ });
+
+ test("From Z with hundreths of a second", function () {
+ var time = $("#testParsing11");
+ ok((time.html().match(correctMatch)), "Incorrectly parsed " + time.attr("title"));
+ });
+
+ test("From +09", function () {
+ var time = $("#testParsing12");
+ ok((time.html().match(correctMatch)), "Incorrectly parsed " + time.attr("title"));
+ });
+
+ module("Wording");
+
+ test("-120 min", function () {
+ ok(($("#testWording1").html() === "about 2 hours from now"), "Incorrectly parsed");
+ });
+
+ test("-60 sec", function () {
+ ok(($("#testWording2").html() === "about a minute from now"), "Incorrectly parsed");
+ });
+
+ test("-30 sec", function () {
+ ok(($("#testWording3").html() === "less than a minute from now"), "Incorrectly parsed");
+ });
+
+ test("-1 sec", function () {
+ ok(($("#testWording4").html() === "less than a minute from now"), "Incorrectly parsed");
+ });
+
+ test("0 sec", function () {
+ ok(($("#testWording5").html() === "less than a minute ago"), "Incorrectly parsed");
+ });
+
+ test("30 sec", function () {
+ ok(($("#testWording6").html() === "less than a minute ago"), "Incorrectly parsed");
+ });
+
+ test("45 sec", function () {
+ ok(($("#testWording7").html() === "about a minute ago"), "Incorrectly parsed");
+ });
+
+ test("90 sec", function () {
+ ok(($("#testWording8").html() === "2 minutes ago"), "Incorrectly parsed");
+ });
+
+ test("120 sec", function () {
+ ok(($("#testWording9").html() === "2 minutes ago"), "Incorrectly parsed");
+ });
+
+ test("45 min", function () {
+ ok(($("#testWording10").html() === "about an hour ago"), "Incorrectly parsed");
+ });
+
+ test("89 min", function () {
+ ok(($("#testWording11").html() === "about an hour ago"), "Incorrectly parsed");
+ });
+
+ test("90 min", function () {
+ ok(($("#testWording12").html() === "about 2 hours ago"), "Incorrectly parsed");
+ });
+
+ test("120 min", function () {
+ ok(($("#testWording13").html() === "about 2 hours ago"), "Incorrectly parsed");
+ });
+
+ test("1380 min", function () {
+ ok(($("#testWording14").html() === "about 23 hours ago"), "Incorrectly parsed");
+ });
+
+ test("25 hours", function () {
+ ok(($("#testWording15").html() === "a day ago"), "Incorrectly parsed");
+ });
+
+ test("41 hour", function () {
+ ok(($("#testWording16a").html() === "a day ago"), "Incorrectly parsed");
+ });
+ test("42 hours", function () {
+ ok(($("#testWording16b").html() === "2 days ago"), "Incorrectly parsed");
+ });
+ test("48 hours", function () {
+ ok(($("#testWording16c").html() === "2 days ago"), "Incorrectly parsed");
+ });
+
+ test("696 hours", function () {
+ ok(($("#testWording17").html() === "29 days ago"), "Incorrectly parsed");
+ });
+
+ test("30 days", function () {
+ ok(($("#testWording18").html() === "about a month ago"), "Incorrectly parsed");
+ });
+
+ test("190 days", function () {
+ ok(($("#testWording19").html() === "6 months ago"), "Incorrectly parsed");
+ });
+
+ test("366 days", function () {
+ ok(($("#testWording20").html() === "about a year ago"), "Incorrectly parsed");
+ });
+
+ test("725 days", function () {
+ ok(($("#testWording21").html() === "2 years ago"), "Incorrectly parsed");
+ });
+
+ test("1095 days", function () {
+ ok(($("#testWording22").html() === "3 years ago"), "Incorrectly parsed");
+ });
+
+ module("Settings");
+
+ test("suffixFromNow", function () {
+ ok($("#testLatinSettings1").html().match(/omNow-fray$/), "Settings correctly applied");
+ ok($("#testMillisSettings1").html().match(/from now$/), "Settings correctly applied");
+ });
+
+ test("suffixAgo", function () {
+ ok($("#testLatinSettings5").html().match(/ago-hay$/), "Settings correctly applied");
+ ok($("#testRussianSettings5").html().match(/назад$/), "Settings correctly applied");
+ ok($("#testBelarusianSettings5").html().match(/таму$/), "Settings correctly applied");
+ ok($("#testMillisSettings5").html().match(/ago/), "Settings correctly applied");
+ });
+
+ test("prefixFromNow", function () {
+ ok($("#testRussianSettings2").html().match(/^через/), "Settings correctly applied");
+ ok($("#testBelarusianSettings2").html().match(/^праз/), "Settings correctly applied");
+ });
+
+ test("seconds", function () {
+ ok($("#testLatinSettings5").html().match(/^ess-lay an-thay a-hay inute-may/), "Settings correctly applied");
+ ok($("#testRussianSettings5").html().match(/^меньше минуты/), "Settings correctly applied");
+ ok($("#testMillisSettings5").html().match(/0 milliseconds/), "Settings correctly applied");
+ ok($("#testBelarusianSettings5").html().match(/менш хвіліны/), "Settings correctly applied");
+ });
+
+ test("minute", function () {
+ ok($("#testLatinSettings7").html().match(/^about-hay a-hay inute-may/), "Settings correctly applied");
+ ok($("#testRussianSettings7").html().match(/^минуту/), "Settings correctly applied");
+ ok($("#testMillisSettings7").html().match(/45000 milliseconds/), "Settings correctly applied");
+ ok($("#testBelarusianSettings7").html().match(/хвіліну/), "Settings correctly applied");
+ });
+
+ test("minutes", function () {
+ ok($("#testLatinSettings8").html().match(/^2 inutes-may/), "Settings correctly applied");
+ ok($("#testRussianSettings8").html().match(/^2 минуты/), "Settings correctly applied");
+ ok($("#testBelarusianSettings8").html().match(/^2 хвіліны/), "Settings correctly applied");
+ // TODO: Test "минута" and "минут"
+ });
+
+ test("hour", function () {
+ ok($("#testLatinSettings10").html().match(/^about-hay an-hay hour-hay/), "Settings correctly applied");
+ ok($("#testRussianSettings10").html().match(/^час/), "Settings correctly applied");
+ ok($("#testBelarusianSettings10").html().match(/^гадзіну/), "Settings correctly applied");
+ });
+
+ test("hours", function () {
+ ok($("#testLatinSettings12").html().match(/^about-hay 2 hours-hay/), "Settings correctly applied");
+ ok($("#testRussianSettings12").html().match(/^2 часа/), "Settings correctly applied");
+ ok($("#testBelarusianSettings12").html().match(/^2 гадзіны/), "Settings correctly applied");
+ // TODO: Test "час" and "часов"
+ });
+
+ test("day", function () {
+ ok($("#testLatinSettings15").html().match(/^a-hay ay-day/), "Settings correctly applied");
+ ok($("#testRussianSettings15").html().match(/^день/), "Settings correctly applied");
+ ok($("#testBelarusianSettings15").html().match(/^дзень/), "Settings correctly applied");
+ });
+
+ test("days", function () {
+ ok($("#testLatinSettings16").html().match(/^2 ays-day/), "Settings correctly applied");
+ ok($("#testRussianSettings16").html().match(/^2 дня/), "Settings correctly applied");
+ ok($("#testRussianSettings17").html().match(/^29 дней/), "Settings correctly applied");
+ ok($("#testBelarusianSettings16").html().match(/^2 дні/), "Settings correctly applied");
+ ok($("#testBelarusianSettings17").html().match(/^29 дзён/), "Settings correctly applied");
+ // TODO: Test "день"
+ });
+
+ test("month", function () {
+ ok($("#testLatinSettings18").html().match(/^about-hay a-hay onth-may/), "Settings correctly applied");
+ ok($("#testRussianSettings18").html().match(/^месяц/), "Settings correctly applied");
+ ok($("#testBelarusianSettings18").html().match(/^месяц/), "Settings correctly applied");
+ });
+
+ test("months", function () {
+ ok($("#testLatinSettings19").html().match(/^6 onths-may/), "Settings correctly applied");
+ ok($("#testRussianSettings19").html().match(/^6 месяцев/), "Settings correctly applied");
+ ok($("#testBelarusianSettings19").html().match(/^6 месяцаў/), "Settings correctly applied");
+ // TODO: Test "месяца" and "месяц"
+ });
+
+ test("year", function () {
+ ok($("#testLatinSettings20").html().match(/^about-hay a-hay ear-yay/), "Settings correctly applied");
+ ok($("#testRussianSettings20").html().match(/^год/), "Settings correctly applied");
+ ok($("#testBelarusianSettings20").html().match(/^год/), "Settings correctly applied");
+ });
+
+ test("years", function () {
+ ok($("#testYoungOldSettings1").html().match(/^16 young years/), "Settings correctly applied");
+ ok($("#testYoungOldSettings2").html().match(/^64 old years/), "Settings correctly applied");
+ ok($("#testLatinSettings21").html().match(/^3 years-yay/), "Settings correctly applied");
+ ok($("#testRussianSettings21").html().match(/^3 года/), "Settings correctly applied");
+ ok($("#testBelarusianSettings21").html().match(/^3 гады/), "Settings correctly applied");
+ // TODO: Test "год" and "лет"
+ });
+
+ test("numbers", function () {
+ ok($("#testNumbersSettings1").html().match(/^two minutes/), "Settings correctly applied");
+ ok($("#testNumbersSettings2").html().match(/^nine minutes/), "Settings correctly applied");
+ ok($("#testNumbersSettings3").html().match(/^10 minutes/), "Settings correctly applied");
+ });
+
+ test("wordSeparator", function () {
+ ok($("#testNoSpaces1").html().match(/^2minutesago$/), "Settings correctly applied");
+ ok($("#testNullSpaces1").html().match(/^2minutesago$/), "Settings correctly applied");
+ });
+
+ module("Allow Future and Past");
+
+ // if allowFuture is false, then a minute into the future is actually reported as a minute in the past.
+ // we did not want to alter the current behavior and break backwards compatability
+ test("allow future false with a future date moves time backwards", function () {
+ equal($("#testAllowFutureFalse1").html(), "2 years ago");
+ });
+
+ test("allow future false with a future date moves time backwards", function () {
+ equal($("#testAllowPastFalse1").html(), "in the past");
+ });
+
+ test("throws if allowPast and allowFuture are both false", function () {
+ // setup
+ var origAllowFuture = $.timeago.settings.allowFuture;
+ var origAllowPast = $.timeago.settings.allowPast;
+ $.timeago.settings.allowFuture = false;
+ $.timeago.settings.allowPast = false;
+
+ try {
+ throws(function () {
+ $("#testAllowPastAndFutureFalse").timeago();
+ });
+ } finally {
+ // teardown
+ $.timeago.settings.allowFuture = origAllowFuture;
+ $.timeago.settings.allowPast = origAllowPast;
+ }
+ });
+
+ module("Disposal");
+
+ asyncTest("disposal", function() {
+ var disposed = $("#testDisposed");
+ disposed.timeago("dispose");
+ var initialTime_disposedTimeago = disposed.html();
+
+ expect(1);
+ setTimeout(function() {
+ var updatedTime_disposedTimeago = disposed.html();
+ ok(initialTime_disposedTimeago === updatedTime_disposedTimeago, "A disposed timeago continued to update");
+ resetRefreshMillis();
+ start();
+ }, 50);
+ });
+ })(jQuery);
+ </script>
+</body>
+</html>
diff --git a/test/test_helpers.js b/test/test_helpers.js
new file mode 100644
index 0000000..607005a
--- /dev/null
+++ b/test/test_helpers.js
@@ -0,0 +1,215 @@
+var zeropad = function (num) {
+ return ((num < 10) ? '0' : '') + num;
+};
+var iso8601 = function (date) {
+ return date.getUTCFullYear()
+ + "-" + zeropad(date.getUTCMonth()+1)
+ + "-" + zeropad(date.getUTCDate())
+ + "T" + zeropad(date.getUTCHours())
+ + ":" + zeropad(date.getUTCMinutes())
+ + ":" + zeropad(date.getUTCSeconds()) + "Z";
+};
+
+function prepareDynamicDates() {
+ $('time.loaded').attr("datetime", iso8601(new Date()));
+ $('time.modified').attr("datetime", iso8601(new Date(document.lastModified)));
+}
+
+function loadNumbers() {
+ jQuery.timeago.settings.strings.numbers = ["zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine"];
+}
+function unloadNumbers() {
+ jQuery.timeago.settings.strings.numbers = [];
+}
+
+function loadCutoffSetting() {
+ jQuery.timeago.settings.cutoff = 7*24*60*60*1000;
+}
+
+function unloadCutoffSetting() {
+ jQuery.timeago.settings.cutoff = 0;
+}
+
+function setupDisposal() {
+ jQuery.timeago.settings.refreshMillis = 25;
+ $('abbr.disposal').attr("title", iso8601(new Date())).timeago();
+}
+
+function loadPigLatin() {
+ jQuery.timeago.settings.strings = {
+ suffixAgo: "ago-hay",
+ suffixFromNow: "omNow-fray",
+ seconds: "ess-lay an-thay a-hay inute-may",
+ minute: "about-hay a-hay inute-may",
+ minutes: "%d inutes-may",
+ hour: "about-hay an-hay hour-hay",
+ hours: "about-hay %d hours-hay",
+ day: "a-hay ay-day",
+ days: "%d ays-day",
+ month: "about-hay a-hay onth-may",
+ months: "%d onths-may",
+ year: "about-hay a-hay ear-yay",
+ years: "%d years-yay"
+ };
+}
+
+function loadRussian() {
+ (function() {
+ function numpf(n, f, s, t) {
+ // f - 1, 21, 31, ...
+ // s - 2-4, 22-24, 32-34 ...
+ // t - 5-20, 25-30, ...
+ var n10 = n % 10;
+ if ( (n10 === 1) && ( (n === 1) || (n > 20) ) ) {
+ return f;
+ } else if ( (n10 > 1) && (n10 < 5) && ( (n > 20) || (n < 10) ) ) {
+ return s;
+ } else {
+ return t;
+ }
+ }
+
+ jQuery.timeago.settings.strings = {
+ prefixAgo: null,
+ prefixFromNow: "через",
+ suffixAgo: "назад",
+ suffixFromNow: null,
+ seconds: "меньше минуты",
+ minute: "минуту",
+ minutes: function(value) { return numpf(value, "%d минута", "%d минуты", "%d минут"); },
+ hour: "час",
+ hours: function(value) { return numpf(value, "%d час", "%d часа", "%d часов"); },
+ day: "день",
+ days: function(value) { return numpf(value, "%d день", "%d дня", "%d дней"); },
+ month: "месяц",
+ months: function(value) { return numpf(value, "%d месяц", "%d месяца", "%d месяцев"); },
+ year: "год",
+ years: function(value) { return numpf(value, "%d год", "%d года", "%d лет"); }
+ };
+ })();
+}
+
+function loadBelarusian() {
+ (function() {
+ function numpf(n, f, s, t) {
+ // f - 1, 21, 31, ...
+ // s - 2-4, 22-24, 32-34 ...
+ // t - 5-20, 25-30, ...
+ var n10 = n % 10;
+ if ( (n10 === 1) && ( (n === 1) || (n > 20) ) ) {
+ return f;
+ } else if ( (n10 > 1) && (n10 < 5) && ( (n > 20) || (n < 10) ) ) {
+ return s;
+ } else {
+ return t;
+ }
+ }
+
+ jQuery.timeago.settings.strings = {
+ prefixAgo: null,
+ prefixFromNow: "праз",
+ suffixAgo: "таму",
+ suffixFromNow: null,
+ seconds: "менш хвіліны",
+ minute: "хвіліну",
+ minutes: function(value) { return numpf(value, "%d хвіліна", "%d хвіліны", "%d хвілін"); },
+ hour: "гадзіну",
+ hours: function(value) { return numpf(value, "%d гадзіна", "%d гадзіны", "%d гадзін"); },
+ day: "дзень",
+ days: function(value) { return numpf(value, "%d дзень", "%d дні", "%d дзён"); },
+ month: "месяц",
+ months: function(value) { return numpf(value, "%d месяц", "%d месяцы", "%d месяцаў"); },
+ year: "год",
+ years: function(value) { return numpf(value, "%d год", "%d гады", "%d гадоў"); }
+ };
+ })();
+}
+
+function resetRefreshMillis() {
+ jQuery.timeago.settings.refreshMillis = 60000;
+}
+
+function loadMillis() {
+ var millisSubstitution = function(number, millis) { return millis + " milliseconds"; };
+ jQuery.timeago.settings.strings = {
+ suffixAgo: "ago",
+ suffixFromNow: "from now",
+ seconds: millisSubstitution,
+ minute: millisSubstitution,
+ minutes: millisSubstitution,
+ hour: millisSubstitution,
+ hours: millisSubstitution,
+ day: millisSubstitution,
+ days: millisSubstitution,
+ month: millisSubstitution,
+ months: millisSubstitution,
+ year: millisSubstitution,
+ years: millisSubstitution
+ };
+}
+
+function loadNoSpaces() {
+ jQuery.extend(jQuery.timeago.settings.strings, {
+ minutes: "%dminutes",
+ wordSeparator: ""
+ });
+}
+
+function loadNullSpaces() {
+ jQuery.extend(jQuery.timeago.settings.strings, {
+ minutes: "%dminutes",
+ wordSeparator: null
+ });
+}
+
+function loadYoungOldYears() {
+ jQuery.extend(jQuery.timeago.settings.strings, {
+ years: function(value) { return (value < 21) ? "%d young years" : "%d old years"; }
+ });
+}
+
+function loadDoNotAllowFuture() {
+ var mockDateToUse = "2010-01-01";
+ $.timeago.settings.allowFuture = false;
+ enableMockedDate(mockDateToUse);
+}
+
+function unloadDoNotAllowFuture() {
+ $.timeago.settings.allowFuture = true;
+ disableMockedDate();
+}
+
+function loadDoNotAllowPast() {
+ var mockDateToUse = "2010-01-01";
+ $.timeago.settings.allowFuture = true;
+ $.timeago.settings.allowPast = false;
+ $.timeago.settings.strings.inPast = "in the past";
+ enableMockedDate(mockDateToUse);
+}
+
+function unloadDoNotAllowPast() {
+ $.timeago.settings.allowFuture = true;
+ $.timeago.settings.allowPast = true;
+ disableMockedDate();
+}
+
+function enableMockedDate(dateToReturn) {
+ var mockDate = dateToReturn;
+ window.NativeDate = Date;
+ window.Date = function () {
+ if(arguments.length === 0) {
+ return new window.NativeDate(mockDate);
+ } else if(arguments.length === 1) {
+ return new window.NativeDate(arguments[0]);
+ } else if(arguments.length === 7) {
+ return new window.NativeDate(arguments[0], arguments[1], arguments[2], arguments[3], arguments[4], arguments[5], arguments[6]);
+ } else {
+ throw "Mocking Date with this number of parameters is not implemented.";
+ }
+ };
+}
+
+function disableMockedDate() {
+ window.Date = window.NativeDate;
+ delete window.NativeDate;
+}
diff --git a/timeago.jquery.json b/timeago.jquery.json
new file mode 100644
index 0000000..891c1b2
--- /dev/null
+++ b/timeago.jquery.json
@@ -0,0 +1,30 @@
+{
+ "name": "timeago",
+ "version": "1.6.7",
+ "title": "jQuery Timeago",
+ "author": {
+ "name": "Ryan McGeary",
+ "email": "ryan@mcgeary.org",
+ "url": "http://ryan.mcgeary.org/"
+ },
+ "licenses": [
+ {
+ "type": "MIT",
+ "url": "http://opensource.org/licenses/mit-license.php"
+ }
+ ],
+ "dependencies": {
+ "jquery": ">=1.5.0 <4.0"
+ },
+ "description": "jQuery plugin that makes it easy to support automatically updating fuzzy timestamps (e.g. \"4 minutes ago\" or \"about 1 day ago\").",
+ "keywords": [
+ "time",
+ "microformat"
+ ],
+ "homepage": "http://timeago.yarp.com/",
+ "docs": "https://github.com/rmm5t/jquery-timeago",
+ "demo": "http://timeago.yarp.com/",
+ "download": "http://timeago.yarp.com/jquery.timeago.js",
+ "bugs": "https://github.com/rmm5t/jquery-timeago/issues",
+ "maintainers": []
+}