Closed G2454 closed 1 year ago
It picks the end day of the timezone of the device are you on a emulator?
No, I'm using It on my Android device through Expo Go. But this problem happens both with the snack (web) and with my device. This problem doesn't happen in the demo :https://www.reactnativepaperdates.com/ , so I was hoping there is some trick to solve it
I somehow solved this problem.
I installed moment.js to my project, put this line of code let endDate = moment(range.endDate).utcOffset('-03:00').format('DD/MM/YYYY HH:mm:ss');
. It solved the timezone problem
Hello, I'm having trouble with the date range picker. Every time I pick an endDate It ends up +1 day. If i choose 2023-03-03, it shows as "2023-03-04T02:59:59.000Z" in the console.log. Since my timezone is GMT-3, I suppose it's converting automaticaly to the timezone this library uses after I pick the date, adding +1 day. Is there a way to solve this ?
Example: (startDate = 2023-03-01, endDate = 2023-03-03
After putting this line of code in 40
<Text style={{color:'black'}}>{JSON.stringify(range.endDate)}</Text>
It shows the wrong date (chosen date +1)This was made on: https://snack.expo.dev/@fitzwabs/react-native-paper-dates-range-picker?platform=web I just added a single line of code to display the endDate Locale is set as 'pt'