add brands & models and some polishing

This commit is contained in:
Carl-Gerhard Lindesvärd
2024-06-26 22:29:41 +02:00
parent f615278189
commit a0c8199474
6 changed files with 93 additions and 5 deletions

View File

@@ -45,3 +45,10 @@ const ta = new TimeAgo(getLocale());
export function timeAgo(date: Date, style?: FormatStyleName) {
return ta.format(new Date(date), style);
}
export function utc(date: string) {
if (date.match(/^\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}:\d{2}.\d{3}$/)) {
return new Date(`${date}Z`);
}
return new Date(date).toISOString();
}