Skip to content
Snippets Groups Projects
Commit feaa7dab authored by tina's avatar tina
Browse files

Merge branch '326-start-the-week-on-monday-in-calendar' into 'master'

changes the first day of week to monday, calendar now also uses app text styling

Closes #326

See merge request bloodyhealth/drip!194
parents 512250ef 3f723aa8
No related branches found
No related tags found
No related merge requests found
import React, { Component } from 'react' import React, { Component } from 'react'
import { CalendarList } from 'react-native-calendars' import { CalendarList } from 'react-native-calendars'
import {LocalDate} from 'js-joda' import { LocalDate } from 'js-joda'
import { getBleedingDaysSortedByDate } from '../db' import { getBleedingDaysSortedByDate } from '../db'
import cycleModule from '../lib/cycle' import cycleModule from '../lib/cycle'
import {shadesOfRed} from '../styles/index' import { shadesOfRed, calendarTheme } from '../styles/index'
import styles from '../styles/index' import styles from '../styles/index'
import nothingChanged from '../db/db-unchanged' import nothingChanged from '../db/db-unchanged'
...@@ -52,6 +52,9 @@ export default class CalendarView extends Component { ...@@ -52,6 +52,9 @@ export default class CalendarView extends Component {
) )
} }
markingType={'custom'} markingType={'custom'}
// If firstDay=1 week starts from Monday. Note that dayNames and dayNamesShort should still start from Sunday.
firstDay={1}
theme={calendarTheme}
/> />
) )
} }
......
...@@ -26,6 +26,16 @@ const defaultIndentation = 10 ...@@ -26,6 +26,16 @@ const defaultIndentation = 10
const defaultTopMargin = 10 const defaultTopMargin = 10
const colorInActive = '#666666' const colorInActive = '#666666'
export const calendarTheme = {
textDayFontFamily: textFont,
textMonthFontFamily: textFontBold,
textDayHeaderFontFamily: textFont,
textDayFontSize: regularSize,
textMonthFontSize: regularSize,
textDayHeaderFontSize: hintSize,
textSectionTitleColor: 'grey'
}
export default StyleSheet.create({ export default StyleSheet.create({
appText: { appText: {
color: 'black', color: 'black',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment