import moment from 'moment'

export default function(dataStr, pattern = 'YYYY-MM-DD HH:mm:ss') {
  if (!dataStr) return ''
  if (!moment.isMoment(dataStr)) dataStr = moment(dataStr)
  return dataStr.format(pattern)
}
