{"id":13408239,"url":"https://github.com/hustcc/timeago-react","last_synced_at":"2025-05-16T03:04:49.092Z","repository":{"id":10272277,"uuid":"65169393","full_name":"hustcc/timeago-react","owner":"hustcc","description":":clock8: Simple and efficient react component to format date with `*** time ago` statement. eg: '3 hours ago'.","archived":false,"fork":false,"pushed_at":"2025-04-30T17:42:01.000Z","size":1569,"stargazers_count":430,"open_issues_count":3,"forks_count":23,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-05-10T14:19:21.575Z","etag":null,"topics":["date-format","javascript","react-component","react-timeago","timeago","timeago-react"],"latest_commit_sha":null,"homepage":"https://git.hust.cc/timeago-react","language":"TypeScript","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/hustcc.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-08-08T03:23:03.000Z","updated_at":"2025-04-28T21:52:31.000Z","dependencies_parsed_at":"2024-06-18T12:38:16.537Z","dependency_job_id":"9bb64ace-4e76-48fe-bc15-a7fc27bd36f3","html_url":"https://github.com/hustcc/timeago-react","commit_stats":{"total_commits":56,"total_committers":16,"mean_commits":3.5,"dds":0.7321428571428572,"last_synced_commit":"cd5897689b69d3190735c9d59d314a75706d5bb7"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hustcc%2Ftimeago-react","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hustcc%2Ftimeago-react/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hustcc%2Ftimeago-react/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hustcc%2Ftimeago-react/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hustcc","download_url":"https://codeload.github.com/hustcc/timeago-react/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254459088,"owners_count":22074605,"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":["date-format","javascript","react-component","react-timeago","timeago","timeago-react"],"created_at":"2024-07-30T20:00:51.613Z","updated_at":"2025-05-16T03:04:44.082Z","avatar_url":"https://github.com/hustcc.png","language":"TypeScript","readme":"# timeago-react\n\n\n\u003e timeago-react is a simple react component used to format date with `*** time ago` statement. eg: '3 hours ago'.\n\n**The component based on [timeago.js](https://github.com/hustcc/timeago.js)** which is a simple javascript module.\n\n - Realtime render. Automatic release the resources.\n - Simple. Only 2kb.\n - Efficient. When the time is `3 hour ago`, the interval will an hour (3600 * 1000 ms).\n - Locales supported.\n\n[![npm](https://img.shields.io/npm/v/timeago-react.svg)](https://www.npmjs.com/package/timeago-react)\n[![build](https://github.com/hustcc/timeago-react/workflows/ci/badge.svg)](https://github.com/hustcc/timeago-react)\n[![demo](https://github.com/hustcc/timeago-react/workflows/demo/badge.svg)](https://github.com/hustcc/timeago-react)\n[![npm](https://img.shields.io/npm/dm/timeago-react.svg)](https://www.npmjs.com/package/timeago-react)\n[![react supported](https://img.shields.io/badge/React-%5E0.14.0%20%7C%7C%20%5E15.0.0%20%7C%7C%20%5E16.0.0%20%7C%7C%20%5E17.0.0%20%7C%7C%20%5E18.0.0%20%7C%7C%20%5E19.0.0-blue.svg)](https://github.com/hustcc/timeago-react)\n[![npm](https://img.shields.io/npm/l/timeago-react.svg)](https://www.npmjs.com/package/timeago-react)\n\n\n## Install\n\n\u003e **npm install timeago-react**\n\n\n## Usage\n\n```jsx\nimport * as React from 'react';\nimport TimeAgo from 'timeago-react'; // var TimeAgo = require('timeago-react');\n\n\u003cTimeAgo\n  datetime={'2016-08-08 08:08:08'}\n  locale='zh_CN'\n/\u003e\n```\n\n\n## Component props\n\n - **`datetime`** (required, string / Date / timestamp)\n\nThe datetime to be formatted. can be `datetime string`, `Date instance`, or `timestamp`.\n\n - **`live`** (optional, boolean)\n\nLive render, default is `true`.\n\n - **`className`** (optional, string)\n\nThe `class` of span. you can setting the css style of span by class name.\n\n - **`opts.relativeDate`** (optional, string / Date / timestamp)\n\nThe datetime to be calculated interval relative to.\n\n - **`opts.minInterval`** (optional, number in seconds)\n\nThe min interval in seconds to update the ** time ago string\n\n- **`locale`** (optional, string)\n\nThe `locale` language of statement, default is `en`. All supported locales [here](https://github.com/hustcc/timeago.js/tree/master/src/lang). If you want to use locale which is not `zh_CN` / `en`, you should import the locale before use it. As below:\n\n```jsx\nimport * as React from 'react';\nimport TimeAgo from 'timeago-react';\nimport * as timeago from 'timeago.js';\n\n// import it first.\nimport vi from 'timeago.js/lib/lang/vi';\n\n// register it.\ntimeago.register('vi', vi);\n\n// then use it.\n\u003cTimeAgo\n  datetime={'2016-08-08 08:08:08'}\n  locale='vi'\n/\u003e\n```\n\n - **`style`** (optional, object)\n\nThe `style` object to applied to the root element.\n\nProps not documented above are applied to the root element.\n\n\n## LICENSE\n\nMIT\n","funding_links":[],"categories":["UI Components","Demos","\u003csummary\u003eUI Components\u003c/summary\u003e","Repository","TypeScript"],"sub_categories":["Time / Date / Age","Date \u0026 Time"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhustcc%2Ftimeago-react","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhustcc%2Ftimeago-react","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhustcc%2Ftimeago-react/lists"}