Socket
Socket
Sign inDemoInstall

react-native-date-picker

Package Overview
Dependencies
Maintainers
1
Versions
121
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-date-picker - npm Package Compare versions

Comparing version 4.0.0 to 4.1.0

4

package.json
{
"name": "react-native-date-picker",
"version": "4.0.0",
"description": "A datetime picker for React Native. In-modal or stand-alone. Supports Android and iOS.",
"version": "4.1.0",
"description": "A datetime picker for React Native. In-modal or inlined. Supports Android and iOS.",
"main": "src/index.js",

@@ -6,0 +6,0 @@ "scripts": {

@@ -20,5 +20,5 @@ # React Native Date Picker

## Stand-alone
## Inlined
The second option is to use the picker stand-alone. Inlined in a view or a custom made modal.
The second option is to use the inlined picker. For instance in a view or a custom made modal.

@@ -25,0 +25,0 @@ <table>

import React from 'react'
import {
StyleSheet,
requireNativeComponent,
NativeModules,
NativeEventEmitter,
} from 'react-native'
import { requireNativeComponent, NativeModules } from 'react-native'

@@ -24,23 +19,2 @@ function addMinutes(date, minutesToAdd) {

class DatePickerAndroid extends React.PureComponent {
componentDidMount() {
const { onConfirm, onCancel } = this.props
const eventEmitter = new NativeEventEmitter(NativeModules.RNDatePicker)
this.confirmListener = eventEmitter.addListener(
'onConfirm',
({ date: isoDate }) => {
if (onConfirm) {
onConfirm(this._fromIsoWithTimeZoneOffset(isoDate))
}
}
)
this.cancelListener = eventEmitter.addListener('onCancel', () => {
if (onCancel) onCancel()
})
}
componentWillUnmount() {
this.confirmListener.remove()
this.cancelListener.remove()
}
render() {

@@ -50,3 +24,7 @@ const props = this.getProps()

if (props.open) {
NativeModules.RNDatePicker.openPicker(props)
NativeModules.RNDatePicker.openPicker(
props,
this._onConfirm,
this.props.onCancel
)
}

@@ -103,4 +81,8 @@ return null

}
_onConfirm = (isoDate) => {
this.props.onConfirm(this._fromIsoWithTimeZoneOffset(isoDate))
}
}
export default DatePickerAndroid

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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