{"id":21607980,"url":"https://github.com/yusufff/react-weekview","last_synced_at":"2025-10-04T05:47:50.453Z","repository":{"id":188710524,"uuid":"679279134","full_name":"yusufff/react-weekview","owner":"yusufff","description":"Week view component and hook for React","archived":false,"fork":false,"pushed_at":"2024-09-16T10:09:50.000Z","size":1058,"stargazers_count":11,"open_issues_count":3,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-11T04:37:25.396Z","etag":null,"topics":["react","week-picker","week-view"],"latest_commit_sha":null,"homepage":"https://react-weekview.vercel.app","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/yusufff.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":"2023-08-16T13:40:14.000Z","updated_at":"2025-03-10T17:15:39.000Z","dependencies_parsed_at":null,"dependency_job_id":"9320abe2-2e61-4b92-b2ed-1cada5085364","html_url":"https://github.com/yusufff/react-weekview","commit_stats":null,"previous_names":["yusufff/react-weekview"],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/yusufff/react-weekview","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yusufff%2Freact-weekview","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yusufff%2Freact-weekview/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yusufff%2Freact-weekview/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yusufff%2Freact-weekview/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yusufff","download_url":"https://codeload.github.com/yusufff/react-weekview/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yusufff%2Freact-weekview/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278271558,"owners_count":25959521,"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-10-04T02:00:05.491Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","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":["react","week-picker","week-view"],"created_at":"2024-11-24T20:35:34.779Z","updated_at":"2025-10-04T05:47:50.424Z","avatar_url":"https://github.com/yusufff.png","language":"TypeScript","readme":"# React WeekView\n\n[![NPM Version](https://img.shields.io/npm/v/react-weekview?style=flat\u0026label=react-weekview)](https://www.npmjs.com/package/react-weekview)\n\nA React component and hook for creating week view calendars.\n\nYou can use the `useWeekView` hooks for creating a fully customized week calendar or use the `WeekView` component.\n\n**Demo**: [react-weekview.vercel.app](https://react-weekview.vercel.app)\n\n## Quick Features\n\n- Headless hook for building customized designs\n- Prestyled and customizable component\n- Minimal dependency (only [date-fns](https://date-fns.org/))\n- Simple, not bloated\n\n## Example\n\n```bash\n# npm\nnpm install react-weekview\n\n# yarn\nyarn add react-weekview\n```\n\n```tsx\n// use the hook and build the design yourself\nconst { days, nextWeek, previousWeek, goToToday, viewTitle } = useWeekView({\n  disabledCell(date) {\n    return isBefore(date, new Date());\n  },\n  disabledWeek(startDayOfWeek) {\n    return isBefore(startDayOfWeek, startOfWeek(new Date()));\n  },\n});\n\n// or use the component\n\u003cWeekView /\u003e;\n```\n\n## `useWeekView`\n\n### Props\n\n| prop           | type                                                          | default            | description                                                  |\n| :------------- | :------------------------------------------------------------ | :----------------- | :----------------------------------------------------------- |\n| `initialDate`  | `?Date`                                                       | `new Date()`       | Initial date to start from                                   |\n| `minuteStep`   | `?number`                                                     | `30`               | How many minutes should there be between the generated cells |\n| `weekStartsOn` | `0 \\| 1 \\| 2 \\| 3 \\| 4 \\| 5 \\| 6`                             | `1`                | the index of the first day of the week (0 - Sunday)          |\n| `locale`       | [`date-fns` Locale](https://date-fns.org/v2.30.0/docs/Locale) | `date-fns` default | A locale object                                              |\n| `disabledCell` | `?(date: Date) =\u003e boolean`                                    | -                  | A function for determining the cells that cannot be selected |\n| `disabledDay`  | `?(date: Date) =\u003e boolean`                                    | -                  | A function for determining the days that cannot be selected  |\n| `disabledWeek` | `?(startDayOfWeek: Date) =\u003e boolean`                          | -                  | A function for determining the weeks that cannot be viewed   |\n\n### Returns\n\n| field          | type                                    | description                                    |\n| :------------- | :-------------------------------------- | :--------------------------------------------- |\n| `days`         | [`Days`](/src/lib/use-weekview.ts#L115) | An array of days and hours for the active week |\n| `weekNumber`   | `string`                                | Week number of the active week                 |\n| `viewTitle`    | `string`                                | Month and year of the active week              |\n| `nextWeek`     | `() =\u003e void`                            | Go to next week                                |\n| `previousWeek` | `() =\u003e void`                            | Go to previous week                            |\n| `goToToday`    | `() =\u003e void`                            | Go to current week                             |\n\n## `\u003cWeekView /\u003e`\n\n### Props\n\n_...`useWeekView` props_\n| prop | type | default | description |\n| :------------- | :------------------------------------------------------------ | :----------------- | :----------------------------------------------------------- |\n| `events` | [`?Event[]`](/src/lib/weekview.tsx#L9) | - | Event list to display on the calendar |\n| `onCellClick` | `?(cell: Cell) =\u003e void` | - | Cell click callback |\n| `onEventClick` | `?(evet: Event) =\u003e void` | - | Event click callback |\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyusufff%2Freact-weekview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyusufff%2Freact-weekview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyusufff%2Freact-weekview/lists"}