import moment from 'moment';
import isNil from '../isNil';
const parseValueToMoment = (value, formatter) => {
  if (isNil(value) || moment.isMoment(value)) {
    return value;
  }
  if (Array.isArray(value)) {
    return value.map(v => parseValueToMoment(v, formatter));
  }
  return moment(value, formatter);
};
export default parseValueToMoment;