{"id":18137929,"url":"https://github.com/shaobeichen/friendlytimejs","last_synced_at":"2025-04-19T17:44:12.302Z","repository":{"id":57241855,"uuid":"135526892","full_name":"shaobeichen/friendlytimejs","owner":"shaobeichen","description":":watch: 人性化时间/友好时间的插件，将一个时间字符串格式（yyyy-MM-dd HH:mm:ss）显示友好时间（如，1分钟内，2分钟前等等）。","archived":false,"fork":false,"pushed_at":"2018-06-06T02:48:58.000Z","size":6,"stargazers_count":10,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-29T11:04:23.371Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shaobeichen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-05-31T03:28:07.000Z","updated_at":"2021-11-04T03:44:52.000Z","dependencies_parsed_at":"2022-09-15T08:32:30.694Z","dependency_job_id":null,"html_url":"https://github.com/shaobeichen/friendlytimejs","commit_stats":null,"previous_names":["leachzhou/friendlytimejs"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shaobeichen%2Ffriendlytimejs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shaobeichen%2Ffriendlytimejs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shaobeichen%2Ffriendlytimejs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shaobeichen%2Ffriendlytimejs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shaobeichen","download_url":"https://codeload.github.com/shaobeichen/friendlytimejs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249751787,"owners_count":21320375,"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":[],"created_at":"2024-11-01T15:07:42.692Z","updated_at":"2025-04-19T17:44:12.283Z","avatar_url":"https://github.com/shaobeichen.png","language":"JavaScript","readme":"# friendlytime.js\n\n\u003e 友好时间的插件，将一个时间字符串格式（如2018-05-31 11:30:00）显示友好时间（如，1分钟内，2分钟前等等）。\n\n## 快速开始\n### 安装\n\n```console\nnpm i friendlytimejs --save\n```\n\n### 使用\n```js\nimport friendlytimejs from \"friendlytimejs\";\n/**\n * @param str 指定的时间字符串，如yyyy-MM-dd HH:mm:ss\n * @param now 当前时间，允许时间戳，GMT时间。\n */\nfriendlytimejs.FriendlyTime('2018-06-04 13:20:00','2018-06-04 13:25:00');\n```\n推荐搭配使用[day.js](https://github.com/iamkun/dayjs)。如果你使用了day.js，那么过程即为\n- 安装\n```console\nnpm i friendlytimejs --save\nnpm i dayjs --save\n```\n- 使用\n```js\nimport dayjs from \"dayjs\";\nimport friendlytimejs from \"friendlytimejs\";\n/**\n * @param str 指定的时间字符串，如yyyy-MM-dd HH:mm:ss\n * @param now 当前时间，允许时间戳，GMT时间。\n */\nfriendlytimejs.FriendlyTime('2018-06-04 13:20:00',dayjs());\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshaobeichen%2Ffriendlytimejs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshaobeichen%2Ffriendlytimejs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshaobeichen%2Ffriendlytimejs/lists"}