Skip to content

Date picker on iOS has different selected value then Date received in onChange callback #114

@kumien

Description

@kumien

Bug

DateTimePicker on iOS return in onChange method different then selected one. Different is one day.

Environment info

React native info output:

info Fetching system and libraries information...
System:
    OS: macOS 10.15.2
    CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
    Memory: 128.34 MB / 16.00 GB
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 13.7.0 - /usr/local/bin/node
    Yarn: 1.21.1 - /usr/local/bin/yarn
    npm: 6.13.6 - /usr/local/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  SDKs:
    iOS SDK:
      Platforms: iOS 13.2, DriverKit 19.0, macOS 10.15, tvOS 13.2, watchOS 6.1
  IDEs:
    Android Studio: 3.5 AI-191.8026.42.35.6010548
    Xcode: 11.3.1/11C504 - /usr/bin/xcodebuild
  npmPackages:
    react: ^16.12.0 => 16.12.0 
    react-native: 0.61.4 => 0.61.4 
  npmGlobalPackages:
    create-react-native-app: 2.0.2
    react-native-cli: 2.0.1

Library version: 2.2.1

Steps To Reproduce

  1. Create simple app with DateTimePicker.
  2. Add item like this:
    <DateTimePicker testID="dateTimePicker" timeZoneOffsetInMinutes={0} value={parseDate(value)} mode={'date'} is24Hour={true} display="default" onChange={(event, date) => { debugger; console.log("Event: " + event.type); console.log("Selected date: " + date)); />
  3. Run it on iOS simulator.
    ...

Describe what you expected to happen:

  1. Date on picker should be the same as it is in onChange callback function

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions