Date Number Style and Day Number Style not working.
See original GitHub issueBoth the Day and Date Number styles seem to be not working and I cannot figure out why.
I am trying to make the style responsive to a dark/light background. But the text color is black whether the background is black or white.
I have checked on text_color below via the console to make sure it isn’t a tinycolor issue. And used a direct string value for color: {color: 'red'}
- neither are working.
Here’s my component:
import React, {Component} from 'react';
import { View } from 'react-native';
import CalendarStrip from 'react-native-calendar-strip';
import {AppContext} from './ContextProvider';
import tinycolor from 'tinycolor2';
class CalStrip extends Component {
render() {
const {header_color} = this.props;
var color1 = tinycolor(header_color);
var text_color = color1.isDark() ? '#fff' : '#000';
return (
<View>
<AppContext.Consumer>
{(context) =>
<CalendarStrip
calendarAnimation={{type: 'sequence', duration: 10}}
daySelectionAnimation={{type: 'border', duration: 200, borderWidth: 1, borderHighlightColor: text_color}}
style={{height: 100, paddingTop: 20, paddingBottom: 10}}
calendarHeaderStyle={{color: text_color}}
calendarColor={color1.toHexString()}
dateNumberStyle={{color: text_color}} // Not working XXX
dateNameStyle={{color: text_color}} // Not working XXX
highlightDateNumberStyle={{color: text_color}}
highlightDateNameStyle={{color: text_color}}
disabledDateNameStyle={{color: 'grey'}}
disabledDateNumberStyle={{color: 'grey'}}
iconContainer={{flex: 0.1}}
onDateSelected={(value) => context.setDate(value)}
selectedDate={context.date}
/>
}
</AppContext.Consumer>
</View>
)
}
}
export default CalStrip;
And this is what the output looks like:
Issue Analytics
- State:
- Created 5 years ago
- Comments:10
Top Results From Across the Web
Format numbers as dates or times - Microsoft Support
In the Category box, click Date or Time, and then choose the number format that is closest in style to the one you...
Read more >How to Fix Excel Dates That Won't Change Format - Contextures
How to fix Excel dates that will not change format. Fix dates that end up in the wrong order when sorted. Use built-in...
Read more >6 Ways to Fix Dates Formatted as Text in Excel
6 ways to fix dates formatted ast text in Excel, plus a bonus technique using Power Query to fix various formats.
Read more >Excel date formatting NOT working? Dates not sorting in Excel?
If you are having date format or sort issues in Excel ( dates sort by months instead of day of month, you can't...
Read more >Excel Date Format Won't Change - YouTube
... file: https://www.bluepecantraining.com/excel- date - format -wont-change-i-cant-change-excel- date - format /In this video I explore a problem.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
1.3.5 has been published. Apologies for the delay
A new prop needs to be added to set the container’s style. Please open a new issue, or submit a PR that adds a
highlightDateContainerStyle
.https://github.com/BugiDev/react-native-calendar-strip/blob/686bdb501dd5c993c6eb7021a4967736b6579353/src/CalendarDay.js#L454