react-native-calendars
react-native-calendars copied to clipboard
Can't set time zone problem
The user base is global, and the calendar selector has no time zone, making it difficult to distinguish between the dates the user currently selects
<Calendar timezone="Asia/Shanghai" />
Your support for this feature is highly required
Definitely need this feature .
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Hope this helps someone:
onDayPress={day => {
const offsetInMiliseconds = new Date().getTimezoneOffset() * 60 * 1000; // Get timezone offset
const currentDateWithTimezoneApplied = day.timestamp + offsetInMilliseconds
// Do stuff
}}