imports/vx/server/daemon/recordimporter.js
/**
     * Convert a value from string to its proper storage representation.
     *
     * @param {object} uploadStats Upload stats object.
     * @param {object} definition Import schema definition object.
     * @param {string} value Value to convert.
     * @return {?} Value converted into the proper type.
     */
Convert a value from string to its proper storage representation.
@param {object} uploadStats Upload stats object.
@param {object} definition Import schema definition object.
@param {string} value Value to convert.
@return {?} Value converted into the proper type.
Convert a value from string to its proper storage representation . @param { object } uploadStats Upload stats object . @param { object } definition Import schema definition object . @param { string } value Value to convert . @return { ? } Value converted into the proper type .
convertValue(uploadStats, definition, value) {
        if (definition.bindingType === "Date") {
            const timezone = Util.getUserTimezone(uploadStats.userId)
            value = value === "now" ? moment.tz(new Date(), timezone).format(definition.dateFormat) : value
            return Util.parsedValue(definition.bindingType, value, definition.dateFormat, timezone)
        }
        if (definition.bindingType === "Integer") {
            value = FX.integer.strip(value)
        }
        if (definition.bindingType === "Money") {
            value = FX.money.strip(value)
        }
        return Util.parsedValue(definition.bindingType, value)
    }
convertValue ( uploadStats , definition , value ) { if ( definition . bindingType === "Date" ) { const timezone = Util . getUserTimezone ( uploadStats . userId ) value = value === "now" ? moment . tz ( new Date ( ) , timezone ) . format ( definition . dateFormat ) : value return Util . parsedValue ( definition . bindingType , value , definition . dateFormat , timezone ) } if ( definition . bindingType === "Integer" ) { value = FX . integer . strip ( value ) } if ( definition . bindingType === "Money" ) { value = FX . money . strip ( value ) } return Util . parsedValue ( definition . bindingType , value ) }
Convert a value from string to its proper storage representation.
Convert a value from string to its proper storage representation .