Skip to content

Commit

Permalink
Bugfix and refactoring of TZ inclusion in reports, doing it this way …
Browse files Browse the repository at this point in the history
…applies the timezone to child components which display (but do not re-process) this value.
  • Loading branch information
dannon committed Oct 11, 2023
1 parent 351ba37 commit 8e624cb
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions client/src/components/Markdown/Markdown.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
</span>
</div>
<b-badge variant="info" class="w-100 rounded mb-3 white-space-normal">
<div class="float-left m-1 text-break">Generated with Galaxy {{ version }} on {{ time }} UTC</div>
<div class="float-left m-1 text-break">Generated with Galaxy {{ version }} on {{ time }}</div>
<div class="float-right m-1">Identifier: {{ markdownConfig.id }}</div>
</b-badge>
<div>
Expand Down Expand Up @@ -138,15 +138,22 @@ export default {
return this.enable_beta_markdown_export ? this.exportLink : null;
},
time() {
const generateTime = this.markdownConfig.generate_time;
let generateTime = this.markdownConfig.generate_time;
if (generateTime) {
if (!generateTime.endsWith("Z")) {
// We don't have tzinfo, but this will always be UTC coming
// from Galaxy so append Z to assert that prior to parsing
generateTime += "Z";
}
const date = new Date(generateTime);
return date.toLocaleString("default", {
day: "numeric",
month: "long",
year: "numeric",
minute: "numeric",
hour: "numeric",
timeZone: "UTC",
timeZoneName: "short",
});
}
return "unavailable";
Expand Down

0 comments on commit 8e624cb

Please sign in to comment.