Skip to content

Commit

Permalink
fixes piggz#432: avoid padStart on SailfishOS
Browse files Browse the repository at this point in the history
  • Loading branch information
jmlich committed Nov 29, 2024
1 parent 847a2b9 commit 6b0f78a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ui/qml/pages/SleepPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,10 @@ PagePL {
function decimalToHourMin(decTime) {
var totalMinutes = Math.round(decTime * 60);
var hours = Math.floor(totalMinutes / 60);
var minutes = (totalMinutes % 60).toString().padStart(2, '0');
var minutes = (totalMinutes % 60);
if (minutes < 10) {
return hours + ":0" + minutes;
}

return hours + ":" + minutes;
}
Expand Down

0 comments on commit 6b0f78a

Please sign in to comment.