// 时间格式化
function formatTime(date, month_str, minute_str) {
  if (!date) {
    return 0
  }
  date = date.replace(getRegExp('-', 'g'), '/');
  var _date = null;
  _date = getDate(date);
  var year = _date.getFullYear();
  var month = _date.getMonth() + 1;
  var day = _date.getDate();
  var hour = _date.getHours();
  var minute = _date.getMinutes();
  var second = _date.getSeconds();
  return [year, month, day].map(formatNumber).join(month_str || '/') + ' ' + [hour, minute].map(formatNumber).join(minute_str || ':');
}

function formatNumber(n) {
  n = n.toString()
  return n[1] ? n : '0' + n
}
module.exports = {
  formatTime: formatTime
};