浏览代码

Merge branch 'main' of https://git.2fi-solutions.com/wayne.lee/tsms

tags/Baseline_30082024_FRONTEND_UAT
leoho2fi 1年前
父节点
当前提交
d85af62bba
共有 1 个文件被更改,包括 9 次插入0 次删除
  1. +9
    -0
      src/app/utils/formatUtil.ts

+ 9
- 0
src/app/utils/formatUtil.ts 查看文件

@@ -51,3 +51,12 @@ export function convertLocaleStringToNumber(numberString: string): number {
const numberWithoutCommas = numberString.replace(/,/g, "");
return parseFloat(numberWithoutCommas);
}

export function timestampToDateString(timestamp: string): string {
const date = new Date(timestamp);
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, "0");
const day = String(date.getDate()).padStart(2, "0");
console.log(`${year}-${month}-${day}`)
return `${year}-${month}-${day}`;
}

正在加载...
取消
保存