[gnome-sound-recorder/wip/cdavis/typescript] utils: Turn closures into functions



commit 60ff501ebf2e76e0e1185867b896a04c58dce71c
Author: Christopher Davis <christopherdavis gnome org>
Date:   Tue Aug 23 19:37:22 2022 -0400

    utils: Turn closures into functions

 src/utils.ts | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/src/utils.ts b/src/utils.ts
index cf60a30..71fcc78 100644
--- a/src/utils.ts
+++ b/src/utils.ts
@@ -22,7 +22,7 @@ import Gettext from 'gettext'
 import GLib from 'gi://GLib'
 import Gst from 'gi://Gst'
 
-export const formatTime = (nanoSeconds: number) => {
+export function formatTime(nanoSeconds: number) {
     const time = new Date(0, 0, 0, 0, 0, 0, nanoSeconds / Gst.MSECOND);
 
     const miliseconds = (time.getMilliseconds() / 100).toString();
@@ -32,9 +32,9 @@ export const formatTime = (nanoSeconds: number) => {
 
     // eslint-disable-next-line no-irregular-whitespace
     return `${hours} ∶ ${minutes} ∶ ${seconds} . <small>${miliseconds}</small>`;
-};
+}
 
-export const displayDateTime = (time: GLib.DateTime) => {
+export function displayDateTime(time: GLib.DateTime) {
     const DAY = 86400000000;
     const now = GLib.DateTime.new_now_local();
     const difference = now.difference(time);
@@ -62,4 +62,4 @@ export const displayDateTime = (time: GLib.DateTime) => {
         return _('Last year');
 
     return Gettext.ngettext('%d year ago', '%d years ago', years).format(years);
-};
\ No newline at end of file
+}
\ No newline at end of file


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]