Skip to content

Commit 82b92f0

Browse files
committed
NXT-4230: Use datetime utils from webapps-common
NXT-4230 (WebUI for "Change Component Link Version")
1 parent 1f8b34d commit 82b92f0

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

org.knime.ui.js/src/components/workflowEditor/ChangeHubItemVersionModal.vue

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
KdsModal,
88
KdsRadioButtonGroup,
99
} from "@knime/kds-components";
10-
import { formatDateString } from "@knime/utils";
10+
import { formatDateTimeString } from "@knime/utils";
1111
1212
import {
1313
ItemVersion,
@@ -75,12 +75,9 @@ const formatCreatedOn = (createdOnValue: string | Date) => {
7575
createdOnValue instanceof Date ? null : createdOnValue.trim();
7676
return rawValue ? `Created on ${rawValue}` : "Created on unknown date";
7777
}
78-
const dateLabel = formatDateString(date.toISOString());
79-
const timeLabel = new Intl.DateTimeFormat([], {
80-
hour: "numeric",
81-
minute: "2-digit",
82-
}).format(date);
83-
return `Created on ${dateLabel}, ${timeLabel}`;
78+
const dateInput =
79+
createdOnValue instanceof Date ? date.getTime() : createdOnValue;
80+
return `Created on ${formatDateTimeString(dateInput)}`;
8481
};
8582
8683
const dropdownOptions = computed<DropdownOption[]>(() =>

0 commit comments

Comments
 (0)