Skip to content

Commit

Permalink
Format timestamps in markdown output for pdf/html consistently to inc…
Browse files Browse the repository at this point in the history
…lude UTC
  • Loading branch information
dannon committed Dec 10, 2024
1 parent 3580e95 commit 84ce5e7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/galaxy/managers/markdown_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,9 @@ class ToBasicMarkdownDirectiveHandler(GalaxyInternalMarkdownDirectiveHandler):
def __init__(self, trans):
self.trans = trans

def _format_printable_time(self, time):
return time.strftime("%Y-%m-%d, %H:%M:%S UTC")

def handle_dataset_display(self, line, hda):
name = hda.name or ""
markdown = "---\n"
Expand Down Expand Up @@ -687,7 +690,7 @@ def handle_generate_galaxy_version(self, line, generate_version):
return (content, True)

def handle_generate_time(self, line, generate_time):
content = literal_via_fence(generate_time.isoformat())
content = literal_via_fence(self._format_printable_time(generate_time))
return (content, True)

def handle_instance_access_link(self, line, url):
Expand Down Expand Up @@ -720,7 +723,7 @@ def _handle_link(self, url, title=None):
return (f"[{title}]({url})", True)

def handle_invocation_time(self, line, invocation):
content = literal_via_fence(invocation.create_time.isoformat())
content = literal_via_fence(self._format_printable_time(invocation.create_time))
return (content, True)

def handle_dataset_name(self, line, hda):
Expand Down

0 comments on commit 84ce5e7

Please sign in to comment.