Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

onHide callback doesn't return a valid Date #735

Open
ElviraBurchik opened this issue Feb 23, 2024 · 0 comments
Open

onHide callback doesn't return a valid Date #735

ElviraBurchik opened this issue Feb 23, 2024 · 0 comments
Labels

Comments

@ElviraBurchik
Copy link

Environment

System:
  OS: macOS 13.5.2
  CPU: (8) arm64 Apple M1
  Memory: 100.00 MB / 16.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 18.18.2
    path: ~/.nvm/versions/node/v18.18.2/bin/node
  Yarn:
    version: 1.22.19
    path: /usr/local/bin/yarn
  npm:
    version: 10.4.0
    path: ~/.nvm/versions/node/v18.18.2/bin/npm
  Watchman:
    version: 2024.01.22.00
    path: /usr/local/bin/watchman
Managers:
  CocoaPods:
    version: 1.15.2
    path: /usr/local/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 22.4
      - iOS 16.4
      - macOS 13.3
      - tvOS 16.4
      - watchOS 9.4
  Android SDK: Not Found
IDEs:
  Android Studio: 2022.3 AI-223.8836.35.2231.10671973
  Xcode:
    version: 14.3.1/14E300c
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 18.0.1.1
    path: /usr/bin/javac
  Ruby:
    version: 2.6.10
    path: /usr/bin/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.73.4
    wanted: 0.73.4
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: true
  newArchEnabled: false

Platforms

Both iOS and Android

Versions

Description

onHide callback returns Date but this date seems to be invalid and casted as boolean?

Based on description of the callback:

  • Called when the underlying modal finishes its' closing animation after Confirm was pressed.
    onHide?(date: Date): void;

I expected the same Date object as the one returned via onConfirm. However, based on logs they are different. For example:

Date on confirm: Thu Jun 25 2026 12:53:47 GMT+0200
Date on hide: true

Is it an issue or is it an expected behaviour? Thanks in advance :)

Reproducible Demo

Here is a repo with demo: https://github.com/ElviraBurchik/react-native-modal-datetime-picker-issue-on-hide

Checkout the repo, run the app via yarn ios or yarn android. You will the first screen. Press "Open DateTimePicker" and submit any date. The result will be shown on the screen:

Date on confirm: Thu Jun 25 2026 12:53:47 GMT+0200
Date on hide: true
simulator_screenshot_A9C81587-2198-417D-A040-4A97147B3D42 Simulator Screenshot - iPhone 14 Pro - 2024-02-23 at 12 56 33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant