[gnome-sound-recorder/bilelmoussaoui/release: 1/2] time: only display one digit for miliseconds
- From: Bilal Elmoussaoui <bilelmoussaoui src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-sound-recorder/bilelmoussaoui/release: 1/2] time: only display one digit for miliseconds
- Date: Fri, 18 Sep 2020 20:11:08 +0000 (UTC)
commit 5601cf72a50b95b603421ee9ef26ac2b7d36d3da
Author: Bilal Elmoussaoui <bil elmoussaoui gmail com>
Date: Fri Sep 18 22:10:18 2020 +0200
time: only display one digit for miliseconds
src/utils.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/src/utils.js b/src/utils.js
index 82cf504..b5d6b83 100644
--- a/src/utils.js
+++ b/src/utils.js
@@ -23,7 +23,7 @@ const { GLib, Gst } = imports.gi;
var formatTime = nanoSeconds => {
const time = new Date(0, 0, 0, 0, 0, 0, parseInt(nanoSeconds / Gst.MSECOND));
- const miliseconds = time.getMilliseconds().toString().padStart(2, '0').substring(0, 2);
+ const miliseconds = parseInt(time.getMilliseconds() / 100).toString();
const seconds = time.getSeconds().toString().padStart(2, '0');
const minutes = time.getMinutes().toString().padStart(2, '0');
const hours = time.getHours().toString().padStart(2, '0');
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]