{"id":13394496,"url":"https://github.com/rmm5t/jquery-timeago","last_synced_at":"2025-05-14T09:06:18.094Z","repository":{"id":415669,"uuid":"35219","full_name":"rmm5t/jquery-timeago","owner":"rmm5t","description":":clock8: The original jQuery plugin that makes it easy to support automatically updating fuzzy timestamps (e.g. \"4 minutes ago\").","archived":false,"fork":false,"pushed_at":"2025-05-10T15:12:57.000Z","size":444,"stargazers_count":3813,"open_issues_count":44,"forks_count":708,"subscribers_count":98,"default_branch":"master","last_synced_at":"2025-05-14T09:02:51.996Z","etag":null,"topics":["jquery","time","timeago"],"latest_commit_sha":null,"homepage":"http://timeago.yarp.com","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rmm5t.png","metadata":{"files":{"readme":"README.markdown","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["rmm5t"],"custom":"https://www.paypal.me/rmm5t/5"}},"created_at":"2008-07-18T15:29:49.000Z","updated_at":"2025-05-10T22:08:17.000Z","dependencies_parsed_at":"2022-08-16T10:25:10.042Z","dependency_job_id":"f4b92f06-7d70-47c5-92ea-684dc459a94d","html_url":"https://github.com/rmm5t/jquery-timeago","commit_stats":{"total_commits":368,"total_committers":117,"mean_commits":"3.1452991452991452","dds":0.6929347826086957,"last_synced_commit":"4ada92ea44bf60fff3acd966f7b1c3194370499c"},"previous_names":[],"tags_count":49,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rmm5t%2Fjquery-timeago","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rmm5t%2Fjquery-timeago/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rmm5t%2Fjquery-timeago/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rmm5t%2Fjquery-timeago/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rmm5t","download_url":"https://codeload.github.com/rmm5t/jquery-timeago/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254110373,"owners_count":22016391,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["jquery","time","timeago"],"created_at":"2024-07-30T17:01:21.650Z","updated_at":"2025-05-14T09:06:18.069Z","avatar_url":"https://github.com/rmm5t.png","language":"JavaScript","funding_links":["https://github.com/sponsors/rmm5t","https://www.paypal.me/rmm5t/5"],"categories":["JavaScript","Date","Framework or Library","Date [🔝](#readme)","日期","Animation"],"sub_categories":["Runner","Date","运行器","Time and Date","运行器e2e测试"],"readme":"# timeago: a jQuery plugin\n\n[![NPM](https://img.shields.io/npm/v/timeago.svg)](https://www.npmjs.com/package/timeago)\n[![Bower](https://img.shields.io/bower/v/jquery-timeago.svg)](http://bower.io/search/?q=jquery-timeago)\n\nTimeago is a jQuery plugin that makes it easy to support automatically updating\nfuzzy timestamps (e.g. \"4 minutes ago\" or \"about 1 day ago\") from ISO 8601\nformatted dates and times embedded in your HTML (à la microformats).\n\n## Usage\n\nFirst, load jQuery and the plugin:\n\n```html\n\u003cscript src=\"jquery.min.js\" type=\"text/javascript\"\u003e\u003c/script\u003e\n\u003cscript src=\"jquery.timeago.js\" type=\"text/javascript\"\u003e\u003c/script\u003e\n```\n\nNow, let's attach it to your timestamps on DOM ready - put this in the head\nsection:\n\n```html\n\u003cscript type=\"text/javascript\"\u003e\n   jQuery(document).ready(function() {\n     $(\"time.timeago\").timeago();\n   });\n\u003c/script\u003e\n```\n\nThis will turn all `\u003ctime\u003e` elements with a class of `timeago` and a\n`datetime` attribute formatted according to the\n[ISO 8601](http://en.wikipedia.org/wiki/ISO_8601) standard:\n\n```html\n\u003ctime class=\"timeago\" datetime=\"2011-12-17T09:24:17Z\"\u003eDecember 17, 2011\u003c/time\u003e\n```\n\ninto something like this:\n\n```html\n\u003ctime class=\"timeago\" datetime=\"2011-12-17T09:24:17Z\" title=\"December 17, 2011\"\u003eabout 1 day ago\u003c/time\u003e\n```\n\n`\u003cabbr\u003e` elements (or any other HTML elements) are also supported (this is for\n[legacy microformat support](http://microformats.org/wiki/datetime-design-pattern)\nand was originally supported by the library before the `time` element was\nintroduced to HTML5):\n\n```html\n\u003cabbr class=\"timeago\" title=\"2011-12-17T09:24:17Z\"\u003eDecember 17, 2011\u003c/abbr\u003e\n```\n\nAs time passes, the timestamps will automatically update.\n\nIf you want to update a timestamp programatically later, call the `update`\nfunction with a new ISO8601 timestamp of `Date` object. For example:\n\n```javascript\n$(\"time#some_id\").timeago(\"update\", \"2013-12-17T09:24:17Z\");\n// or\n$(\"time#some_id\").timeago(\"update\", new Date());\n```\n\n**For more usage and examples**: [http://timeago.yarp.com/](http://timeago.yarp.com/)\n\n**For different language configurations**: visit the [`locales`](https://github.com/rmm5t/jquery-timeago/tree/master/locales) directory.\n\n## Settings\n\n**`cutoff`** : Return the original date if time distance is older than `cutoff` (miliseconds).\n\n```javascript\n// Display original dates older than 24 hours\njQuery.timeago.settings.cutoff = 1000*60*60*24;\n```\n\n## Changes\n\n| Version | Notes                                                                           |\n|---------|---------------------------------------------------------------------------------|\n|   1.6.x | ([compare][compare-1.6]) Wraped locales in UMD wrappers; locale improvements    |\n|   1.5.x | ([compare][compare-1.5]) Added Date as argument to update function; locales     |\n|   1.4.x | ([compare][compare-1.4]) Added allowPast setting; locale updates                |\n|   1.3.x | ([compare][compare-1.3]) Added updateFromDOM function; bug fixes; bower support |\n|   1.2.x | ([compare][compare-1.2]) Added cutoff setting; locale updates                   |\n|   1.1.x | ([compare][compare-1.1]) Added update function; locale updates                  |\n|   1.0.x | ([compare][compare-1.0]) locale updates; bug fixes; AMD wrapper                 |\n|  0.11.x | ([compare][compare-0.11]) natural rounding; locale updates;                     |\n|  0.10.x | ([compare][compare-0.10]) locale updates                                        |\n|   0.9.x | ([compare][compare-0.9]) microsecond support; bug fixes                         |\n|   0.8.x | ([compare][compare-0.8]) `\u003ctime\u003e` element support; bug fixes                    |\n|   0.7.x | ([compare][compare-0.7]) locale function overrides; unit tests                  |\n|     ... | ...                                                                             |\n\n[compare-1.6]: https://github.com/rmm5t/jquery-timeago/compare/v1.5.4...v1.6.7\n[compare-1.5]: https://github.com/rmm5t/jquery-timeago/compare/v1.4.3...v1.5.4\n[compare-1.4]: https://github.com/rmm5t/jquery-timeago/compare/v1.3.2...v1.4.3\n[compare-1.3]: https://github.com/rmm5t/jquery-timeago/compare/v1.2.0...v1.3.2\n[compare-1.2]: https://github.com/rmm5t/jquery-timeago/compare/v1.1.0...v1.2.0\n[compare-1.1]: https://github.com/rmm5t/jquery-timeago/compare/v1.0.2...v1.1.0\n[compare-1.0]: https://github.com/rmm5t/jquery-timeago/compare/v0.11.4...v1.0.2\n[compare-0.11]: https://github.com/rmm5t/jquery-timeago/compare/v0.10.1...v0.11.4\n[compare-0.10]: https://github.com/rmm5t/jquery-timeago/compare/v0.9.3...v0.10.1\n[compare-0.9]: https://github.com/rmm5t/jquery-timeago/compare/v0.8.2...v0.9.3\n[compare-0.8]: https://github.com/rmm5t/jquery-timeago/compare/v0.7.2...v0.8.2\n[compare-0.7]: https://github.com/rmm5t/jquery-timeago/compare/v0.6.2...v0.7.2\n\n## Author\n\n[Ryan McGeary](http://ryan.mcgeary.org) ([@rmm5t](http://twitter.com/rmm5t))\n\n## License\n\n[MIT License](https://rmm5t.mit-license.org/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frmm5t%2Fjquery-timeago","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frmm5t%2Fjquery-timeago","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frmm5t%2Fjquery-timeago/lists"}