Sfoglia il codice sorgente

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

tags/Baseline_30082024_FRONTEND_UAT
leoho2fi 1 anno fa
parent
commit
d85af62bba
1 ha cambiato i file con 9 aggiunte e 0 eliminazioni
  1. +9
    -0
      src/app/utils/formatUtil.ts

+ 9
- 0
src/app/utils/formatUtil.ts Vedi File

@@ -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}`;
}

Caricamento…
Annulla
Salva