datetimepicker icon indicating copy to clipboard operation
datetimepicker copied to clipboard

[Android] timeZoneOffsetInMinutes issue when setting device timezone to behind 1 day

Open kenzleong opened this issue 3 years ago • 0 comments

Bug report

Summary

When setting device timezone to behind 1 day of existing timezone and setting timeZoneOffsetInMinutes={0} the Android picker is off by one day.

Reproducible sample code

Using the example project, change the device timezone to Pago GMT -11 (Region: American Samoa). Set timeZoneOffsetInMinutes={480}

Comment line of code below //const sourceMoment = moment.unix(1636797600); line 66 with const sourceMoment = moment();

Steps to reproduce

  1. Click Show Picker

Describe what you expected to happen:

  1. 30th Dec should disabled like IOS
IMG_D675CA663B09-1 Screenshot 2021-12-31 at 16 13 31

Environment info

npx react-native info output:

System: OS: macOS 11.6.1 CPU: (8) arm64 Apple M1 Memory: 102.17 MB / 16.00 GB Shell: 5.8 - /bin/zsh Binaries: Node: 16.8.0 - ~/.nvm/versions/node/v16.8.0/bin/node Yarn: Not Found npm: 7.14.0 - ~/Downloads/datetimepicker-master/node_modules/.bin/npm Watchman: Not Found Managers: CocoaPods: 1.11.2 - /opt/homebrew/bin/pod SDKs: iOS SDK: Platforms: DriverKit 21.0.1, iOS 15.0, macOS 12.0, tvOS 15.0, watchOS 8.0 Android SDK: Not Found IDEs: Android Studio: 2020.3 AI-203.7717.56.2031.7784292 Xcode: 13.1/13A1030d - /usr/bin/xcodebuild Languages: Java: 11.0.12 - /Library/Java/JavaVirtualMachines/jdk-11.0.12.jdk/Contents/Home/bin/javac npmPackages: @react-native-community/cli: Not Found react: 17.0.2 => 17.0.2 react-native: ^0.66.4 => 0.66.4 react-native-macos: Not Found npmGlobalPackages: react-native: Not Found

datetimepicker version: 5.1.0

iOS / Android version: IOS 14.8 / Android 12

kenzleong avatar Dec 31 '21 08:12 kenzleong