Fixed issue with rendering calendar incorrectly when first day of a month is Sunday
parent
dd1d5d1466
commit
5cea4e3a1b
|
@ -20,8 +20,9 @@ class Day extends Component {
|
||||||
dayStyle () {
|
dayStyle () {
|
||||||
if (this.props.day === 1) {
|
if (this.props.day === 1) {
|
||||||
const e = (this.props.sundayFirstDayOfWeek) ? 0 : 1;
|
const e = (this.props.sundayFirstDayOfWeek) ? 0 : 1;
|
||||||
|
const firstDay = time.getFirstWeekDay(this.props.viewDate) - e;
|
||||||
return {
|
return {
|
||||||
marginLeft: `${(time.getFirstWeekDay(this.props.viewDate) - e) * 100 / 7}%`
|
marginLeft: `${ (firstDay >= 0 ? firstDay : 6) * 100 / 7 }%`
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue