Import upstream version 1.6.7+git20200616.1.4ada92e
Debian Janitor
1 year, 5 months ago
0 | # Configuration for probot-no-response - https://github.com/probot/no-response | |
1 | ||
2 | # Number of days of inactivity before an Issue is closed for lack of response | |
3 | daysUntilClose: 7 | |
4 | # Label requiring a response | |
5 | responseRequiredLabel: more-information-needed | |
6 | # Comment to post when closing an Issue for lack of response. Set to `false` to disable | |
7 | closeComment: > | |
8 | This issue has been automatically closed because there has been no response | |
9 | to our request for more information from the original author. With only the | |
10 | information that is currently in the issue, we don't have enough information | |
11 | to take action. Please reach out if you have or find the answers we need so | |
12 | that we can investigate further. |
5 | 5 | Timeago is a jQuery plugin that makes it easy to support automatically updating |
6 | 6 | fuzzy timestamps (e.g. "4 minutes ago" or "about 1 day ago") from ISO 8601 |
7 | 7 | formatted dates and times embedded in your HTML (à la microformats). |
8 | ||
9 | --- | |
10 | ||
11 | **How You Can Help** | |
12 | ||
13 | [![Square Cash](http://img.shields.io/badge/square%20cash-$rmm5t-brightgreen.svg)][square] | |
14 | [![PayPal](http://img.shields.io/badge/paypal-rmm5t-blue.svg)][paypal] | |
15 | [![Book a Codementor session](http://img.shields.io/badge/codementor-book%20a%20session-orange.svg)][codementor] | |
16 | ||
17 | If you like this project, [buy me a coffee][paypal], or [book a session with me][codementor], or donate bitcoin: `1rmm5tv6f997JK5bLcGbRCZyVjZUPkQ2m` | |
18 | ||
19 | [square]: https://cash.me/$rmm5t/5 "Donate to rmm5t for open source!" | |
20 | [paypal]: https://www.paypal.me/rmm5t/5 "Donate to rmm5t for open source!" | |
21 | [bitcoin]: bitcoin:1rmm5tv6f997JK5bLcGbRCZyVjZUPkQ2m?amount=0.01&label=Coffee%20to%20rmm5t%20for%20Open%20Source "Buy rmm5t a coffee for open source!" | |
22 | [codementor]: https://www.codementor.io/rmm5t?utm_campaign=profile&utm_source=button-rmm5t&utm_medium=shields "Book a session with rmm5t on Codementor!" | |
23 | ||
24 | [![Twitter](https://img.shields.io/twitter/follow/rmm5t.svg?style=social)](https://twitter.com/rmm5t) | |
25 | [![Stack Overflow](https://img.shields.io/stackexchange/stackoverflow/r/8985.svg?style=social)](http://stackoverflow.com/users/8985/ryan-mcgeary) | |
26 | 8 | |
27 | 9 | ## Usage |
28 | 10 | |
58 | 40 | <time class="timeago" datetime="2011-12-17T09:24:17Z" title="December 17, 2011">about 1 day ago</time> |
59 | 41 | ``` |
60 | 42 | |
61 | `<abbr>` elements are also supported (this is for | |
43 | `<abbr>` elements (or any other HTML elements) are also supported (this is for | |
62 | 44 | [legacy microformat support](http://microformats.org/wiki/datetime-design-pattern) |
63 | 45 | and was originally supported by the library before the `time` element was |
64 | 46 | introduced to HTML5): |
131 | 131 | <p class="how"> |
132 | 132 | To disable timestamps in the past, use the <tt>allowPast</tt> setting. |
133 | 133 | 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. |
134 | The staic message displayed can be configured with the <tt>strings.inPast</tt> setting: | |
134 | The static message displayed can be configured with the <tt>strings.inPast</tt> setting: | |
135 | 135 | </p> |
136 | 136 | <pre> |
137 | 137 | jQuery.timeago.settings.strings.inPast = "time has elapsed"; |
168 | 168 | |
169 | 169 | <h3>What else?</h3> |
170 | 170 | <p class="example"> |
171 | 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: | |
171 | 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 ( or any other HTML element ) is also supported: | |
172 | 172 | </p> |
173 | 173 | <pre> |
174 | 174 | <abbr class="<em>timeago</em>" title="<em>2008-07-17T09:24:17Z</em>">July 17, 2008</abbr></pre> |
50 | 50 | prefixFromNow: null, |
51 | 51 | suffixAgo: "ago", |
52 | 52 | suffixFromNow: "from now", |
53 | inPast: 'any moment now', | |
53 | inPast: "any moment now", | |
54 | 54 | seconds: "less than a minute", |
55 | 55 | minute: "about a minute", |
56 | 56 | minutes: "%d minutes", |
12 | 12 | prefixFromNow: "in", |
13 | 13 | suffixAgo: "", |
14 | 14 | suffixFromNow: "", |
15 | inPast: "jetzt gleich", | |
15 | 16 | seconds: "wenigen Sekunden", |
16 | 17 | minute: "etwa einer Minute", |
17 | 18 | minutes: "%d Minuten", |
0 | (function (factory) { | |
1 | if (typeof define === 'function' && define.amd) { | |
2 | define(['jquery'], factory); | |
3 | } else if (typeof module === 'object' && typeof module.exports === 'object') { | |
4 | factory(require('jquery')); | |
5 | } else { | |
6 | factory(jQuery); | |
7 | } | |
8 | }(function (jQuery) { | |
9 | // English (Template) -> Esperanto | |
10 | jQuery.timeago.settings.strings = { | |
11 | prefixAgo: "antaŭ", | |
12 | prefixFromNow: null, | |
13 | suffixAgo: null, | |
14 | suffixFromNow: "de nun", | |
15 | seconds: "malpli ol minuto", | |
16 | minute: "ĉirkaŭ uno minuto", | |
17 | minutes: "%d minutoj", | |
18 | hour: "ĉirkaŭ uno horo", | |
19 | hours: "ĉirkaŭ %d horojn", | |
20 | day: "ĉirkaŭ tago", | |
21 | days: "%d tagoj", | |
22 | month: "ĉirkaŭ unu monato", | |
23 | months: "%d monatoj", | |
24 | year: "ĉirkaŭ unu jaro", | |
25 | years: "%d jaroj", | |
26 | wordSeparator: " ", | |
27 | numbers: [] | |
28 | }; | |
29 | })); |
6 | 6 | factory(jQuery); |
7 | 7 | } |
8 | 8 | }(function (jQuery) { |
9 | // persion shortened | |
9 | // persian shortened | |
10 | 10 | jQuery.timeago.settings.strings = { |
11 | 11 | prefixAgo: null, |
12 | 12 | prefixFromNow: null, |
0 | (function (factory) { | |
1 | if (typeof define === 'function' && define.amd) { | |
2 | define(['jquery'], factory); | |
3 | } else if (typeof module === 'object' && typeof module.exports === 'object') { | |
4 | factory(require('jquery')); | |
5 | } else { | |
6 | factory(jQuery); | |
7 | } | |
8 | }(function (jQuery) { | |
9 | // English (Template) | |
10 | jQuery.timeago.settings.strings = { | |
11 | prefixAgo: null, | |
12 | prefixFromNow: null, | |
13 | suffixAgo: "ის წინ", | |
14 | suffixFromNow: null, | |
15 | seconds: "რამდენიმე წამ", | |
16 | minute: "1 წუთ", | |
17 | minutes: "%d წუთ", | |
18 | hour: "1 საათ", | |
19 | hours: "%d საათ", | |
20 | day: "1 დღ", | |
21 | days: "%d დღ", | |
22 | month: "1 თვ", | |
23 | months: "%d თვ", | |
24 | year: "1 წლ", | |
25 | years: "%d წლ", | |
26 | wordSeparator: "", | |
27 | }; | |
28 | }) | |
29 | );⏎ |
9 | 9 | // Romanian |
10 | 10 | jQuery.timeago.settings.strings = { |
11 | 11 | prefixAgo: "acum", |
12 | prefixFromNow: "in timp de", | |
12 | prefixFromNow: "peste", | |
13 | 13 | suffixAgo: "", |
14 | 14 | suffixFromNow: "", |
15 | seconds: "mai putin de un minut", | |
15 | seconds: "mai puțin de un minut", | |
16 | 16 | minute: "un minut", |
17 | 17 | minutes: "%d minute", |
18 | hour: "o ora", | |
18 | hour: "o oră", | |
19 | 19 | hours: "%d ore", |
20 | 20 | day: "o zi", |
21 | 21 | days: "%d zile", |
22 | month: "o luna", | |
22 | month: "o lună", | |
23 | 23 | months: "%d luni", |
24 | 24 | year: "un an", |
25 | 25 | years: "%d ani" |
160 | 160 | <li><abbr id="testLatinSettings20" class="tolatin" title="31622400"></abbr> [366 days]</li> |
161 | 161 | <li><abbr id="testLatinSettings21" class="tolatin" title="94608000"></abbr> [1095 days]</li> |
162 | 162 | |
163 | <li><abbr id="testPolishSettings1" class="topolish" title="-7200"></abbr> [-120 min]</li> | |
164 | <li><abbr id="testPolishSettings2" class="topolish" title="-60"></abbr> [-60 sec]</li> | |
165 | <li><abbr id="testPolishSettings3" class="topolish" title="-30"></abbr> [-30 sec]</li> | |
166 | <li><abbr id="testPolishSettings4" class="topolish" title="-1"></abbr> [-1 sec]</li> | |
167 | <li><abbr id="testPolishSettings5" class="topolish" title="0"></abbr> [0 sec]</li> | |
168 | <li><abbr id="testPolishSettings6" class="topolish" title="30"></abbr> [30 sec]</li> | |
169 | <li><abbr id="testPolishSettings7" class="topolish" title="45"></abbr> [45 sec]</li> | |
170 | <li><abbr id="testPolishSettings8" class="topolish" title="90"></abbr> [90 sec]</li> | |
171 | <li><abbr id="testPolishSettings9" class="topolish" title="120"></abbr> [120 sec]</li> | |
172 | <li><abbr id="testPolishSettings10" class="topolish" title="2700"></abbr> [45 min]</li> | |
173 | <li><abbr id="testPolishSettings11" class="topolish" title="5340"></abbr> [89 min]</li> | |
174 | <li><abbr id="testPolishSettings12" class="topolish" title="5400"></abbr> [90 min]</li> | |
175 | <li><abbr id="testPolishSettings13" class="topolish" title="7200"></abbr> [120 min]</li> | |
176 | <li><abbr id="testPolishSettings14" class="topolish" title="82800"></abbr> [1380 min]</li> | |
177 | <li><abbr id="testPolishSettings15" class="topolish" title="90000"></abbr> [25 hours]</li> | |
178 | <li><abbr id="testLatinSettings16" class="topolish" title="172800"></abbr> [48 hours]</li> | |
179 | <li><abbr id="testPolishSettings17" class="topolish" title="2505600"></abbr> [696 hours]</li> | |
180 | <li><abbr id="testPolishSettings18" class="topolish" title="2592000"></abbr> [30 days]</li> | |
181 | <li><abbr id="testPolishSettings19" class="topolish" title="16416000"></abbr> [190 days]</li> | |
182 | <li><abbr id="testPolishSettings20" class="topolish" title="31622400"></abbr> [366 days]</li> | |
183 | <li><abbr id="testPolishSettings21" class="topolish" title="94608000"></abbr> [1095 days]</li> | |
184 | ||
163 | 185 | <li><abbr id="testRussianSettings1" class="torussian" title="-7200"></abbr> [-120 min]</li> |
164 | 186 | <li><abbr id="testRussianSettings2" class="torussian" title="-60"></abbr> [-60 sec]</li> |
165 | 187 | <li><abbr id="testRussianSettings3" class="torussian" title="-30"></abbr> [-30 sec]</li> |
315 | 337 | loadBelarusian(); |
316 | 338 | $("abbr.tobelarusian").each(toWords); |
317 | 339 | |
340 | loadPolish(); | |
341 | $("abbr.topolish").each(toWords); | |
342 | ||
318 | 343 | module("Valid date"); |
319 | 344 | |
320 | 345 | test("Text in abbr tag should be replaced", function () { |
585 | 610 | ok($("#testRussianSettings5").html().match(/назад$/), "Settings correctly applied"); |
586 | 611 | ok($("#testBelarusianSettings5").html().match(/таму$/), "Settings correctly applied"); |
587 | 612 | ok($("#testMillisSettings5").html().match(/ago/), "Settings correctly applied"); |
613 | ok($("#testPolishSettings5").html().match(/temu/), "Settings correctly applied"); | |
588 | 614 | }); |
589 | 615 | |
590 | 616 | test("prefixFromNow", function () { |
591 | 617 | ok($("#testRussianSettings2").html().match(/^через/), "Settings correctly applied"); |
592 | 618 | ok($("#testBelarusianSettings2").html().match(/^праз/), "Settings correctly applied"); |
619 | ok($("#testPolishSettings2").html().match(/za/), "Settings correctly applied"); | |
593 | 620 | }); |
594 | 621 | |
595 | 622 | test("seconds", function () { |
50 | 50 | year: "about-hay a-hay ear-yay", |
51 | 51 | years: "%d years-yay" |
52 | 52 | }; |
53 | } | |
54 | ||
55 | function loadPolish() { | |
56 | (function () { | |
57 | // Polish | |
58 | function numpf(n, s, t) { | |
59 | // s - 2-4, 22-24, 32-34 ... | |
60 | // t - 5-21, 25-31, ... | |
61 | var n10 = n % 10; | |
62 | if ( (n10 > 1) && (n10 < 5) && ( (n > 20) || (n < 10) ) ) { | |
63 | return s; | |
64 | } else { | |
65 | return t; | |
66 | } | |
67 | } | |
68 | ||
69 | jQuery.timeago.settings.strings = { | |
70 | prefixAgo: null, | |
71 | prefixFromNow: "za", | |
72 | suffixAgo: "temu", | |
73 | suffixFromNow: null, | |
74 | seconds: "mniej niż minutę", | |
75 | minute: "minutę", | |
76 | minutes: function(value) { return numpf(value, "%d minuty", "%d minut"); }, | |
77 | hour: "godzinę", | |
78 | hours: function(value) { return numpf(value, "%d godziny", "%d godzin"); }, | |
79 | day: "dzień", | |
80 | days: "%d dni", | |
81 | month: "miesiąc", | |
82 | months: function(value) { return numpf(value, "%d miesiące", "%d miesięcy"); }, | |
83 | year: "rok", | |
84 | years: function(value) { return numpf(value, "%d lata", "%d lat"); } | |
85 | }; | |
86 | })(); | |
53 | 87 | } |
54 | 88 | |
55 | 89 | function loadRussian() { |