From d25ff6d704ac2312fbea01ae75d2fcaf9cf47c64 Mon Sep 17 00:00:00 2001 From: Yorick van Pelt Date: Fri, 1 Nov 2019 15:12:17 +0700 Subject: [PATCH] add 1:23 parsing, pdf review --- index.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index d4ce46d..26dd5e9 100644 --- a/index.js +++ b/index.js @@ -185,6 +185,8 @@ The total is ${total} to ${iban} (same as always). Thanks!` userId: 'me', media: {mimeType: 'message/rfc822', body: info.message} }) + console.log("Opening pdf for review") + await exec(`zathura "${pdf}" || mupdf "${pdf}"`) console.log(`Draft created, please review and send: https://mail.google.com/mail/u/${email}/#drafts?compose=${draft.data.message.id}`) } const datefmt = date => @@ -205,7 +207,13 @@ class App { } async update(sheetname, startDate, endDate, hours) { // set values in sheet console.log("Setting data in", sheetname) - hours = +hours + if (hours.indexOf && hours.indexOf(':') != -1) { + const [hour, min] = hours.split(':') + hours = +hour + hours += (+min) / 60 + } else { + hours = +hours + } if (isNaN(hours)) { throw "hours argument not a float or int" }