datetimepicker
datetimepicker copied to clipboard
datetimepicker on RN Windows not work
npx react-native info output:
info Fetching system and libraries information...
System:
OS: Windows 10 10.0.19041
CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
Memory: 15.19 GB / 23.85 GB
Binaries:
Node: 15.12.0 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.10 - ~\AppData\Roaming\npm\yarn.CMD
npm: 7.8.0 - C:\Program Files\nodejs\npm.CMD
Watchman: Not Found
SDKs:
Android SDK:
API Levels: 23, 28, 29
Build Tools: 23.0.1, 28.0.3, 29.0.2, 29.0.3, 30.0.2, 31.0.0
System Images: android-28 | Google APIs Intel x86 Atom, android-28 | Google APIs Intel x86 Atom_64, android-29 | Google APIs Intel x86 Atom_64
Android NDK: Not Found
Windows SDK:
AllowDevelopmentWithoutDevLicense: Enabled
AllowAllTrustedApps: Enabled
Versions: 10.0.17763.0, 10.0.18362.0, 10.0.19041.0
IDEs:
Android Studio: Version 4.1.0.0 AI-201.8743.12.41.7042882
Visual Studio: 16.9.31205.134 (Visual Studio Community 2019)
Languages:
Java: 1.8.0_211 - C:\Program Files\Java\jdk1.8.0_211\bin\javac.EXE
npmPackages:
@react-native-community/cli: * => 5.0.1-alpha.2
react: 17.0.1 => 17.0.1
react-native: 0.64.0 => 0.64.0
react-native-windows: ^0.64.0-0 => 0.64.4
npmGlobalPackages: react-native: Not Found
datetimepicker version: 3.4.6
Windows 10
I select date but set wrong date.for example i select 23 but datetimepicker set 22. as on photo.
const DatePicker: FC<IProps> = props => {
const now=new Date();
const startTime =new Date(1619271418);
return ( <View> { <Text style={{color:'black'}}>{props.title}</Text> } <DateTimePicker value={props.value} timeZoneOffsetInMinutes={0} is24Hour={false} display="default" dateFormat='shortdate' onChange={props.onChange} minimumDate={props.minimumDate? props.minimumDate : startTime} maximumDate={props.maximumDate? props.maximumDate: now} /> </View> ); };
<DatePicker title={item.title} value={costumerData[item.subTitle]} onChange={(e: any, selectedDate: any) => { console.log("selectedDate : ", selectedDate);
setcostumerData({
...costumerData,
[item.subTitle]: selectedDate,
});
}}
/>
console.log("selectedDate : ", selectedDate); => if i watch log it is same.

CC @stmoy @rectified95
This looks like an issue with timezone offsets, needs looking into.
@RahidAkhundzada Confirming I understand your problem. Is this about the date value of the JS event you receive when selecting a date in the date picker - eg. you select Apr 23rd, and see Apr 22nd in the console logs?
Do these pictures capture some other issue, or is this the only problem you're seeing?
@RahidAkhundzada Confirming I understand your problem. Is this about the date value of the JS event you receive when selecting a date in the date picker - eg. you select Apr 23rd, and see Apr 22nd in the console logs?
Do these pictures capture some other issue, or is this the only problem you're seeing?
Maybe you express this problem vrey clearly.i select 23 state or log is 22.everything is ok with my pc.when select other date it goes wrong.all pics about this problem.i saw only this problem.