diff options
author | Bob Zeleznik <zzzman@gmail.com> | 2019-09-06 01:41:06 -0400 |
---|---|---|
committer | Bob Zeleznik <zzzman@gmail.com> | 2019-09-06 01:41:06 -0400 |
commit | e5b52b1083c86b946a2758983e397826579d2282 (patch) | |
tree | 1e4f0e9fdc40cbb6db2c07dfcc8b3e8cbb5c2fc6 /src/Utils.ts | |
parent | a936f08e3c18ad34bbe74133eaa768c7bda832dc (diff) |
fixed summarizing in text notes.
Diffstat (limited to 'src/Utils.ts')
-rw-r--r-- | src/Utils.ts | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/Utils.ts b/src/Utils.ts index 959b89fe5..f805ae872 100644 --- a/src/Utils.ts +++ b/src/Utils.ts @@ -133,6 +133,20 @@ export function WithKeys(obj: any, keys: string[], addKeyFunc?: (dup: any) => vo return dup; } +export function timenow() { + var now = new Date(); + let ampm = 'am'; + let h = now.getHours(); + let m: any = now.getMinutes(); + let s: any = now.getSeconds(); + if (h >= 12) { + if (h > 12) h -= 12; + ampm = 'pm'; + } + if (m < 10) m = '0' + m; + return now.toLocaleDateString() + ' ' + h + ':' + m + ' ' + ampm; +} + export function numberRange(num: number) { return Array.from(Array(num)).map((v, i) => i); } export function returnTrue() { return true; } |