diff --git a/client/src/components/Markdown/Elements/InvocationTime.vue b/client/src/components/Markdown/Elements/InvocationTime.vue index 63355884e82d..b335bb377974 100644 --- a/client/src/components/Markdown/Elements/InvocationTime.vue +++ b/client/src/components/Markdown/Elements/InvocationTime.vue @@ -19,7 +19,7 @@ export default { computed: { content() { const invocation = this.invocations[this.args.invocation_id]; - return invocation && invocation["create_time"]; + return invocation && new Date(invocation["create_time"]).toUTCString(); }, }, }; diff --git a/lib/galaxy/managers/markdown_util.py b/lib/galaxy/managers/markdown_util.py index 4e5219251ccc..e76501b7dc0f 100644 --- a/lib/galaxy/managers/markdown_util.py +++ b/lib/galaxy/managers/markdown_util.py @@ -347,7 +347,9 @@ def handle_generate_time(self, line, generate_time): pass def handle_invocation_time(self, line, invocation): - self.ensure_rendering_data_for("invocations", invocation)["create_time"] = invocation.create_time.isoformat() + self.ensure_rendering_data_for("invocations", invocation)["create_time"] = invocation.create_time.strftime( + "%Y-%m-%d, %H:%M:%S" + ) def handle_dataset_type(self, line, hda): self.extend_history_dataset_rendering_data(hda, "ext", hda.ext, "*Unknown dataset type*") @@ -547,7 +549,7 @@ def handle_generate_time(self, line, generate_time): return (content, True) def handle_invocation_time(self, line, invocation): - content = literal_via_fence(invocation.create_time.isoformat()) + content = literal_via_fence(invocation.create_time.strftime("%Y-%m-%d, %H:%M:%S")) return (content, True) def handle_dataset_name(self, line, hda): diff --git a/test/unit/app/managers/test_markdown_export.py b/test/unit/app/managers/test_markdown_export.py index 64c4df408d47..72f5b900a5d7 100644 --- a/test/unit/app/managers/test_markdown_export.py +++ b/test/unit/app/managers/test_markdown_export.py @@ -280,7 +280,8 @@ def test_generate_invocation_time(self): invocation = self._new_invocation() self.app.workflow_manager.get_invocation.side_effect = [invocation] # type: ignore[attr-defined,union-attr] result = self._to_basic(example) - assert f"\n {invocation.create_time.isoformat()}" in result + expectedtime = invocation.create_time.strftime("%Y-%m-%d, %H:%M:%S") + assert f"\n {expectedtime}" in result def test_job_parameters(self): job = model.Job() @@ -412,7 +413,9 @@ def test_get_invocation_time(self): result, extra_data = self._ready_export(example) assert "invocations" in extra_data assert "create_time" in extra_data["invocations"]["be8be0fd2ce547f6"] - assert extra_data["invocations"]["be8be0fd2ce547f6"]["create_time"] == invocation.create_time.isoformat() + assert extra_data["invocations"]["be8be0fd2ce547f6"]["create_time"] == invocation.create_time.strftime( + "%Y-%m-%d, %H:%M:%S" + ) def _ready_export(self, example): return ready_galaxy_markdown_for_export(self.trans, example)