Browse Source

error on invalid hours argument

master
Yorick van Pelt 1 year ago
parent
commit
46695b8236
Signed by: yorick <yorick@yorickvanpelt.nl> GPG Key ID: A36E70F9DC014A15
1 changed files with 3 additions and 0 deletions
  1. +3
    -0
      index.js

+ 3
- 0
index.js View File

@@ -206,6 +206,9 @@ class App {
async update(sheetname, startDate, endDate, hours) { // set values in sheet
console.log("Setting data in", sheetname)
hours = +hours
if (isNaN(hours)) {
throw "hours argument not a float or int"
}
const values = {
regular: Math.min(hours, 80),
overwork: Math.max(0, hours-80),


Loading…
Cancel
Save