-export const formatDate = (isoDate: string) => {
- const date = new Date(isoDate);
- const text = date.toLocaleString();
- return text === 'Invalid Date' ? "" : text;
+import { PropertyValue } from "~/models/search-bar";
+import { Vocabulary, getTagKeyLabel, getTagValueLabel } from "~/models/vocabulary";
+
+export const formatDate = (isoDate?: string | null, utc: boolean = false) => {
+ if (isoDate) {
+ const date = new Date(isoDate);
+ let text: string;
+ if (utc) {
+ text = date.toUTCString();
+ }
+ else {
+ text = date.toLocaleString();
+ }
+ return text === 'Invalid Date' ? "(none)" : text;
+ }
+ return "(none)";