{"id":4080,"url":"https://github.com/Tinysymphony/react-native-calendar-select","last_synced_at":"2025-08-04T00:31:35.950Z","repository":{"id":20809488,"uuid":"90974962","full_name":"Tinysymphony/react-native-calendar-select","owner":"Tinysymphony","description":"A component to select period from calendar like Airbnb","archived":false,"fork":false,"pushed_at":"2022-10-05T13:23:20.000Z","size":2954,"stargazers_count":305,"open_issues_count":38,"forks_count":97,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-04-14T21:54:04.986Z","etag":null,"topics":["airbnb","calendar","date","picker","react-native","select"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/Tinysymphony.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}},"created_at":"2017-05-11T12:08:31.000Z","updated_at":"2024-02-19T07:49:00.000Z","dependencies_parsed_at":"2022-07-25T08:02:01.037Z","dependency_job_id":null,"html_url":"https://github.com/Tinysymphony/react-native-calendar-select","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tinysymphony%2Freact-native-calendar-select","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tinysymphony%2Freact-native-calendar-select/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tinysymphony%2Freact-native-calendar-select/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tinysymphony%2Freact-native-calendar-select/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Tinysymphony","download_url":"https://codeload.github.com/Tinysymphony/react-native-calendar-select/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228483626,"owners_count":17927363,"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":["airbnb","calendar","date","picker","react-native","select"],"created_at":"2024-01-05T20:17:00.460Z","updated_at":"2024-12-07T07:31:08.979Z","avatar_url":"https://github.com/Tinysymphony.png","language":"JavaScript","funding_links":[],"categories":["Components","Others"],"sub_categories":["UI"],"readme":"## react-native-calendar-select [![Build Status](https://travis-ci.org/Tinysymphony/react-native-calendar-select.svg?branch=master)](https://travis-ci.org/Tinysymphony/react-native-calendar-select) [![Coverage Status](https://coveralls.io/repos/github/Tinysymphony/react-native-calendar-select/badge.svg?branch=master)](https://coveralls.io/github/Tinysymphony/react-native-calendar-select?branch=master)\n\nA date picker component like Airbnb. You can select a date period from the calendar modal.\n\n\n### Examples\n\n#### iOS Examples\n\n\n\u003ca href=\"#ios-en\" id=\"ios-en\"\u003e\u003cimg src=\"./GIF/ios-en.gif\" align=\"left\" width=\"200\"\u003e\u003c/a\u003e\n\n\u003ca href=\"#ios-zh\" id=\"ios-zh\"\u003e\u003cimg src=\"./GIF/ios-zh.gif\" align=\"left\" width=\"200\"\u003e\u003c/a\u003e\n\n\u003ca href=\"#ios-jp\" id=\"ios-jp\"\u003e\u003cimg src=\"./GIF/ios-jp.gif\" width=\"200\"\u003e\u003c/a\u003e\n\n\n#### Android Examples\n\n\n\u003ca href=\"#a-en\" id=\"a-en\"\u003e\u003cimg src=\"./GIF/a-en.gif\" align=\"left\" width=\"200\"\u003e\u003c/a\u003e\n\n\u003ca href=\"#a-zh\" id=\"a-zh\"\u003e\u003cimg src=\"./GIF/a-zh.gif\" align=\"left\" width=\"200\"\u003e\u003c/a\u003e\n\n\u003ca href=\"#a-jp\" id=\"a-jp\"\u003e\u003cimg src=\"./GIF/a-jp.gif\" width=\"200\"\u003e\u003c/a\u003e\n\n\n### Usage\n\n\n\u003e This component use `moment.js` to process date.\n\n**install from npm**\n\n``` shell\nnpm install --save react-native-calendar-select\n```\n\n**import in project**\n\n``` js\nimport Calendar from 'react-native-calendar-select';\n```\n\n```js\nconstructor (props) {\n  super(props);\n  this.state = {\n    startDate: new Date(2017, 6, 12),  \n    endDate: new Date(2017, 8, 2)\n  };\n  this.confirmDate = this.confirmDate.bind(this);\n  this.openCalendar = this.openCalendar.bind(this);\n}\n// when confirm button is clicked, an object is conveyed to outer component\n// contains following property:\n// startDate [Date Object], endDate [Date Object]\n// startMoment [Moment Object], endMoment [Moment Object]\nconfirmDate({startDate, endDate, startMoment, endMoment}) {\n  this.setState({\n    startDate,\n    endDate\n  });\n}\nopenCalendar() {\n  this.calendar \u0026\u0026 this.calendar.open();\n}\n// in render function\nrender() {\n  // It's an optional property, I use this to show the structure of customI18n object.\n  let customI18n = {\n    'w': ['', 'Mon', 'Tues', 'Wed', 'Thur', 'Fri', 'Sat', 'Sun'],\n    'weekday': ['', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'],\n    'text': {\n      'start': 'Check in',\n      'end': 'Check out',\n      'date': 'Date',\n      'save': 'Confirm',\n      'clear': 'Reset'\n    },\n    'date': 'DD / MM'  // date format\n  };\n  // optional property, too.\n  let color = {\n    subColor: '#f0f0f0'\n  };\n  return (\n    \u003cView\u003e\n      \u003cButton title=\"Open Calendar\" onPress={this.openCalendar}\u003e\n      \u003cCalendar\n        i18n=\"en\"\n        ref={(calendar) =\u003e {this.calendar = calendar;}}\n        customI18n={customI18n}\n        color={color}\n        format=\"YYYYMMDD\"\n        minDate=\"20170510\"\n        maxDate=\"20180312\"\n        startDate={this.state.startDate}\n        endDate={this.state.endDate}\n        onConfirm={this.confirmDate}\n      /\u003e\n    \u003c/View\u003e\n  );\n}\n```\n\n### Properties\n\n\n| Property | Type | Default | Description |\n| --- | --- | --- | --- |\n| i18n | String | 'en' | Language of the component, supports `en` / `zh` / `jp`. |\n| customI18n | Object | {} | Customize text of the component, the structure of this object is shown in the example above. |\n| color | Object | {} | Customize color. |\n| format | string | 'YYYY-MM-DD' | Define date format, you can also pass Date Object or Moment Object as props. |\n| minDate | String / Object | - | Min date of calendar |\n| maxDate | String / Object | - | Max date of calendar |\n| startDate | String / Object | null | Start date of selection |\n| endDate | String / Object | null | End date of selection |\n| onConfirm | Function | - | Callback function when the period is confirmed, receives an object as only parameter, contains `startDate` / `endDate` / `startMoment` / `endMoment` four property. |\n\n### Instance methods\n\n| Method | Description |\n| --- | --- |\n| cancel | Cancel modification of state and close modal |\n| close | Close select modal |\n| open | Open select modal |\n| clear | Reset state of component |\n| confirm | Confirm selection and close modal |\n\n\nLICENSE MIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTinysymphony%2Freact-native-calendar-select","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FTinysymphony%2Freact-native-calendar-select","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTinysymphony%2Freact-native-calendar-select/lists"}