{"_id":"@aiursoft/utctime.js","_rev":"7-6ecd553442ba9540a303fd1721dfcd43","name":"@aiursoft/utctime.js","dist-tags":{"latest":"1.0.6"},"versions":{"1.0.0":{"name":"@aiursoft/utctime.js","version":"1.0.0","author":{"name":"Anduin Xue","email":"anduin@aiursoft.com"},"license":"MIT","_id":"@aiursoft/utctime.js@1.0.0","maintainers":[{"name":"anduin2017","email":"Anduin@aiursoft.com"}],"dist":{"shasum":"5086f287c7719314e18abf78932ce243fb689936","tarball":"https://registry.npmjs.org/@aiursoft/utctime.js/-/utctime.js-1.0.0.tgz","fileCount":11,"integrity":"sha512-5eeeMj9mfhbfHnFmZcuo9RUcVLs2jCybh1xZXC7KkiHlFDwaINOebK50Wtnb9uRp5BU8FhqorTV89sGY6ohnHA==","signatures":[{"sig":"MEUCIFHclAa88+FA6V/mXtWExA6vvCCbOjfuH/pitTHp3GfeAiEAv6O5Mo1x3CZJ7ph2Firpjo5Owpsbb7XvOif6cpM9IJU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":14871},"main":"dist/cjs/utctime.js","types":"dist/types/utctime.d.ts","module":"dist/esm/utctime.js","gitHead":"0a92801c40642e5f4fcb708e4e1dcb7b5719b0fb","scripts":{"lint":"eslint src/ --ext .ts && prettier --check .","build":"npm run build-js","clean":"rm -rf ./dist","format":"prettier --write .","build-js":"tsc -b ./tsconfig.json ./tsconfig.types.json"},"_npmUser":{"name":"anduin2017","email":"Anduin@aiursoft.com"},"repository":{"url":"https://gitlab.aiursoft.cn/aiursoft/utctime.js","type":"git"},"_npmVersion":"9.8.0","description":"Auto utc time","directories":{},"_nodeVersion":"20.5.1","dependencies":{"bootstrap":"^4.6.2"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^8.56.0","esbuild":"^0.19.11","prettier":"^3.1.1","node-sass":"^9.0.0","typescript":"^5.3.3","@typescript-eslint/parser":"^6.16.0","@typescript-eslint/eslint-plugin":"^6.16.0"},"_npmOperationalInternal":{"tmp":"tmp/utctime.js_1.0.0_1704118879429_0.025680972673457703","host":"s3://npm-registry-packages"}},"1.0.1":{"name":"@aiursoft/utctime.js","version":"1.0.1","author":{"name":"Anduin Xue","email":"anduin@aiursoft.com"},"license":"MIT","_id":"@aiursoft/utctime.js@1.0.1","maintainers":[{"name":"anduin2017","email":"Anduin@aiursoft.com"}],"dist":{"shasum":"747d5c0f779358952354aadd0082a3219d608a88","tarball":"https://registry.npmjs.org/@aiursoft/utctime.js/-/utctime.js-1.0.1.tgz","fileCount":11,"integrity":"sha512-3bbSun/rMJ+29xotllhpyGBqWcD+SybHvLbN+teOC+mjXy++oWaCumog9LTjKTDYTVNiszdnxJVJKyyCsDWgLA==","signatures":[{"sig":"MEYCIQDizsIfDcyamuVX43kHa6H8nrsqn4VdqJt6b5VyqJmfXQIhAMfuJ6AQmx3aEegBJsh78toe1cCw+CoqWz8E9Yf8aoXl","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":17420},"main":"dist/cjs/utctime.js","types":"dist/types/utctime.d.ts","module":"dist/esm/utctime.js","gitHead":"83883b23e3a089100681fd8b2a21cb48bf153f06","scripts":{"lint":"eslint src/ --ext .ts && prettier --check .","build":"npm run build-js","clean":"rm -rf ./dist","format":"prettier --write .","build-js":"tsc -b ./tsconfig.json ./tsconfig.types.json"},"_npmUser":{"name":"anduin2017","email":"Anduin@aiursoft.com"},"repository":{"url":"https://gitlab.aiursoft.cn/aiursoft/utctime.js","type":"git"},"_npmVersion":"9.8.0","description":"Auto utc time","directories":{},"_nodeVersion":"20.5.1","_hasShrinkwrap":false,"devDependencies":{"eslint":"^8.56.0","esbuild":"^0.19.11","prettier":"^3.1.1","typescript":"^5.3.3","@typescript-eslint/parser":"^6.16.0","@typescript-eslint/eslint-plugin":"^6.16.0"},"_npmOperationalInternal":{"tmp":"tmp/utctime.js_1.0.1_1709802262581_0.29459525323792235","host":"s3://npm-registry-packages"}},"1.0.2":{"name":"@aiursoft/utctime.js","version":"1.0.2","author":{"name":"Anduin Xue","email":"anduin@aiursoft.com"},"license":"MIT","_id":"@aiursoft/utctime.js@1.0.2","maintainers":[{"name":"anduin2017","email":"Anduin@aiursoft.com"}],"dist":{"shasum":"18af6c2a98750d85ec9aaf9fb1c176b0817d14ff","tarball":"https://registry.npmjs.org/@aiursoft/utctime.js/-/utctime.js-1.0.2.tgz","fileCount":11,"integrity":"sha512-W1h7qYNRiOvtnDqyXCP062zMmw/4N13+IpBJ0ZDMNmrsqPMe2Oq6zfHTQXWuuN55Z2Txrd8CQPWZOLLuqLq0Aw==","signatures":[{"sig":"MEUCIQDyu/bCcXzR0W/v+jYqRVstGhV5xtpOBGMctSzQZyO3lQIgOV20CcokVI15x89qw7uLz4m+pyZ8AdvZb2HhYC/WQNg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":15970},"main":"dist/cjs/utctime.js","types":"dist/types/utctime.d.ts","module":"dist/esm/utctime.js","gitHead":"85c111bb72e270701eeb7e2011ab1f6a0ab42e39","scripts":{"lint":"eslint src/ --ext .ts && prettier --check .","build":"npm run build-js","clean":"rm -rf ./dist","format":"prettier --write .","build-js":"tsc -b ./tsconfig.json ./tsconfig.types.json"},"_npmUser":{"name":"anduin2017","email":"Anduin@aiursoft.com"},"repository":{"url":"https://gitlab.aiursoft.cn/aiursoft/utctime.js","type":"git"},"_npmVersion":"9.8.0","description":"Auto utc time","directories":{},"_nodeVersion":"20.5.1","_hasShrinkwrap":false,"devDependencies":{"eslint":"^8.56.0","esbuild":"^0.19.11","prettier":"^3.1.1","typescript":"^5.3.3","@typescript-eslint/parser":"^6.16.0","@typescript-eslint/eslint-plugin":"^6.16.0"},"_npmOperationalInternal":{"tmp":"tmp/utctime.js_1.0.2_1709802886518_0.9600184581402911","host":"s3://npm-registry-packages"}},"1.0.3":{"name":"@aiursoft/utctime.js","version":"1.0.3","author":{"name":"Anduin Xue","email":"anduin@aiursoft.com"},"license":"MIT","_id":"@aiursoft/utctime.js@1.0.3","maintainers":[{"name":"anduin2017","email":"Anduin@aiursoft.com"}],"dist":{"shasum":"16a1b4c62f04a4f7f733c23ec1c304b0f35da898","tarball":"https://registry.npmjs.org/@aiursoft/utctime.js/-/utctime.js-1.0.3.tgz","fileCount":11,"integrity":"sha512-lMXA4en8bMiD+NbT0MLD6qzKIAApK5rHEszrCB3abQejycOQtpezAk+VW5I2ovHFI23wuu5d2wLUd7mzMGDoPA==","signatures":[{"sig":"MEQCIFVEskXkdADEBm/Ax/Afx4nmg0ELI346WHKL7zBt2iVeAiAnWw+kXK8g/T8dCZ/xjEeid4PNXDIgzl9Z0fPAHsRBVA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":16685},"main":"dist/cjs/utctime.js","types":"dist/types/utctime.d.ts","module":"dist/esm/utctime.js","gitHead":"7c561a92cd3f691a0d468f4af2c443730e51d8cd","scripts":{"lint":"eslint src/ --ext .ts && prettier --check .","build":"npm run build-js","clean":"rm -rf ./dist","format":"prettier --write .","build-js":"tsc -b ./tsconfig.json ./tsconfig.types.json"},"_npmUser":{"name":"anduin2017","email":"Anduin@aiursoft.com"},"repository":{"url":"https://gitlab.aiursoft.cn/aiursoft/utctime.js","type":"git"},"_npmVersion":"9.8.0","description":"Auto utc time","directories":{},"_nodeVersion":"20.5.1","_hasShrinkwrap":false,"devDependencies":{"eslint":"^8.56.0","esbuild":"^0.19.11","prettier":"^3.1.1","typescript":"^5.3.3","@typescript-eslint/parser":"^6.16.0","@typescript-eslint/eslint-plugin":"^6.16.0"},"_npmOperationalInternal":{"tmp":"tmp/utctime.js_1.0.3_1709803782354_0.07918995771620785","host":"s3://npm-registry-packages"}},"1.0.4":{"name":"@aiursoft/utctime.js","version":"1.0.4","author":{"name":"Anduin Xue","email":"anduin@aiursoft.com"},"license":"MIT","_id":"@aiursoft/utctime.js@1.0.4","maintainers":[{"name":"anduin2017","email":"Anduin@aiursoft.com"}],"dist":{"shasum":"c1dc6ee5aa5ce95a379c92314ac88e6be129a1ed","tarball":"https://registry.npmjs.org/@aiursoft/utctime.js/-/utctime.js-1.0.4.tgz","fileCount":11,"integrity":"sha512-EPdZpm46LiwQlRdcifYVWnqm5BRTzFH+K3HlOshYhCXwo1f5Ss0oUT+zwnMI86sJepNoiyzXU6zAfKSvNCInsg==","signatures":[{"sig":"MEUCIQCfbtkINbRIB8dWErr58RevDJOvf9uloMXeoUTeHvdMUAIgK1Yh5JMoxnx5q+aMSA9lTZY6Du2/3dbuzsWJCfLTfrI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":16787},"main":"dist/cjs/utctime.js","types":"dist/types/utctime.d.ts","module":"dist/esm/utctime.js","gitHead":"7f8bcee046a1bdad988b7bdd06396edac449075d","scripts":{"lint":"eslint src/ --ext .ts && prettier --check .","build":"npm run build-js","clean":"rm -rf ./dist","format":"prettier --write .","build-js":"tsc -b ./tsconfig.json ./tsconfig.types.json"},"_npmUser":{"name":"anduin2017","email":"Anduin@aiursoft.com"},"repository":{"url":"https://gitlab.aiursoft.cn/aiursoft/utctime.js","type":"git"},"_npmVersion":"9.8.0","description":"Auto utc time","directories":{},"_nodeVersion":"20.5.1","_hasShrinkwrap":false,"devDependencies":{"eslint":"^8.56.0","esbuild":"^0.19.11","prettier":"^3.1.1","typescript":"^5.3.3","@typescript-eslint/parser":"^6.16.0","@typescript-eslint/eslint-plugin":"^6.16.0"},"_npmOperationalInternal":{"tmp":"tmp/utctime.js_1.0.4_1709804008650_0.5326336403626954","host":"s3://npm-registry-packages"}},"1.0.5":{"name":"@aiursoft/utctime.js","version":"1.0.5","author":{"name":"Anduin Xue","email":"anduin@aiursoft.com"},"license":"MIT","_id":"@aiursoft/utctime.js@1.0.5","maintainers":[{"name":"anduin2017","email":"Anduin@aiursoft.com"}],"dist":{"shasum":"11c33fcc61a3454904feb1bbab77d0b05f0ec0da","tarball":"https://registry.npmjs.org/@aiursoft/utctime.js/-/utctime.js-1.0.5.tgz","fileCount":11,"integrity":"sha512-3ScbfwrqeWuoKMSKR2+Exqx4iyKqMk3lu6WmrPsHep2p8JsADqBiN/cLVoEjJzzrJK6ZOQZD1CvKBe70fIpTVg==","signatures":[{"sig":"MEQCIHiw3IfAmW9mQTM+2NxmW/ijn2rjmMRMlNKsiL6PMdKPAiBMAF4h5gLtBt5SY4fV+S1t13gNld7ye4l0oSgUT3clKQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":16751},"main":"dist/cjs/utctime.js","types":"dist/types/utctime.d.ts","module":"dist/esm/utctime.js","gitHead":"52356be3ebd7bc6c477aa302d6a7c345bc2dd1c3","scripts":{"lint":"eslint src/ --ext .ts && prettier --check .","build":"npm run build-js","clean":"rm -rf ./dist","format":"prettier --write .","build-js":"tsc -b ./tsconfig.json ./tsconfig.types.json","lint-fix":"eslint src/ --ext .ts --fix && prettier --write ."},"_npmUser":{"name":"anduin2017","email":"Anduin@aiursoft.com"},"repository":{"url":"https://gitlab.aiursoft.cn/aiursoft/utctime.js","type":"git"},"_npmVersion":"11.0.0","description":"Auto utc time","directories":{},"_nodeVersion":"23.6.0","_hasShrinkwrap":false,"devDependencies":{"eslint":"^8.56.0","esbuild":"^0.19.11","prettier":"^3.1.1","typescript":"^5.3.3","@typescript-eslint/parser":"^6.16.0","@typescript-eslint/eslint-plugin":"^6.16.0"},"_npmOperationalInternal":{"tmp":"tmp/utctime.js_1.0.5_1737464627277_0.01632468769805917","host":"s3://npm-registry-packages-npm-production"}},"1.0.6":{"name":"@aiursoft/utctime.js","version":"1.0.6","description":"Auto utc time","main":"dist/cjs/utctime.js","module":"dist/esm/utctime.js","types":"dist/types/utctime.d.ts","scripts":{"clean":"rm -rf ./dist","build-js":"tsc -b ./tsconfig.json ./tsconfig.types.json","build":"npm run build-js","format":"prettier --write .","lint":"eslint src/ --ext .ts && prettier --check .","lint-fix":"eslint src/ --ext .ts --fix && prettier --write ."},"repository":{"type":"git","url":"https://gitlab.aiursoft.cn/aiursoft/utctime.js"},"devDependencies":{"esbuild":"^0.19.11","@typescript-eslint/eslint-plugin":"^6.16.0","@typescript-eslint/parser":"^6.16.0","eslint":"^8.56.0","prettier":"^3.1.1","typescript":"^5.3.3"},"author":{"name":"Anduin Xue","email":"anduin@aiursoft.com"},"license":"MIT","_id":"@aiursoft/utctime.js@1.0.6","gitHead":"777a2f5a349c3af6cee189146e578e987b0b14a1","_nodeVersion":"24.7.0","_npmVersion":"11.5.2","dist":{"integrity":"sha512-UIXVBwNYZ6DesPjhiwyms2YdqrrtCuwfFGeb0KTjmTkAIdqOMUxglvyRP6srWozEoOCqMVTDy62htWrTJN6YTQ==","shasum":"34a9258186af1acd738423dcedaee767e612a360","tarball":"https://registry.npmjs.org/@aiursoft/utctime.js/-/utctime.js-1.0.6.tgz","fileCount":13,"unpackedSize":20620,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIGNAH3t5a6+Xia9g5HS2ln6GeTqavjmIuMzxaVnlQGerAiB4qVjOz7xB2y+9Of9pO+/QoDAhzy3XR8AgDLnOCO4mPQ=="}]},"_npmUser":{"name":"anduin2017","email":"Anduin@aiursoft.com"},"directories":{},"maintainers":[{"name":"anduin2017","email":"Anduin@aiursoft.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/utctime.js_1.0.6_1758527843474_0.5980589807116983"},"_hasShrinkwrap":false}},"time":{"created":"2024-01-01T14:21:19.330Z","modified":"2025-09-22T07:57:23.920Z","1.0.0":"2024-01-01T14:21:19.621Z","1.0.1":"2024-03-07T09:04:22.719Z","1.0.2":"2024-03-07T09:14:46.708Z","1.0.3":"2024-03-07T09:29:42.506Z","1.0.4":"2024-03-07T09:33:28.785Z","1.0.5":"2025-01-21T13:03:47.441Z","1.0.6":"2025-09-22T07:57:23.723Z"},"author":{"name":"Anduin Xue","email":"anduin@aiursoft.com"},"license":"MIT","repository":{"type":"git","url":"https://gitlab.aiursoft.cn/aiursoft/utctime.js"},"description":"Auto utc time","maintainers":[{"name":"anduin2017","email":"Anduin@aiursoft.com"}],"readme":"# UtcTime.js\n\n[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](https://gitlab.aiursoft.cn/aiursoft/utctime.js/-/blob/master/LICENSE) [![Pipeline stat](https://gitlab.aiursoft.cn/aiursoft/utctime.js/badges/master/pipeline.svg)](https://gitlab.aiursoft.cn/aiursoft/utctime.js/-/pipelines) [![ManHours](https://manhours.aiursoft.cn/r/gitlab.aiursoft.cn/aiursoft/utctime.js.svg)](https://gitlab.aiursoft.cn/aiursoft/utctime.js/-/commits/master?ref_type=heads) [![npm](https://img.shields.io/npm/v/@aiursoft/utctime.js?color=blue)](https://www.npmjs.com/package/@aiursoft/utctime.js) [![npm](https://img.shields.io/npm/dm/@aiursoft/utctime.js)](https://www.npmjs.com/package/@aiursoft/utctime.js)\n\n`@aiursoft/utctime.js` is a JavaScript library which converts UTC time to local time easily.\n\n## Installation\n\nRun the following command to install the most recent version of `@aiursoft/utctime.js` from npm:\n\n```sh\nnpm install @aiursoft/utctime.js\n```\n\n## Importing\n\n## Reference JavaScript\n\nYou can import the library using the following code:\n\n```html\n<script type=\"module\">\n  import UtcTime from './node_modules/@aiursoft/utctime.js/dist/esm/utctime.js'\n  new UtcTime({})\n</script>\n```\n\n## How to build locally\n\n```bash\nnpm install\nnpm run build\n```\n\n## How to use\n\nCreate an element.\n\n```html\n<p></p>\n```\n\nAnd change it like this.\n\n```html\n<p data-utc-time=\"9/12/2018 10:12:24 AM\"><!-- In your tag the time shall be an UTC time --></p>\n```\n\nAdd init the library.\n\n```html\n<script>\n  new UtcTime({})\n</script>\n```\n\nAnd open it now! The time will be converted to local time.\n\n## API\n\n```javascript\n// Init with loop\nnew 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  // 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 full local time and date (using toLocaleString()), not `some time` ago.\n  disableAgo: false,\n\n  // Provide a custom format string to display the date and time.\n  // This takes the highest priority over `disableAgo` and the relative time logic.\n  // Example: 'YYYY-MM-DD HH:mm:ss'.\n  format: undefined,\n\n  // After the content is replaced.\n  onSet: function (element, date) {},\n\n  // Disable auto update the value by seconds.\n  disableAutoUpdate: false,\n})\n```\n\nFor example, to init bootstrap v4 tooltip:\n\n```javascript\nnew UtcTime({\n  onSet: function (element, date) {\n    element.setAttribute('data-toggle', 'tooltip')\n    element.setAttribute('data-trigger', 'hover')\n    element.setAttribute('data-title', date.toLocaleString())\n    $(element).tooltip()\n  },\n})\n```\n\nTo init bootstrap v5 tooltip:\n\n```javascript\nnew UtcTime({\n  onSet: function (element, date) {\n    new bootstrap.Tooltip(element, {\n      trigger: 'hover',\n      placement: 'top',\n      title: date.toLocaleString(),\n    })\n  },\n})\n```\n\n## How to contribute\n\nThere are many ways to contribute to the project: logging bugs, submitting pull requests, reporting issues, and creating suggestions.\n\nEven if you with push rights on the repository, you should create a personal fork and create feature branches there when you need them. This keeps the main repository clean and your workflow cruft out of sight.\n\nWe're also interested in your feedback on the future of this project. You can submit a suggestion or feature request through the issue tracker. To make this process more effective, we're asking that these include more information to help define them more clearly.\n","readmeFilename":"README.md"}