{"id":18355882,"url":"https://github.com/anduin2017/jquery-utc-time","last_synced_at":"2025-04-10T01:46:10.101Z","repository":{"id":33685944,"uuid":"154154814","full_name":"Anduin2017/jquery-utc-time","owner":"Anduin2017","description":"A jQuery plugin which converts UTC time to local time easily.","archived":false,"fork":false,"pushed_at":"2025-01-02T17:44:23.000Z","size":436,"stargazers_count":5,"open_issues_count":13,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-01T23:35:52.537Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://developer.aiursoft.com/Samples/UTCTime","language":"HTML","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/Anduin2017.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":"2018-10-22T14:05:33.000Z","updated_at":"2024-10-08T09:50:59.000Z","dependencies_parsed_at":"2023-11-24T05:24:46.760Z","dependency_job_id":"77c27d70-0392-4f80-ad01-839975133c1e","html_url":"https://github.com/Anduin2017/jquery-utc-time","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Anduin2017%2Fjquery-utc-time","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Anduin2017%2Fjquery-utc-time/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Anduin2017%2Fjquery-utc-time/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Anduin2017%2Fjquery-utc-time/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Anduin2017","download_url":"https://codeload.github.com/Anduin2017/jquery-utc-time/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248142531,"owners_count":21054665,"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-05T22:08:15.270Z","updated_at":"2025-04-10T01:46:10.072Z","avatar_url":"https://github.com/Anduin2017.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# jQuery-UTC-time\n\nA jquery plugin which converts UTC time to local time easily.\n\n[![npm](https://img.shields.io/npm/v/jquery-utc-time.svg?style=flat)](https://www.npmjs.com/package/jquery-utc-time)\n[![ManHours](https://manhours.aiursoft.cn/r/gitlab.aiursoft.cn/anduin/jQuery-UTC-time.svg)](https://gitlab.aiursoft.cn/anduin/jQuery-UTC-time/-/commits/master?ref_type=heads)\n\n## How to install\n\n### Download from NPM\n\n```bash\nnpm install jquery-utc-time\n```\n\nAnd add your reference:\n\n```html\n\u003cscript src=\"node_modules/jquery/dist/jquery.min.js\"\u003e\u003c/script\u003e\n\u003cscript src=\"node_modules/jquery-utc-time/dist/jquery-utc-time.min.js\"\u003e\u003c/script\u003e\n```\n\nOr using es6:\n\n```javascript\nimport UtcTime from 'jquery-utc-time';\n```\n\n### Use via CDN\n\nAdd your reference:\n\n```html\n\u003cscript src=\"https://ui.cdn.aiursoft.com/node_modules/jquery-utc-time/dist/jquery-utc-time.min.js\"\u003e\u003c/script\u003e\n```\n\n## How to use\n\nCreate an element.\n\n```html\n\u003cp\u003e\n\n\u003c/p\u003e\n```\n\nAnd change it like this.\n\n```html\n\u003cp data-utc-time=\"9/12/2018 10:12:24 AM\"\u003e\u003c!-- In your tag the time shall be an UTC time --\u003e\n  \n\u003c/p\u003e\n```\n\nAdd init jquery-utc-time\n\n```html\n\u003cscript\u003e\n    new UtcTime({ });\n\u003c/script\u003e\n```\n\nAnd open it now! The time will be converted to local time.\n\n## API\n\n```javascript\n    // Init with loop\n    new UtcTime({\n        // We will try to select elements using the attr value. Default value is 'data-utc-time'.\n        attr: 'data-utc-time',\n\n        // We the given time is later than now, we will replace the value to its local time using the format. If format is not specified, we will just convert it to local string.\n        format: 'yyyy年 MM月 dd日 hh:mm:ss',\n\n        // Localization options. Default is ' days ago'\n        daysAgo: '天前',\n\n        // Localization options. Default is ' hours ago'\n        hoursAgo: '小时前',\n\n        // Localization options. Default is ' mintes ago'\n        minutesAgo: '分钟前',\n\n        // Localization options. Default is ' seconds ago'\n        secondsAgo: '秒前',\n\n        // Always display time and date not `some time` ago.\n        disableAgo: false,\n\n        // After the content is replaced.\n        onSet: function(element) { },\n\n        // Disable auto update the value by seconds.\n        disableAutoUpdate: false\n    });\n```\n\nFor example, to init bootstrap tooltip:\n\n```javascript\nnew UtcTime({\n    onSet: function(element) {\n        $(element).tooltip();\n    }\n});\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanduin2017%2Fjquery-utc-time","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanduin2017%2Fjquery-utc-time","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanduin2017%2Fjquery-utc-time/lists"}