Client - date formatting refactoring (WIP)

This commit is contained in:
Sam
2022-11-01 08:03:47 +01:00
parent 3777ac0a11
commit 6fce510a0a
9 changed files with 99 additions and 31 deletions

View File

@ -78,3 +78,14 @@ export const formatWorkoutDate = (
workout_time: format(dateTime, timeFormat),
}
}
export const formatDate = (
dateString: string,
timezone: string,
dateFormat: string,
withTime = true
): string =>
format(
getDateWithTZ(dateString, timezone),
`${dateFormat}${withTime ? ' HH:mm' : ''}`
)