{"id":15630669,"url":"https://github.com/danielroe/nuxt-time","last_synced_at":"2025-05-15T04:04:21.489Z","repository":{"id":65804300,"uuid":"600276532","full_name":"danielroe/nuxt-time","owner":"danielroe","description":"⏰ SSR-safe time element for Nuxt 3","archived":false,"fork":false,"pushed_at":"2025-04-29T09:16:03.000Z","size":2698,"stargazers_count":404,"open_issues_count":4,"forks_count":15,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-29T09:22:30.110Z","etag":null,"topics":["date","nuxt","nuxt-module","server","ssr"],"latest_commit_sha":null,"homepage":"","language":"Vue","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/danielroe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":["danielroe"]}},"created_at":"2023-02-11T01:52:32.000Z","updated_at":"2025-04-29T09:16:07.000Z","dependencies_parsed_at":"2024-11-06T05:16:40.378Z","dependency_job_id":"6c278382-cefc-4bb9-91ce-36d27d244c01","html_url":"https://github.com/danielroe/nuxt-time","commit_stats":{"total_commits":347,"total_committers":7,"mean_commits":49.57142857142857,"dds":"0.19884726224783866","last_synced_commit":"b09f75eb4b3f66c5cc4da70ce570fe5a7dd0b4fb"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielroe%2Fnuxt-time","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielroe%2Fnuxt-time/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielroe%2Fnuxt-time/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielroe%2Fnuxt-time/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danielroe","download_url":"https://codeload.github.com/danielroe/nuxt-time/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254270641,"owners_count":22042858,"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","nuxt","nuxt-module","server","ssr"],"created_at":"2024-10-03T10:34:53.423Z","updated_at":"2025-05-15T04:04:21.460Z","avatar_url":"https://github.com/danielroe.png","language":"Vue","funding_links":["https://github.com/sponsors/danielroe"],"categories":["Vue"],"sub_categories":[],"readme":"# Nuxt Time\n\n\u003e [!IMPORTANT]\n\u003e This module is no longer necessary as `\u003cNuxtTime\u003e` is built into Nuxt from v3.17 onwards.\n\n[![npm version][npm-version-src]][npm-version-href]\n[![npm downloads][npm-downloads-src]][npm-downloads-href]\n[![Github Actions][github-actions-src]][github-actions-href]\n[![Codecov][codecov-src]][codecov-href]\n\n\u003e SSR-safe time element for [Nuxt](https://nuxt.com)\n\n- [✨ \u0026nbsp;Changelog](https://github.com/danielroe/nuxt-time/blob/main/CHANGELOG.md)\n- [▶️ \u0026nbsp;Online playground](https://stackblitz.com/github/danielroe/nuxt-time/tree/main/playground)\n\n## Features\n\n- ✨ SSR/SSG-safe rendering of any date/time\n- 💪 Prevents hydration mismatch on client\n- 🏁 Respects browser locale\n- ✅ Renders semantic `\u003ctime\u003e` element\n\n## Installation\n\nInstall and add `nuxt-time` to your `nuxt.config`.\n\n```bash\nnpx nuxi@latest module add time\n```\n\n```js\nexport default defineNuxtConfig({\n  modules: ['nuxt-time'],\n})\n```\n\n## Usage\n\nTo use, you can use the `\u003cNuxtTime\u003e` component anywhere in your app. It will render a spec-compliant `\u003ctime\u003e` element.\n\nIt accepts `datetime` and `locale` (optional) properties, along with any property accepted by `Intl.DateTimeFormat` (see [MDN reference](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat)). **Note**: you can provide a `Date` or `number` (e.g. `Date.now()`) via `datetime` and it will be rendered correctly as an ISO-formatted date.\n\n```vue\n\u003ctemplate\u003e\n  \u003c!--\n    Date.now() will safely respect the time on the server, not on the\n    client. What's more, there will be no flash between server\n    and client locale formatting.\n  --\u003e\n  \u003cNuxtTime :datetime=\"Date.now()\" second=\"numeric\" month=\"long\" day=\"numeric\" /\u003e\n\u003c/template\u003e\n```\n\n## Relative Time Formatting\n\nNuxt Time also supports relative time formatting using the `Intl.RelativeTimeFormat` API. You can enable this feature by setting the `relative` prop to `true`.\n\n```vue\n\u003ctemplate\u003e\n  \u003c!--\n    This will display the time relative to the current time, e.g., \"5 minutes ago\"\n  --\u003e\n  \u003cNuxtTime :datetime=\"Date.now() - 5 * 60 * 1000\" relative /\u003e\n\u003c/template\u003e\n```\n\n## 💻 Development\n\n- Clone this repository\n- Enable [Corepack](https://github.com/nodejs/corepack) using `corepack enable`\n- Install dependencies using `pnpm install`\n- Stub module with `pnpm dev:prepare`\n- Run `pnpm dev` to start [playground](./playground) in development mode\n\n## License\n\nMade with ❤️\n\nPublished under the [MIT License](./LICENCE).\n\n\u003c!-- Badges --\u003e\n\n[npm-version-src]: https://img.shields.io/npm/v/nuxt-time?style=flat-square\n[npm-version-href]: https://npmjs.com/package/nuxt-time\n[npm-downloads-src]: https://img.shields.io/npm/dm/nuxt-time?style=flat-square\n[npm-downloads-href]: https://npm.chart.dev/nuxt-time\n[github-actions-src]: https://img.shields.io/github/actions/workflow/status/danielroe/nuxt-time/ci.yml?branch=main\n[github-actions-href]: https://github.com/danielroe/nuxt-time/actions?query=workflow%3Aci\n[codecov-src]: https://img.shields.io/codecov/c/gh/danielroe/nuxt-time/main?style=flat-square\n[codecov-href]: https://codecov.io/gh/danielroe/nuxt-time\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielroe%2Fnuxt-time","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanielroe%2Fnuxt-time","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielroe%2Fnuxt-time/lists"}