Skip to content

Commit 6e98e45

Browse files
committed
Merge remote-tracking branch 'origin/main' into batched
2 parents 47d7290 + 4e2dd2d commit 6e98e45

File tree

4 files changed

+10
-4
lines changed

4 files changed

+10
-4
lines changed

.github/workflows/nextjs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
- name: Setup Node
5252
uses: actions/setup-node@v4
5353
with:
54-
node-version: "20"
54+
node-version: "22"
5555
cache: ${{ steps.detect-package-manager.outputs.manager }}
5656
- name: Setup Pages
5757
uses: actions/configure-pages@v5

.github/workflows/node.js.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
runs-on: ubuntu-latest
2525
strategy:
2626
matrix:
27-
node-version: [18.x, 20.x, 22.x]
27+
node-version: [20.x, 22.x, 24.x]
2828
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
2929

3030
steps:

app/components/Block.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ it("renders block with timestamp and shows timestamp value", () => {
171171
expect(
172172
container.querySelector(`#${aBlock.human_readable_name}_TIMESTAMP`)!
173173
.innerHTML,
174-
).toContain(new Date(expectedTimeStamp * 1000).toLocaleString());
174+
).toContain("11 Nov 2024, 16:20:22");
175175
});
176176

177177
it("renders block without SP and hides SP value", () => {

app/components/Block.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ import { useState } from "react";
55
const grafana_stub =
66
"https://shadow.nd.rl.ac.uk/grafana/d/wMlwwaHMk/block-history?viewPanel=2&orgId=1&var-block=";
77

8+
const date_format = new Intl.DateTimeFormat("en-GB", {
9+
dateStyle: "medium",
10+
timeStyle: "medium",
11+
timeZone: "Europe/London",
12+
});
13+
814
export default function Block({
915
pv,
1016
instName,
@@ -101,7 +107,7 @@ export default function Block({
101107
pv.updateSeconds > minimum_date_to_be_shown ? (
102108
<span id={pv.human_readable_name + "_TIMESTAMP"}>
103109
{/*Multiply by 1000 here as Date() expects milliseconds*/}
104-
{`Last update: ${new Date(pv.updateSeconds * 1000).toLocaleString()}`}
110+
{`Last update: ${date_format.format(pv.updateSeconds * 1000)}`}
105111
</span>
106112
) : null}
107113
</div>

0 commit comments

Comments
 (0)