error on invalid hours argument
parent
d7ae16d715
commit
46695b8236
3
index.js
3
index.js
|
@ -206,6 +206,9 @@ class App {
|
||||||
async update(sheetname, startDate, endDate, hours) { // set values in sheet
|
async update(sheetname, startDate, endDate, hours) { // set values in sheet
|
||||||
console.log("Setting data in", sheetname)
|
console.log("Setting data in", sheetname)
|
||||||
hours = +hours
|
hours = +hours
|
||||||
|
if (isNaN(hours)) {
|
||||||
|
throw "hours argument not a float or int"
|
||||||
|
}
|
||||||
const values = {
|
const values = {
|
||||||
regular: Math.min(hours, 80),
|
regular: Math.min(hours, 80),
|
||||||
overwork: Math.max(0, hours-80),
|
overwork: Math.max(0, hours-80),
|
||||||
|
|
Loading…
Reference in New Issue