How to use the react-native-modal-datetime-picker.defaultProps function in react-native-modal-datetime-picker

To help you get started, we’ve selected a few react-native-modal-datetime-picker examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github subschema / subschema / subschema-native / src / types / Date.jsx View on Github external
import moment from "moment";

const {onConfirm, onCancel, ...propTypes} = DatePicker.propTypes;

export default class DateInputType extends PureComponent {
    static displayName = 'Date';

    static propTypes = {
        onChange: PropTypes.valueEvent,
        containerStyle: styleClass,
        mode: PropTypes.oneOf(["date", "datetime", "time"])

    static defaultProps = {
        mode: 'date',
        setDateText: "Set Date",
        cancelTextIOS: "Cancel",
        confirmTextIOS: "Confirm",
        format: "dddd, MMMM Do YYYY, h:mm:ss a"
    state = {
        visible: false

    valueAsDate(value) {
        if (value == null) {
            this._date = new Date();
        } else if (this.props.value instanceof Date) {
            return this._date = value;
        } else {


A react-native datetime-picker for Android and iOS

Latest version published 1 month ago

Package Health Score

88 / 100
Full package analysis