Skip to content

Commit fe81ab8

Browse files
committed
Use user locale for time
1 parent 7d631f4 commit fe81ab8

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

dev/index.html

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -206,11 +206,10 @@ <h1>
206206
const run = data.workflow_runs?.[0];
207207
if (!run) return;
208208
const date = new Date(run.created_at);
209-
const formatted = date.toLocaleDateString('en-US', { year: 'numeric', month: 'short', day: 'numeric' });
210-
const time = date.toLocaleTimeString('en-US', { hour: '2-digit', minute: '2-digit' });
209+
const formatter = new Intl.DateTimeFormat(undefined, { year: 'numeric', month: 'short', day: 'numeric', hour: '2-digit', minute: '2-digit' });
211210
const buildLink = document.getElementById('js-build-number');
212211
buildLink.href = run.html_url;
213-
buildLink.textContent = `Build #${run.run_number} \u2014 ${formatted} ${time}`;
212+
buildLink.textContent = `Build #${run.run_number} \u2014 ${formatter.format(date)}`;
214213
document.getElementById('js-build-title').textContent = run.display_title;
215214
})
216215
.catch((e) => {

0 commit comments

Comments
 (0)