|
@@ -51,3 +51,12 @@ export function convertLocaleStringToNumber(numberString: string): number { |
|
|
const numberWithoutCommas = numberString.replace(/,/g, ""); |
|
|
const numberWithoutCommas = numberString.replace(/,/g, ""); |
|
|
return parseFloat(numberWithoutCommas); |
|
|
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}`; |
|
|
|
|
|
} |