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 3.2.3 to 3.2.4

3

package.json
{
"name": "react-native-date-picker",
"version": "3.2.3",
"version": "3.2.4",
"description": "A Cross Platform React Native Picker",

@@ -32,3 +32,2 @@ "main": "src/index.js",

"dependencies": {
"moment": "^2.22.1"
},

@@ -35,0 +34,0 @@ "devDependencies": {

import React from 'react'
import { StyleSheet, requireNativeComponent } from 'react-native'
import moment from 'moment'
function addMinutes(date, minutesToAdd) {
return new Date(date.valueOf() + minutesToAdd * 60 * 1000)
}
const NativeDatePicker = requireNativeComponent(

@@ -36,3 +39,3 @@ `DatePickerManager`,

_onChange = e => {
const jsDate = this._fromIsoWithTimeZoneOffset(e.nativeEvent.date).toDate()
const jsDate = this._fromIsoWithTimeZoneOffset(e.nativeEvent.date)
this.props.onDateChange && this.props.onDateChange(jsDate)

@@ -54,8 +57,6 @@ if (this.props.onDateStringChange) {

_fromIsoWithTimeZoneOffset = date => {
if (this.props.timeZoneOffsetInMinutes === undefined) return moment(date)
return moment
.utc(date)
.subtract(this.props.timeZoneOffsetInMinutes, 'minutes')
_fromIsoWithTimeZoneOffset = timestamp => {
const date = new Date(timestamp)
if (this.props.timeZoneOffsetInMinutes === undefined) return date
return addMinutes(date, -this.props.timeZoneOffsetInMinutes)
}

@@ -65,8 +66,5 @@

if (this.props.timeZoneOffsetInMinutes === undefined)
return moment(date).toISOString()
return date.toISOString()
return moment
.utc(date)
.add(this.props.timeZoneOffsetInMinutes, 'minutes')
.toISOString()
return addMinutes(date, this.props.timeZoneOffsetInMinutes).toISOString()
}

@@ -73,0 +71,0 @@ }

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