From cddded242d15bacb5641992707bf46420f2ae709 Mon Sep 17 00:00:00 2001 From: Pau Date: Tue, 13 Jun 2017 12:53:55 +0200 Subject: [PATCH] Style selected day on change month or year When changing month or year, the selected day was not being styled. This caused confusion because it was not the expected behavior by most of the users. Now, the selected day will still be selected on changing months or years. --- index.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/index.js b/index.js index 68c440d..8fe2431 100644 --- a/index.js +++ b/index.js @@ -124,11 +124,7 @@ export default class Calendar extends PureComponent { renderCalendarDay(index, dateNumber) { const weekDay = (index + this.props.weekFirstDay) % 7; const isWeekend = weekDay === 0 || weekDay === 6; - - const today = new Date(); - const isToday = this.props.date.getDate() === dateNumber && - this.props.date.getMonth() === today.getMonth() && - this.props.date.getFullYear() === today.getFullYear(); + const isToday = this.props.date.getDate() === dateNumber return ( @@ -269,4 +265,4 @@ const styles = StyleSheet.create({ schadedText: { color: "#AAAAAA", } -}); \ No newline at end of file +});