Skip to content

Commit

Permalink
feat(calendar): add a way to chante text color of marked days
Browse files Browse the repository at this point in the history
  • Loading branch information
Tautvilas committed May 15, 2017
1 parent 806ef5a commit 8352c24
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions example/src/screens/calendars.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ export default class CalendarsScreen extends Component {
arrowColor: 'white'
}}
markedDates={{
'2012-05-08': [{textColor: '#666'}],
'2012-05-09': [{textColor: '#666'}],
'2012-05-24': [{startingDay: true, color: 'gray'}],
'2012-05-25': [{endingDay: true, color: 'gray'}]}}
hideArrows={false}
Expand Down
4 changes: 4 additions & 0 deletions src/calendar/unit-day/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class Day extends Component {
return {};
}
return marking.reduce((prev, next) => {
prev.textStyle = {};
if (next.quickAction) {
if (next.first || next.last) {
prev.containerStyle = this.style.firstQuickAction;
Expand Down Expand Up @@ -80,6 +81,9 @@ class Day extends Component {
color
};
}
if (next.textColor) {
prev.textStyle.color = next.textColor;
}
return prev;
}, {});
}
Expand Down

0 comments on commit 8352c24

Please sign in to comment.