Pad hours in 24 hour time
This commit is contained in:
1 parent
d837a1ffaa
commit
0036fa8afa
1 file changed
+1
-1
@@ -6,7 +6,7 @@ export default class DefaultClockComponent extends Component {
|
||||
@service clock;
|
||||
|
||||
get formattedTime() {
|
||||
const hours = this.clock.time.getHours();
|
||||
const hours = this.clock.time.getHours().toString().padStart(2, '0');
|
||||
const minutes = this.clock.time.getMinutes().toString().padStart(2, '0');
|
||||
return `${hours}:${minutes}`;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user