react-native-calendars moved 1 day forward
At the time of creating the post, it was Friday 30th. For some reason, my calendar displays this day as Saturday:
<Calendar
style={{width: Dimensions.get('screen').width - 10}}
theme={{
selectedDayBackgroundColor: '#00adf5',
selectedDayTextColor: '#ffffff',
dotColor: '#00adf5',
}}
onDayPress={this.onDaySelect}
markedDates={this.state.markedDates}
markingType="single"
minDate={minDate}
maxDate={maxDate}
disableAllTouchEventsForDisabledDays={true}
/>

This is likely a UTC issue where you're local time is now "tomorrow" in UTC. You should set the current property to today's date string. In my own, I use it like this:
const date = new Date();
<Calendar
current={date.toLocaleDateString()}
... // other props
/>
@lostchopstik Thank you for your help, but It doesn't work for me :(
console.log(new Date().toLocaleDateString()); shows 10/31/2020 (current date). console.log(new Date()); also shows current date (Sat Oct 31 2020 10:41:14 GMT+0300 (Moscow Standard Time)), but in calendar I also see incorrect variant.

I have faced same issues. Please help me
@mparkhomenko Please added parameters firstDay={6}.
@jaiminp-nimblechapps It didn't help :( Do you have other variants?
@mparkhomenko Go to this file location
react-native-calenders -> src -> calendar -> header -> index.js
and changed
let weekDaysNames = weekDayNames(this.props.firstDay);
to
let weekDaysNames = weekDayNames(6);
I have faced the same issue I have resolved this issue from the above solution
@jaiminp-nimblechapps thank you!!!
@mparkhomenko Glad to help!!!!
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.
this solution make sunday first day of week. Its not suitable for me and i try to read typescript Add this:
firstDay={1} with https://github.com/wix/react-native-calendars/issues/1319#issuecomment-723943875
After this first day of week is monday and day forward fixed.
I've came across with the same problem in Agenda component. I've added firstDay=1, and didn't change the order of the short day names. But now, date of days are incorrect. Today is 1st of September Thursday but It looks like Friday in weekly view. How can i solve this?
I've came across with the same problem in Agenda component. I've added firstDay=1, and didn't change the order of the short day names. But now, date of days are incorrect. Today is 1st of September Thursday but It looks like Friday in weekly view. How can i solve this?
I think I have same issue in Turkish.

@ cwtaras I think I found a solution for Agenda wrong day issue with locale config for @1.1293.0 version.
Go to; node_modules->react-native-calendars->src->agenda->reservation-list->reservation.js
Change;
{dayNames ? dayNames[date.getDay()] : undefined} (should be line 64)
to
{dayNames ? dayNames[date.getDay()-1] : undefined}
Also apply same approach for agenda as mentioned above for calendar; Go to; node_modules->react-native-calendars->src->agenda->index.js
Change;
<WeekDaysNames firstDay={this.props.firstDay} style={this.style.dayHeader}/>
to
<WeekDaysNames firstDay={6} style={this.style.dayHeader}/>
let weekDaysNames = weekDayNames(this.props.firstDay);
why 6?
I am having this issue in production can we please have a fix that works for all timezones like a property or something ☺. For example for people in Poland and Indonesia they say the Calendar day is a day forward from phone date . @yakirza17 @yuvalsho @Inbal-Tish
https://stackoverflow.com/questions/64609833/react-native-calendars-moved-1-day-forward
Give me a link i will donate for this to be fixed ☺
I had the same issue and it turns out it is due to the way the .getDay() function is defined. For some reason it is not Mon-Sun but Sun-Sat. So Sunday is 0 and Saturday is 6, this makes it seem like there is an issue with a timeshift if you expect Monday to be 0 and Sunday 6. See the docs: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getDay
Since I define the weekday names in a separate file I don't want to use the Sun-Sat format as I think it is counter intuitive. I simply shift the days using this function:
function dayRangeShift(dayIndex:number){
return (dayIndex+6)%7;
}
@ cwtaras I think I found a solution for Agenda wrong day issue with locale config for @1.1293.0 version.
Go to; node_modules->react-native-calendars->src->agenda->reservation-list->reservation.js
Change;
{dayNames ? dayNames[date.getDay()] : undefined}(should be line 64) to{dayNames ? dayNames[date.getDay()-1] : undefined}Also apply same approach for agenda as mentioned above for calendar; Go to; node_modules->react-native-calendars->src->agenda->index.js
Change;
<WeekDaysNames firstDay={this.props.firstDay} style={this.style.dayHeader}/>to<WeekDaysNames firstDay={6} style={this.style.dayHeader}/>
Tried this solution on @1.1305.0 version, and didn't work.
But logging around shows me that for some reason, at first moment the day is right , and suddenly it re-renders and stay on future date.
Anyone had more luck on finding an alternative solution? :/
You don't need to intervene directly in the package. Start the day list you provide from Sunday and let firstDay={1}. This solved my problem.