import { YYYYMMDDHHmmss } from "@/constants/constants";
import moment from "moment";

export function dateFormatForAPI(date) {
  return moment(date).format(YYYYMMDDHHmmss);
}

export function formatEmptyToNull(obj) {
  Object.keys(obj).forEach(key => {
    obj[key] = obj[key] === "" || obj[key] === undefined ? null : obj[key];
  });
  return obj;
}
