Skip to content

Commit cbf050a

Browse files
author
Tautvilas Mecinskas
committed
feat: implement selected prop for period marking
fix: apply selected prop to agenda markings
1 parent 038a96d commit cbf050a

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

example/src/screens/agenda.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,18 @@ export default class AgendaScreen extends Component {
2323
renderItem={this.renderItem.bind(this)}
2424
renderEmptyDate={this.renderEmptyDate.bind(this)}
2525
rowHasChanged={this.rowHasChanged.bind(this)}
26-
//markingType={'interactive'}
27-
//markedDates={{
28-
// '2017-05-08': [{textColor: '#666'}],
29-
// '2017-05-09': [{textColor: '#666'}],
30-
// '2017-05-14': [{startingDay: true, color: 'blue'}, {endingDay: true, color: 'blue'}],
31-
// '2017-05-21': [{startingDay: true, color: 'blue'}],
32-
// '2017-05-22': [{endingDay: true, color: 'gray'}],
33-
// '2017-05-24': [{startingDay: true, color: 'gray'}],
34-
// '2017-05-25': [{color: 'gray'}],
35-
// '2017-05-26': [{endingDay: true, color: 'gray'}]}}
36-
// monthFormat={'yyyy'}
37-
// theme={{calendarBackground: 'red', agendaKnobColor: 'green'}}
26+
// markingType={'period'}
27+
// markedDates={{
28+
// '2017-05-08': {periods: [{textColor: '#666'}]},
29+
// '2017-05-09': {periods: [{textColor: '#666'}]},
30+
// '2017-05-14': {periods: [{startingDay: true, color: 'blue'}, {endingDay: true, color: 'blue'}]},
31+
// '2017-05-21': {periods: [{startingDay: true, color: 'blue'}]},
32+
// '2017-05-22': {periods: [{endingDay: true, color: 'gray'}]},
33+
// '2017-05-24': {periods: [{startingDay: true, color: 'gray'}]},
34+
// '2017-05-25': {periods: [{color: 'gray'}]},
35+
// '2017-05-26': {periods: [{endingDay: true, color: 'gray'}]}}}
36+
// monthFormat={'yyyy'}
37+
// theme={{calendarBackground: 'red', agendaKnobColor: 'green'}}
3838
//renderDay={(day, item) => (<Text>{day ? day.day: 'item'}</Text>)}
3939
/>
4040
);

src/agenda/index.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,8 +297,6 @@ export default class AgendaView extends Component {
297297
markings[key] = {marked: true};
298298
}
299299
});
300-
} else {
301-
return markings;
302300
}
303301
const key = this.state.selectedDay.toString('yyyy-MM-dd');
304302
return {...markings, [key]: {...(markings[key] || {}), ...{selected: true}}};

src/calendar/day/period/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ class Day extends Component {
6060
}
6161
if (this.props.marked.disabled) {
6262
defaultStyle.textStyle.color = this.theme.textDisabledColor;
63+
} else if (this.props.marked.selected) {
64+
defaultStyle.textStyle.color = this.theme.selectedDayTextColor;
6365
}
6466
const resultStyle = (marking.periods || []).reduce((prev, next) => {
6567
if (next.quickAction) {

0 commit comments

Comments
 (0)