/**
 * parseTime.js
 *
 * @Author: apple
 * @Date: 2018/6/1 18:16
 */

var parseTime = function parseTime(defaultValue) {
    var format = function format(time) {
        if (time && (typeof time === 'string' || typeof time === 'number')) {
            var parseNumber = parseInt(time, 10);
            if (parseNumber < 10) {
                parseNumber = '0' + parseNumber;
            }
            return parseNumber;
        }
    };
    if (Array.isArray(defaultValue)) {
        var formatList = defaultValue.map(function (time) {
            return format(time);
        });
        return formatList;
    } else {
        return format(defaultValue);
    }
};

export default parseTime;