formatDataExport.js 318 Bytes
Newer Older
wuhao's avatar
wuhao committed
1 2 3 4 5 6 7 8 9 10 11
import moment from "moment";
export default function formatData(val, allValues, format) {
  let date = allValues[val] ? allValues[val] : [],
    formatType = format || "YYYY-MM-DD";
  if (date.length != 0) {
    return [
      moment(date[0]).format(formatType),
      moment(date[1]).format(formatType),
    ];
  }
}