Fix clock adding a 0 before the time

This commit is contained in:
Adam
2019-10-06 11:35:01 +02:00
committed by GitHub
parent 27fb91e9a9
commit 3c398df411

View File

@@ -23,7 +23,7 @@ export default class Clock extends React.Component {
if (h > 12) h = h - 12;
if (h < 12) this.setState({ date: '0' + h + ':' + m, ampm: ampm });
if (h < 12) this.setState({ date: h + ':' + m, ampm: ampm });
else this.setState({ date: h + ':' + m, ampm: ampm });
this.timeout = setTimeout(() => this.startTime(), 500);