{"id":29694108,"url":"https://github.com/xarlizard/react-temporal","last_synced_at":"2026-01-20T16:38:03.818Z","repository":{"id":305697784,"uuid":"1023568266","full_name":"xarlizard/react-temporal","owner":"xarlizard","description":"A comprehensive React hooks library for date and time management using the JavaScript Temporal API. Provides custom hooks for all common date, time, calendar, and timezone needs in React projects.","archived":false,"fork":false,"pushed_at":"2025-07-21T15:17:06.000Z","size":168,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-21T15:41:13.543Z","etag":null,"topics":["npm-package","react","temporal-polyfill"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@xarlizard/react-temporal","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/xarlizard.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-21T11:03:26.000Z","updated_at":"2025-07-21T15:23:50.000Z","dependencies_parsed_at":"2025-07-21T15:41:20.542Z","dependency_job_id":"32aaa5f1-7eb0-4d60-9164-b7acb54a4d9e","html_url":"https://github.com/xarlizard/react-temporal","commit_stats":null,"previous_names":["xarlizard/react-temporal"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/xarlizard/react-temporal","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xarlizard%2Freact-temporal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xarlizard%2Freact-temporal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xarlizard%2Freact-temporal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xarlizard%2Freact-temporal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xarlizard","download_url":"https://codeload.github.com/xarlizard/react-temporal/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xarlizard%2Freact-temporal/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266646615,"owners_count":23961989,"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","status":"online","status_checked_at":"2025-07-23T02:00:09.312Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["npm-package","react","temporal-polyfill"],"created_at":"2025-07-23T08:38:24.131Z","updated_at":"2025-10-10T11:38:05.976Z","avatar_url":"https://github.com/xarlizard.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-temporal \n\n[![npm version](https://badge.fury.io/js/@xarlizard%2Freact-temporal.svg)](https://badge.fury.io/js/@xarlizard%2Freact-temporal)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![TypeScript](https://img.shields.io/badge/TypeScript-Ready-blue.svg)](https://www.typescriptlang.org/)\n[![CI/CD](https://github.com/xarlizard/react-temporal/actions/workflows/publish.yml/badge.svg)](https://github.com/xarlizard/react-temporal/actions/workflows/publish.yml)\n[![Production Deployment](https://github.com/xarlizard/react-temporal/actions/workflows/deploy.yml/badge.svg?branch=main)](https://github.com/xarlizard/react-temporal/actions/workflows/deploy.yml)\n\n\n**react-temporal** is a comprehensive React hooks library for date and time management, powered by the new JavaScript\n[Temporal API](https://tc39.es/proposal-temporal/). It aims to be the only required library for handling dates, times,\ndurations, calendars, and time zones in React projects.\n\n---\n\n## 🚀 Install\n\n```bash\nnpm install @xarlizard/react-temporal\n```\n\n---\n\n## 📦 Usage\n\nAll hooks are named exports:\n\n```tsx\nimport { useTemporalNow, useTemporalMonth } from 'react-temporal';\n\nfunction Clock() {\n  const now = useTemporalNow();\n  return \u003cdiv\u003eCurrent time: {now.toString()}\u003c/div\u003e;\n}\n```\n\n---\n\n## 🧩 Hooks Overview\n\n| Hook                   | Description                                                           |\n| ---------------------- | --------------------------------------------------------------------- |\n| `useTemporalNow`       | Returns the current `Temporal.Instant`, updating every second.        |\n| `useTemporalInterval`  | Runs a callback at a given `Temporal.Duration` interval.              |\n| `useTemporalDuration`  | Returns a `Temporal.Duration` between two instants.                   |\n| `useTemporalCalendar`  | Returns a `Temporal.Calendar` instance for a given calendar ID.       |\n| `useTemporalTimeZone`  | Returns a `Temporal.TimeZone` instance for a given time zone ID.      |\n| `useTemporalFormat`    | Formats a Temporal object using `Intl.DateTimeFormat`.                |\n| `useTemporalRange`     | Returns an array of `Temporal.PlainDate` between start and end.       |\n| `useTemporalRelative`  | Returns a human-readable relative time string between two instants.   |\n| `useTemporalCountdown` | Returns the remaining seconds until a target instant.                 |\n| `useTemporalSchedule`  | Schedules a callback to run at a specific instant.                    |\n| `useTemporalParse`     | Parses an ISO string to `Temporal.Instant`.                           |\n| `useTemporalDiff`      | Returns the difference between two instants as a `Temporal.Duration`. |\n| `useTemporalWeek`      | Returns all dates in the week of a given `Temporal.PlainDate`.        |\n| `useTemporalMonth`     | Returns all dates in the month of a given `Temporal.PlainDate`.       |\n| `useTemporalYear`      | Returns all months in the year of a given `Temporal.PlainDate`.       |\n\n---\n\n### Example Hooks\n\n#### `useTemporalNow`\n\nReturns the current `Temporal.Instant`, updating every second.\n\n```tsx\nconst now = useTemporalNow();\n```\n\n#### `useTemporalMonth`\n\nReturns all dates in the month of a given `Temporal.PlainDate`.\n\n```tsx\nconst dates = useTemporalMonth(Temporal.PlainDate.from('2025-07-01'));\n```\n\n#### `useTemporalCountdown`\n\nReturns the remaining seconds until a target `Temporal.Instant`.\n\n```tsx\nconst remaining = useTemporalCountdown(Temporal.Instant.from('2025-08-01T00:00:00Z'));\n```\n\n#### ...and many more!\n\nSee [`examples/`](examples/README.md) for more usage patterns.\n\n---\n\n## 🧪 Testing\n\nAll hooks are covered by unit tests in [`src/__tests__/`](src/__tests__). Run tests with:\n\n```bash\nnpm test\n```\n\n---\n\n## 🛠️ Development\n\n- Clone the repo: `git clone https://github.com/xarlizard/react-temporal.git`\n- Install dependencies: `npm install`\n- Run tests: `npm test`\n- Build: `npm run build`\n\n---\n\n## 🤝 Contributing\n\nContributions are welcome! Please open issues or submit pull requests.\n\n---\n\n## 📄 License\n\nMIT © [xarlizard](https://github.com/xarlizard)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxarlizard%2Freact-temporal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxarlizard%2Freact-temporal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxarlizard%2Freact-temporal/lists"}