const wx2my = require('../wx2my');
const Behavior = require('../Behavior');
function date(time, format) {
  var date = getDate(time); // console.log(date);

  return date.getFullYear() + '-' + date.getMonth() + 1 + '-' + date.getDate() + ' ' + date.getHours() + ':' + date.getMinutes() + ':' + date.getSeconds();
}

function numberFormat(val, d) {
  if (val) {
    return val.toFixed(d || 2);
  } else {
    return '0.00';
  }
}

function handerNickName(nickName, limitLength) {
  if (nickName && nickName.length > limitLength) {
    return nickName.slice(0, limitLength) + '...';
  }

  return nickName || '';
}

module.exports = {
  numberFormat: numberFormat,
  date: date,
  handerNickName: handerNickName
};