Push-Zeitmail: Zeit nur in 15-Minuten-Schritten
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
7da4452bbd
commit
88854aa2b4
4 files changed
+33
-14
No files matched your search
@@ -37,13 +37,16 @@ export function needsTimeEntry(ws) {
|
||||
return ws?.serviceType === 'GIT' && !(ws.startTime && Number(ws.totalTime) > 0)
|
||||
}
|
||||
|
||||
/** Ganze Minuten 1-720 aus Formular/Query, sonst null */
|
||||
/** Zeiten nur in 15-Minuten-Schritten (wie WOMS lib/timeSteps.js) */
|
||||
export const TIME_STEP = 15
|
||||
|
||||
/** 15-720 in 15er-Schritten aus Formular/Query, sonst null */
|
||||
export function parseMinutes(raw) {
|
||||
if (raw === null || raw === undefined) return null
|
||||
const text = String(raw).trim()
|
||||
if (!/^\d+$/.test(text)) return null
|
||||
const value = Number(text)
|
||||
return value >= 1 && value <= MAX_MINUTES ? value : null
|
||||
return value >= TIME_STEP && value <= MAX_MINUTES && value % TIME_STEP === 0 ? value : null
|
||||
}
|
||||
|
||||
/** 15 -> '15 Min', 60 -> '1 Std', 90 -> '1,5 Std', 130 -> '2 Std 10 Min' */
|
||||
|
||||
Reference in new issue
Block a user