question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Dates and months not visible

See original GitHub issue
  react: 16.8.6 => 16.8.6 
  react-native: ^0.59.3 => 0.59.10 

iOS 13.1.2

  • iOS:
  • react-native-modal-datetime-picker:

Description

I have been using react-native-modal-datetime-picker for a long time without any problem. But now I got a problem with the date picker. The dates and months are not visible. I am attaching a screenshot of the issue.

Reproducible Demo

` import React, {Component} from “react”; import {StyleSheet, TouchableOpacity, View} from “react-native”; import {connect} from “react-redux”; import {Text} from “native-base”; import * as Strings from “…/…/utils/Strings”; import DateTimePicker from ‘react-native-modal-datetime-picker’;

class DatePickerField extends Component { constructor(props) { super(props); this.state = { isDateTimePickerVisible: false, }; }

showDateTimePicker = () => {
    this.setState({isDateTimePickerVisible: true})
};
hideDateTimePicker = () => this.setState({isDateTimePickerVisible: false});


handleDatePicked = (date) => {
    this.hideDateTimePicker(date);
    this.props.onDateChange(date);

};

render() {
    return (
        <View style={styles.containerStyle}>
            {
                    <Text
                        style={[styles.labelStyle, {color: this.props.textLabelColor}]}>{this.props.textLabel}</Text>
            }
            <TouchableOpacity onPress={this.showDateTimePicker.bind(this)}
                              style={[styles.dateContainerStyle, this.props.backgroundContainerStyle]}>
                <Text style={[styles.dateTextStyle, this.props.placeholderTextStyle]}>
                    {convertDate(this.props.date)}
                </Text>
            </TouchableOpacity>
            <DateTimePicker
                titleIOS={Strings.DATE}
                isVisible={this.state.isDateTimePickerVisible}
                date={this.props.date}
                onConfirm={this.handleDatePicked}
                onCancel={this.hideDateTimePicker}
            />
        </View>
    );
}

}

const styles = StyleSheet.create({ containerStyle: { flex: 1, flexDirection: ‘column’, }, labelStyle: { fontSize: 12, alignSelf: ‘flex-start’, }, dateContainerStyle: { borderRadius: 12, backgroundColor: ‘#FFFFFF29’, height: 38, alignItems: ‘center’, paddingLeft: 8, paddingRight: 8, flexDirection: ‘row’, alignSelf: ‘flex-start’, marginTop: 4 }, dropDownIconStyle: { justifyContent: ‘flex-end’ }, dateTextStyle: { color: ‘#FFFFFF70’, flex: 1 } });

function convertDate(inputFormat) { function pad(s) { return (s < 10) ? ‘0’ + s : s; }

let date = new Date(inputFormat);
return [pad(date.getDate()), pad(date.getMonth() + 1), date.getFullYear()].join('/');

}

const mapStateToProps = state => ({});

export default connect(mapStateToProps, {})(DatePickerField); IMG_05C76EBA2BAD-1

`

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:13 (2 by maintainers)

github_iconTop GitHub Comments

12reactions
schumanndcommented, Oct 15, 2019

I found a solution (see my SO article)

Add this to your Info.plist

<key>UIUserInterfaceStyle</key>
<string>Light</string>
4reactions
spyshowercommented, Nov 8, 2019

Any solution for Expo?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Pivot table displays only month of full date - can't ...
Hi. I have created a pivot table from a data set. One of the fields in the data set is a date field...
Read more >
Display Missing Dates in Excel PivotTables
Right-click one of the date row labels in the PivotTable > select Group > Days and Months: · Next right-click one of the...
Read more >
Date not Showing Month Name in Visuals?
My visuals aren't showing the month name and I don't know why. ... In the other view it just shows a day range...
Read more >
Excel PivotTable - show months with no data - YouTube
Excel Pivot Tables only show months that have data. When you create a Pivot Table with months, some months may disappear since there...
Read more >
Date Range Slider not showing complete months
Hi Johan, thank you. I looked at your workbook. Unfortunately this doesn't solve the problem. For example, select a date range with the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found