Add label to timeline marker with current time.

This commit is contained in:
Dermot Duffy
2023-04-15 09:31:05 -07:00
parent 6ea7c7d260
commit 91f6f48696
4 changed files with 69 additions and 15 deletions
+2 -2
View File
@@ -114,8 +114,8 @@ export const isHoverableDevice = (): boolean =>
* @param date A Date object.
* @returns A date and time.
*/
export const formatDateAndTime = (date: Date): string => {
return format(date, 'yyyy-MM-dd HH:mm');
export const formatDateAndTime = (date: Date, includeSeconds?: boolean): string => {
return format(date, `yyyy-MM-dd HH:mm${includeSeconds ? ':ss' : ''}`);
};
/**