{"id":25468063,"url":"https://github.com/martinandert/react-ago-component","last_synced_at":"2026-03-05T23:43:26.793Z","repository":{"id":14277550,"uuid":"16985554","full_name":"martinandert/react-ago-component","owner":"martinandert","description":"A component for React that renders the approximate time ago in words from a specific past date using an HTML5 time element.","archived":false,"fork":false,"pushed_at":"2017-12-11T07:59:45.000Z","size":64,"stargazers_count":25,"open_issues_count":0,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-13T10:37:33.780Z","etag":null,"topics":["ago","counterpart","date","elapsed","javascript","react","react-component","time"],"latest_commit_sha":null,"homepage":"","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/martinandert.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-02-19T13:48:51.000Z","updated_at":"2020-07-04T19:14:55.000Z","dependencies_parsed_at":"2022-08-19T17:40:48.598Z","dependency_job_id":null,"html_url":"https://github.com/martinandert/react-ago-component","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martinandert%2Freact-ago-component","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martinandert%2Freact-ago-component/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martinandert%2Freact-ago-component/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martinandert%2Freact-ago-component/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/martinandert","download_url":"https://codeload.github.com/martinandert/react-ago-component/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239430293,"owners_count":19637438,"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":["ago","counterpart","date","elapsed","javascript","react","react-component","time"],"created_at":"2025-02-18T07:37:50.546Z","updated_at":"2025-11-04T09:30:30.433Z","avatar_url":"https://github.com/martinandert.png","language":"JavaScript","funding_links":[],"categories":["Awesome React"],"sub_categories":["Tools"],"readme":"# React Ago Component\n\nA multi-lingual component for [React][1] that renders the approximate time ago in words from a specific past date using an HTML5 time element. \n\nFeatures:\n\n* configurable to auto-update its display as time passes by\n* supports localized output (with the help of [Counterpart][2] and [Damals][3])\n\n\n## Installation\n\nInstall via npm:\n\n```bash\n% npm install react-ago-component\n```\n\n\n## Usage\n\nJust require and render:\n\n```js\nvar Ago  = require('react-ago-component');\nvar then = new Date('Sat Mar 06 1976 04:05:09 GMT+0100 (CET)');\n\n// render component with\nAgo({ date: then });  // JSX: \u003cAgo date={then} /\u003e\n```\n\nThis will output something in the likes of\n\n```html\n\u003ctime datetime=\"1976-03-06T04:05:09+01:00\" title=\"Sat, 6 Mar 1976 04:05\"\u003eabout 38 years ago\u003c/time\u003e\n```\n\nThe `date` prop can be set to a Date object, a number holding the milliseconds since Unix epoch, or to a string (which will be parsed as a Date).\n\nThere is also a `tooltipFormat` prop to configure the verbosity of the HTML title attribute. Valid values are \"short\", \"long\", and \"default\" (somewhere in-between).\n\nIf you want your page to auto-update the visible portion of the rendered HTML element as time passes by, just set the `autoUpdate` prop to `true`. You can also provide an update interval (in seconds) by setting the prop's value to a natural number greater than `0`.\n\n## Localization Support\n\nTo localize the rendered output for a locale other than \"en\" (English), load the corresponding translations and set the locale using [Counterpart][2] and [Damals][3]:\n\n```js\ncounterpart.registerTranslations('de', require('counterpart/locales/de'));\ncounterpart.registerTranslations('de', require('damals/locales/de'));\n\ncounterpart.setLocale('de');\n```\n\nWhen switching locales the Ago component will auto-adjust its output (no page reloading necessary).\n\n\n## Example\n\nThe examples code is located at the `example` directory. You can clone this repository and run `make install example` and point your web browser to\n`http://localhost:3000`.\n\n\n## Contributing\n\nHere's a quick guide:\n\n1. Fork the repo and `make install`.\n\n2. Run the tests. We only take pull requests with passing tests, and it's great to know that you have a clean slate: `make test`.\n\n3. Add a test for your change. Only refactoring and documentation changes require no new tests. If you are adding functionality or are fixing a bug, we need a test!\n\n4. Make the test pass.\n\n5. Push to your fork and submit a pull request.\n\n\n## Licence\n\nReleased under The MIT License.\n\n\n\n[1]: http://facebook.github.io/react/\n[2]: https://github.com/martinandert/counterpart\n[3]: https://github.com/martinandert/damals\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmartinandert%2Freact-ago-component","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmartinandert%2Freact-ago-component","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmartinandert%2Freact-ago-component/lists"}