How to use react-native-modal-datetime-picker - 2 common examples

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 = {
        ...propTypes,
        onChange: PropTypes.valueEvent,
        containerStyle: styleClass,
        mode: PropTypes.oneOf(["date", "datetime", "time"])

    };
    static defaultProps = {
        ...DatePicker.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 {
github subschema / subschema / subschema-native / src / types / Date.jsx View on Github external
import React, {PureComponent} from "react";
import {Text, TouchableHighlight, View} from "react-native";
import PropTypes from "subschema-prop-types";
import DatePicker from "react-native-modal-datetime-picker";
import {styleClass} from "../PropTypes";
import moment from "moment";

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

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

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

    };
    static defaultProps = {
        ...DatePicker.defaultProps,
        mode: 'date',
        setDateText: "Set Date",
        cancelTextIOS: "Cancel",

react-native-modal-datetime-picker

A react-native datetime-picker for Android and iOS

MIT
Latest version published 3 months ago

Package Health Score

86 / 100
Full package analysis