react-native-calendars icon indicating copy to clipboard operation
react-native-calendars copied to clipboard

Same background color in numbers of calendar and week header

Open Phector27 opened this issue 2 years ago • 6 comments

Hi!

First, I hope you a nice day to all.

Description

How to get same background in numbers of calendar and week header

Expected Behavior

Could put the same background color on week days and numbers but different on months.

Screenshots

Actually I only can(know) change the background color of week row:

actual

But I need some like this:

objetivo

Last image I got it with a absolute position of View component, but when I make scroll, the absolute position of view dont move (obviusly).

How could I change only the background of the week days and numbers of calendar like last screenshoot?

Here my <CalendartList /> code:

      <CalendarList
        firstDay={1}
        markedDates={selectedDays}
        onDayPress={_onDayPress}
        pastScrollRange={1}
        futureScrollRange={1}
        scrollEnabled={true}
        showScrollIndicator={false}
        theme={{
          backgroundColor: '#FF7066', // Not change nothing
          calendarBackground: 'transparent', // If change it, change all calendar bg
          textSectionTitleColor: '#FFF',
          selectedDayBackgroundColor: 'transparent',
          selectedDayTextColor: '#FFF',
          todayTextColor: '#FFF',
          todayBackgroundColor: '#FF7066',
          dayTextColor: 'gray', //Disabled days
          dotColor: '#FF7066',
          selectedDotColor: '#FFF',
          monthTextColor: '#FFF',
          textDayFontWeight: '300',
          textMonthFontWeight: 'bold',
          textDayHeaderFontWeight: '300',
          'stylesheet.calendar.header': {
            header: {
              flexDirection: 'row',
              justifyContent: 'flex-start',
              alignItems: 'center',
            },
            week: {
              marginTop: 20,
              flexDirection: 'row',
              justifyContent: 'space-between',
              backgroundColor: 'rgba(125,125,125,0.25)', //Here I can change only the background week days
            },
          },
          textDayFontSize: 14,
          textMonthFontSize: 16,
          textDayHeaderFontSize: 14,
        }}
      >

Thanks!!

Phector27 avatar Oct 14 '21 10:10 Phector27

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jan 13 '22 00:01 stale[bot]

Hi again. Any solution?

Thanks!!

Phector27 avatar Jan 13 '22 08:01 Phector27

Hi again. Any solution?

Thanks!!

glushkina1 avatar Feb 06 '22 18:02 glushkina1

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jun 03 '22 23:06 stale[bot]

Nothing guys? Im trying all to make this changes but impossible

Phector27 avatar Jun 04 '22 06:06 Phector27

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Sep 04 '22 17:09 stale[bot]

As far as i got it should be marked like this ['stylesheet.calendar.header'] and it doesn't has the option for header, only week and if you want to change de color of the main header you code headerStyle out of the theme like

headerStyle={{ backgroundColor: 'black', }} theme={{ ['stylesheet.calendar.header']: { week: { marginTop: 20, flexDirection: 'row', justifyContent: 'space-between', backgroundColor: 'rgba(125,125,125,0.25)', //Here I can change only the background week days }, },...

         probably it has to be with markingType: 'custom' and the week color will overlap the headerStyle.

cmerick avatar May 09 '23 14:05 cmerick

        theme={{
          stylesheet: {
            calendar: {
              main: {
                container: {
                  backgroundColor: 'green',
                },
              },
            },
          },
        }}

mjroeleveld avatar Sep 22 '23 09:09 mjroeleveld

Hi again. Any solution?

Thanks!!

george-eucare avatar Nov 03 '23 07:11 george-eucare