serialize-date-format.filter.ts 463 字节
/**
 * @description: 日期格式化
 * @author ChenRui
 * @date 2021/4/27 10:10
 */
function encode(value: string) {
  if (value) {
    const json_date = new Date(value).toJSON();
    return new Date(new Date(json_date).getTime() + 8 * 3600 * 1000)
      .toISOString()
      .replace(/T/g, " ")
      .replace(/\.[\d]{3}Z/, "");
  }
  return "";
}
const serializeDateFormat = (value: string) => {
  return encode(value);
};

export default serializeDateFormat;