{"id":21233723,"url":"https://github.com/nysamnang/react-native-24h-timepicker","last_synced_at":"2025-07-10T17:31:42.944Z","repository":{"id":55471460,"uuid":"165973178","full_name":"nysamnang/react-native-24h-timepicker","owner":"nysamnang","description":"React Native 24 hours format TimePicker for iOS","archived":false,"fork":false,"pushed_at":"2023-01-05T01:02:46.000Z","size":7,"stargazers_count":30,"open_issues_count":14,"forks_count":30,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-06-25T01:15:55.006Z","etag":null,"topics":["24-hour-format","number-picker-ios","react-native","time-picker-ios","twenty-four-hour-format"],"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/nysamnang.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":"2019-01-16T04:24:32.000Z","updated_at":"2023-07-29T19:12:10.000Z","dependencies_parsed_at":"2023-02-03T03:01:23.472Z","dependency_job_id":null,"html_url":"https://github.com/nysamnang/react-native-24h-timepicker","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/nysamnang/react-native-24h-timepicker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nysamnang%2Freact-native-24h-timepicker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nysamnang%2Freact-native-24h-timepicker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nysamnang%2Freact-native-24h-timepicker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nysamnang%2Freact-native-24h-timepicker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nysamnang","download_url":"https://codeload.github.com/nysamnang/react-native-24h-timepicker/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nysamnang%2Freact-native-24h-timepicker/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264619066,"owners_count":23638400,"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":["24-hour-format","number-picker-ios","react-native","time-picker-ios","twenty-four-hour-format"],"created_at":"2024-11-21T00:00:12.759Z","updated_at":"2025-07-10T17:31:39.862Z","avatar_url":"https://github.com/nysamnang.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-native-24h-timepicker\n\n[![npm version](https://badge.fury.io/js/react-native-24h-timepicker.svg)](//npmjs.com/package/react-native-24h-timepicker) [![npm downloads](https://img.shields.io/npm/dm/react-native-24h-timepicker.svg)\n](//npmjs.com/package/react-native-24h-timepicker)\n\n### Screenshot\n\n![screenshot](https://raw.githubusercontent.com/NYSamnang/stock-images/master/react-native-24h-timepicker/RN24TPK-IOS.gif)\n\n## Installation\n\n```\nnpm i react-native-24h-timepicker --save\n```\n\n### or\n\n```\nyarn add react-native-24h-timepicker\n```\n\n## Example\n\n```jsx\nimport React, { Component } from \"react\";\nimport { StyleSheet, View, TouchableOpacity, Text } from \"react-native\";\nimport TimePicker from \"react-native-24h-timepicker\";\n\nclass Example extends Component {\n  constructor() {\n    super();\n    this.state = {\n      time: \"\"\n    };\n  }\n\n  onCancel() {\n    this.TimePicker.close();\n  }\n\n  onConfirm(hour, minute) {\n    this.setState({ time: `${hour}:${minute}` });\n    this.TimePicker.close();\n  }\n\n  render() {\n    return (\n      \u003cView style={styles.container}\u003e\n        \u003cText style={styles.text}\u003eREACT NATIVE\u003c/Text\u003e\n        \u003cText style={styles.text}\u003e24 HOURS FORMAT TIMEPICKER\u003c/Text\u003e\n        \u003cTouchableOpacity\n          onPress={() =\u003e this.TimePicker.open()}\n          style={styles.button}\n        \u003e\n          \u003cText style={styles.buttonText}\u003eTIMEPICKER\u003c/Text\u003e\n        \u003c/TouchableOpacity\u003e\n        \u003cText style={styles.text}\u003e{this.state.time}\u003c/Text\u003e\n        \u003cTimePicker\n          ref={ref =\u003e {\n            this.TimePicker = ref;\n          }}\n          onCancel={() =\u003e this.onCancel()}\n          onConfirm={(hour, minute) =\u003e this.onConfirm(hour, minute)}\n        /\u003e\n      \u003c/View\u003e\n    );\n  }\n}\n\nconst styles = StyleSheet.create({\n  container: {\n    flex: 1,\n    alignItems: \"center\",\n    backgroundColor: \"#fff\",\n    paddingTop: 100\n  },\n  text: {\n    fontSize: 20,\n    marginTop: 10\n  },\n  button: {\n    backgroundColor: \"#4EB151\",\n    paddingVertical: 11,\n    paddingHorizontal: 17,\n    borderRadius: 3,\n    marginVertical: 50\n  },\n  buttonText: {\n    color: \"#FFFFFF\",\n    fontSize: 16,\n    fontWeight: \"600\"\n  }\n});\n\nexport default Example;\n```\n\n## Props\n\n| Prop           | Type     | Description                                    | Default |\n| -------------- | -------- | ---------------------------------------------- | ------- |\n| maxHour        | number   | Maximum of hour                                | 23      |\n| maxMinute      | number   | Maximum of minute                              | 59      |\n| hourInterval   | number   | The interval at which hours can be selected.   | 1       |\n| minuteInterval | number   | The interval at which minutes can be selected. | 1       |\n| hourUnit       | string   | Add extra text to hour                         | \"\"      |\n| minuteUnit     | string   | Add extra text to minute                       | \"\"      |\n| selectedHour   | string   | Default hour                                   | \"0\"     |\n| selectedMinute | string   | Default minute                                 | \"00\"    |\n| itemStyle      | object   | Item text style                                | {}      |\n| textCancel     | string   | Cancel button text                             | Cancel  |\n| textConfirm    | string   | Confirm button text                            | Confirm |\n| onCancel       | function | Event on Cancel button                         |         |\n| onConfirm      | function | Event on Confirm button                        |         |\n\n## Methods\n\n| Method Name | Description      |\n| ----------- | ---------------- |\n| open        | Open TimePicker  |\n| close       | Close TimePicker |\n\n### Note\n\nAlways set `ref` to `TimePicker` and call each method by using `this.TimePicker.methodName()` like example above.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE.md](https://github.com/NYSamnang/react-native-24h-timepicker/blob/master/LICENSE) file for details\n\n## Author\n\nMade with ❤️ by [NY Samnang](https://github.com/NYSamnang).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnysamnang%2Freact-native-24h-timepicker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnysamnang%2Freact-native-24h-timepicker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnysamnang%2Freact-native-24h-timepicker/lists"}