From 3f723aa82370eadb90a18ae97e15d0802bc6f88c Mon Sep 17 00:00:00 2001 From: tina <lt-bloody@riox.eu> Date: Sun, 10 Mar 2019 01:15:16 +0100 Subject: [PATCH] changes the first day of week to monday, calendar now also uses app text styling --- components/calendar.js | 7 +++++-- styles/index.js | 10 ++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/components/calendar.js b/components/calendar.js index 791654ae..6c4ec699 100644 --- a/components/calendar.js +++ b/components/calendar.js @@ -1,9 +1,9 @@ import React, { Component } from 'react' import { CalendarList } from 'react-native-calendars' -import {LocalDate} from 'js-joda' +import { LocalDate } from 'js-joda' import { getBleedingDaysSortedByDate } from '../db' import cycleModule from '../lib/cycle' -import {shadesOfRed} from '../styles/index' +import { shadesOfRed, calendarTheme } from '../styles/index' import styles from '../styles/index' import nothingChanged from '../db/db-unchanged' @@ -52,6 +52,9 @@ export default class CalendarView extends Component { ) } markingType={'custom'} + // If firstDay=1 week starts from Monday. Note that dayNames and dayNamesShort should still start from Sunday. + firstDay={1} + theme={calendarTheme} /> ) } diff --git a/styles/index.js b/styles/index.js index c0dac874..baa39373 100644 --- a/styles/index.js +++ b/styles/index.js @@ -26,6 +26,16 @@ const defaultIndentation = 10 const defaultTopMargin = 10 const colorInActive = '#666666' +export const calendarTheme = { + textDayFontFamily: textFont, + textMonthFontFamily: textFontBold, + textDayHeaderFontFamily: textFont, + textDayFontSize: regularSize, + textMonthFontSize: regularSize, + textDayHeaderFontSize: hintSize, + textSectionTitleColor: 'grey' +} + export default StyleSheet.create({ appText: { color: 'black', -- GitLab