How to use the @form-create/utils.timeStampToDate function in @form-create/utils

To help you get started, we’ve selected a few @form-create/utils 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 xaboy / form-create / packages / iview / src / parsers / datePicker / parser.js View on Github external
init() {
        let props = this.rule.props;
        if ((props.startDate))
            $set(props, 'startDate', timeStampToDate(props.startDate));
    }
github xaboy / form-create / packages / iview / src / components / datePicker / handler.js View on Github external
init() {
        let props = this.rule.props;

        $set(props, 'type', !props.type
            ? 'date'
            : toString(props.type).toLowerCase());

        if (isUndef(props.startDate))
            $set(props, 'startDate', timeStampToDate(props.startDate));
    }
github xaboy / form-create / packages / iview / src / components / timePicker / handler.js View on Github external
toFormValue(value) {
        let parseValue, isArr = Array.isArray(value);
        if ('timerange' === this.rule.props.type) {
            if (isArr) {
                parseValue = value.map((time) => !time ? '' : getTime(timeStampToDate(time)));
            } else {
                parseValue = ['', ''];
            }
        } else {
            isArr && (value = value[0]);
            parseValue = !value ? '' : getTime(timeStampToDate(value));
        }
        return parseValue;
    }
github xaboy / form-create / packages / iview / src / components / datePicker / handler.js View on Github external
toFormValue(value) {
        let isArr = Array.isArray(value), props = this.rule.props, parseValue;
        if (['daterange', 'datetimerange'].indexOf(props.type) !== -1) {
            if (isArr) {
                parseValue = value.map((time) => !time ? '' : timeStampToDate(time));
            } else {
                parseValue = ['', '']
            }
        } else if ('date' === props.type && props.multiple === true) {
            parseValue = toString(value);
        } else {
            parseValue = isArr ? (value[0] || '') : value;
            parseValue = !parseValue ? '' : timeStampToDate(parseValue);
        }
        return parseValue;
    }
github xaboy / form-create / packages / element-ui / src / parsers / timePicker / parser.js View on Github external
toFormValue(value) {
        let parseValue, isArr = Array.isArray(value);
        if (this.rule.props.isRange === true) {
            if (isArr) {
                parseValue = value.map((time) => !time ? '' : toDate(getTime(timeStampToDate(time))));
            } else {
                parseValue = null;
            }
        } else {
            isArr && (value = value[0]);
            parseValue = !value ? null :  toDate(getTime(timeStampToDate(value)));
        }
        return parseValue;
    }
github xaboy / form-create / packages / element-ui / src / parsers / timePicker / parser.js View on Github external
                parseValue = value.map((time) => !time ? '' : toDate(getTime(timeStampToDate(time))));
            } else {
github xaboy / form-create / packages / iview / src / components / timePicker / handler.js View on Github external
                parseValue = value.map((time) => !time ? '' : getTime(timeStampToDate(time)));
            } else {
github xaboy / form-create / packages / iview / src / components / datePicker / handler.js View on Github external
                parseValue = value.map((time) => !time ? '' : timeStampToDate(time));
            } else {