Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-native-wheel-picker-android

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-wheel-picker-android - npm Package Compare versions

Comparing version 1.1.0 to 1.1.1

2

package.json
{
"name": "react-native-wheel-picker-android",
"version": "1.1.0",
"version": "1.1.1",
"description": "Simple Wheel Picker for Android to use with react-native",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -8,8 +8,7 @@ # ReactNativeWheelPicker

For IOS you can use a [good Picker for IOS](https://facebook.github.io/react-native/docs/pickerios.html#onvaluechange)
[and DatePicker for IOS](https://facebook.github.io/react-native/docs/datepickerios.html)
For IOS you can use a [good Picker for IOS](https://facebook.github.io/react-native/docs/pickerios.html)
and [DatePicker for IOS](https://facebook.github.io/react-native/docs/datepickerios.html)
## Installation Android
1. `yarn add react-native-wheel-picker-android`
2. `react-native link react-native-wheel-picker-android`
`yarn add react-native-wheel-picker-android`

@@ -16,0 +15,0 @@ # Usage

@@ -86,3 +86,3 @@ /**

render() {
const { startDate, days, daysCount, hours, minutes } = this.props
const { startDate, days, daysCount, hours, minutes, format24 } = this.props
const { initHourInex, initDayInex, initMinuteInex } = this.state

@@ -107,3 +107,3 @@ return (

visibleItemCount={8}
data={hours || getHoursArray()}
data={hours || getHoursArray(format24)}
selectedItemTextColor={'black'}

@@ -110,0 +110,0 @@ onItemSelected={this.onHourSelected}

@@ -45,13 +45,9 @@ /**

super(props)
const selectedDate = this.props.initDate
? new Date(this.props.initDate)
: new Date()
const { initDate, format24, minutes } = props
const selectedDate = initDate ? new Date(initDate) : new Date()
const time12format = hourTo12Format(selectedDate.getHours())
const time24format = selectedDate.getHours()
const hours = this.props.hours ? this.props.hours : getHoursArray()
const minutes = this.props.minutes || getFiveMinutesArray()
const initHourInex = this.props.format24
? time24format
: Number(time12format[0]) - 1
const minutesCount = this.props.minutes ? this.props.minutes.length : 12
const hours = this.props.hours || getHoursArray(format24)
const initHourInex = format24 ? time24format : Number(time12format[0]) - 1
const minutesCount = minutes ? minutes.length : 12

@@ -65,3 +61,3 @@ const initMinuteInex = Math.round(

hours,
minutes,
minutes: minutes || getFiveMinutesArray(),
initHourInex,

@@ -68,0 +64,0 @@ initMinuteInex,

@@ -66,6 +66,7 @@ /**

export function getHoursArray() {
export function getHoursArray(format24: boolean) {
const hours = format24 ? { min: 0, max: 23 } : { min: 1, max: 12 }
const arr = []
for (let i = 1; i < 13; i++) {
arr.push(i)
for (let i = hours.min; i <= hours.max; i++) {
arr.push(`00${i}`.slice(-2))
}

@@ -72,0 +73,0 @@ return arr

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc