Merge pull request #871 from rrott/fix/870-may-1st-missing

Fixed issue with rendering calendar incorrectly when first day of a m…
old
Javi Velasco 2016-10-15 21:26:50 +02:00 committed by GitHub
commit 6d596dce71
1 changed files with 2 additions and 1 deletions

View File

@ -20,8 +20,9 @@ class Day extends Component {
dayStyle () {
if (this.props.day === 1) {
const e = (this.props.sundayFirstDayOfWeek) ? 0 : 1;
const firstDay = time.getFirstWeekDay(this.props.viewDate) - e;
return {
marginLeft: `${(time.getFirstWeekDay(this.props.viewDate) - e) * 100 / 7}%`
marginLeft: `${ (firstDay >= 0 ? firstDay : 6) * 100 / 7 }%`
};
}
}