Skip to content

Commit

Permalink
fixed bugs and selectable week numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
rghorbani committed Mar 25, 2018
1 parent 768ad15 commit 893d9db
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,13 @@ Multi-Dot marking

Use markingType = 'multi-dot' if you want to display more than one dot. Both the Calendar and CalendarList control support multiple dots by using 'dots' array in markedDates. The property 'color' is mandatory while 'key' and 'selectedColor' are optional. If key is omitted then the array index is used as key. If selectedColor is omitted then 'color' will be used for selected dates.
```javascript
const vacation = {key:'vacation', color: 'red', selectedColor: 'blue'};
const massage = {key:'massage', color: 'blue', selectedColor: 'blue'};
const vacation = {key:'vacation', color: 'red'};
const massage = {key:'massage', color: 'blue'};
const workout = {key:'workout', color: 'green'};

<Calendar
markedDates={{
'2017-10-25': {dots: [vacation, massage, workout], selected: true},
'2017-10-25': {dots: [vacation, massage, workout], selected: true, selectedColor: 'red'},
'2017-10-26': {dots: [massage, workout], disabled: true},
}},
markingType={'multi-dot'}
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "react-native-general-calendars",
"version": "1.0.4",
"description": "React Native Calendar Components With support of Gregorian & Jalaali",
"version": "1.0.5",
"description": "React Native Calendar Components with support of Gregorian & Jalaali Calendars",
"main": "src/index.js",
"scripts": {
"start": "watchman watch-del-all && react-native start",
Expand Down
3 changes: 3 additions & 0 deletions src/calendar/day/multi-dot/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ class Day extends React.Component {
if (marking.selected) {
containerStyle.push(this.style.selected);
textStyle.push(this.style.selectedText);
if (marking.selectedColor) {
containerStyle.push({backgroundColor: marking.selectedColor});
}
} else if (typeof marking.disabled !== 'undefined' ? marking.disabled : this.props.state === 'disabled') {
textStyle.push(this.style.disabledText);
} else if (this.props.state === 'today') {
Expand Down
2 changes: 1 addition & 1 deletion src/calendar/header/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class CalendarHeader extends React.Component {
onPressRight() {
const {onPressArrowRight} = this.props;
if (typeof onPressArrowRight === 'function') {
return onPressArrowRight(this.substractMonth);
return onPressArrowRight(this.addMonth);
}
return this.addMonth();
}
Expand Down

0 comments on commit 893d9db

Please sign in to comment.