Skip to content

Commit

Permalink
format times as HH:MM on 24h clock
Browse files Browse the repository at this point in the history
  • Loading branch information
Nate-Wessel committed Apr 12, 2024
1 parent 83adb3b commit 8db91fb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions frontend/src/timeRange.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ export class TimeRange extends Factor {
}
get name(){
if(this.#startTime || this.#endTime){
let start = this.#startTime?.toLocaleTimeString() ?? '???'
let end = this.#endTime?.toLocaleTimeString() ?? '???'
let options = { hour: "2-digit", minute: "2-digit", hour12: false }
let start = this.#startTime?.toLocaleTimeString('en-CA',options) ?? '???'
let end = this.#endTime?.toLocaleTimeString('en-CA',options) ?? '???'
return `From ${start} to ${end}`
}
return 'New Time Range'
Expand Down

0 comments on commit 8db91fb

Please sign in to comment.