React Native Date Picker is datetime picker for Android and iOS. It includes date, time and datetime picker modes. The datepicker is customizable and is supporting different languages. It's written with native code to achieve the best possible look, feel and performance.
MIT License
2.21k
stars
338
forks
source link
Default timeZoneOffsetInMinutes value causing wrong Date in "date" mode #841
Smartphone (please complete the following information):
OS: iOS
React Native version 0.72.10
react-native-date-picker version 4.4.2
Proposition
I have fixed it with timeZoneOffsetInMinutes={0}. The default behavior of this Timezone offset seems to be problematic. My use case is simply allowing the user to define their birthday. I don't care about the device's timezone for this type of interaction; however, due to the default value, it affects my result. I think it should perhaps be set to 0 for 'date' usage or its use should be reevaluated.
Describe the bug When using Datepicker in
mode="date"
, the date extracted byonConfirm
is not the same as the selected with the UI.Expected behavior Expected: To get December 2, 1998 as date when using
onConfirm
: I getTo Reproduce Add example code that reproduces the behavior.
Smartphone (please complete the following information):
Proposition I have fixed it with
timeZoneOffsetInMinutes={0}
. The default behavior of this Timezone offset seems to be problematic. My use case is simply allowing the user to define their birthday. I don't care about the device's timezone for this type of interaction; however, due to the default value, it affects my result. I think it should perhaps be set to 0 for 'date' usage or its use should be reevaluated.