{"id":19191694,"url":"https://github.com/nikolasp/react-timetable-events","last_synced_at":"2025-05-08T16:55:39.415Z","repository":{"id":38317909,"uuid":"122844108","full_name":"nikolasp/react-timetable-events","owner":"nikolasp","description":"Timetable Events React component","archived":false,"fork":false,"pushed_at":"2024-02-13T07:37:50.000Z","size":5865,"stargazers_count":25,"open_issues_count":5,"forks_count":13,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-25T04:03:43.870Z","etag":null,"topics":["react","timetable","typescript"],"latest_commit_sha":null,"homepage":"https://nikolasp.github.io/react-timetable-events/","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/nikolasp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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-02-25T14:37:49.000Z","updated_at":"2024-08-25T18:54:36.000Z","dependencies_parsed_at":"2024-02-13T08:44:19.866Z","dependency_job_id":null,"html_url":"https://github.com/nikolasp/react-timetable-events","commit_stats":{"total_commits":12,"total_committers":4,"mean_commits":3.0,"dds":0.25,"last_synced_commit":"b05677ff31654be4ae689f04201223d344b4ffe4"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikolasp%2Freact-timetable-events","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikolasp%2Freact-timetable-events/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikolasp%2Freact-timetable-events/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikolasp%2Freact-timetable-events/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nikolasp","download_url":"https://codeload.github.com/nikolasp/react-timetable-events/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252606964,"owners_count":21775415,"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":["react","timetable","typescript"],"created_at":"2024-11-09T11:44:02.562Z","updated_at":"2025-05-08T16:55:39.388Z","avatar_url":"https://github.com/nikolasp.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-timetable-events\n\n[![NPM](https://img.shields.io/npm/v/react-timetable-events.svg)](https://www.npmjs.com/package/react-timetable-events) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)\n\n## Description [(Demo)](https://nikolasp.github.io/react-timetable-events/)\n\n\u003e React Timetable Events - flexible timetable component. Ideal for school timetables.\n\n## Installation\n\n```bash\n# with yarn\nyarn add react-timetable-events\n\n# with npm\nnpm install react-timetable-events\n```\n\n## Usage\n\n```tsx\nimport * as React from 'react'\nimport Timetable from 'react-timetable-events'\n\nexport const Example () =\u003e \u003cTimetable \n  events={{\n    monday: [\n      {\n        id: 1,\n        name: \"Custom Event 1\",\n        type: \"custom\",\n        startTime: new Date(\"2018-02-23T11:30:00\"),\n        endTime: new Date(\"2018-02-23T13:30:00\"),\n      },\n    ],\n    tuesday: [],\n    wednesday: [],\n    thursday: [],\n    friday: [],\n  }}\n  style={{ height: '500px' }}\n/\u003e\n```\n\n## Available props\n\n```js\nTimeTable.propTypes = {\n  events: PropTypes.object.isRequired, // events object prepared with days and list of events\n  hoursInterval: PropTypes.shape({\n    from: PropTypes.number.isRequired,\n    to: PropTypes.number.isRequired,\n  }), // displayed hours\n  renderDayHeader: PropTypes.func, // table header preview component\n  renderHour: PropTypes.func, // hour preview component\n  renderEvent: PropTypes.func, // event preview component\n  getDayLabel: PropTypes.func, // change weekday label\n  timeLabel: PropTypes.string, // Time label\n  style: React.CSSProperties, // pass custom wrapper styles like height and width\n  headerAttributes: PropTypes.object, // table header attributes - HTML attrs can be passed\n  bodyAttributes: PropTypes.object, // table body attributes - HTML attrs can be passed\n};\n```\n\nCheck [Storybook](./src/stories/Timetable.stories.tsx) for more details about customization.\n\n## Events - the only required prop\n\n```ts\nexport interface Event {\n  id: number | string;\n  name: string;\n  startTime: Date;\n  endTime: Date;\n  type?: string;\n  [key: string]: unknown;\n}\n\nexport interface Events {\n  [day: string]: Event[];\n}\n\nconst events: Events = {\n  events: {\n    monday: [\n      {\n        id: 1,\n        name: \"Custom Event 1\",\n        type: \"custom\",\n        startTime: new Date(\"2018-02-23T11:30:00\"),\n        endTime: new Date(\"2018-02-23T13:30:00\"),\n      },\n    ],\n    tuesday: [\n      {\n        id: 2,\n        name: \"Custom Event 2\",\n        type: \"custom\",\n        startTime: new Date(\"2018-02-22T12:30:00\"),\n        endTime: new Date(\"2018-02-22T14:30:00\"),\n      },\n      {\n        id: 3,\n        name: \"Custom Event 3\",\n        type: \"custom\",\n        startTime: new Date(\"2018-02-22T16:30:00\"),\n        endTime: new Date(\"2018-02-22T18:45:00\"),\n      },\n    ],\n    wednesday: [],\n    thursday: [],\n    friday: [],\n  },\n};\n```\n\n## License\n\nMIT © [Nikola Spalevic](https://github.com/nikolasp) \u0026 [Filip Furtula](https://github.com/fujee)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnikolasp%2Freact-timetable-events","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnikolasp%2Freact-timetable-events","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnikolasp%2Freact-timetable-events/lists"}