Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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 {
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",