Эх сурвалжийг харах

docs: an omitted amount still means zero, and negative offsets bottom out at -12:00

fszontagh 1 сар өмнө
parent
commit
f6e64c5885

+ 6 - 2
docs/superpowers/plans/2026-08-04-tier-1-nodes.md

@@ -2698,7 +2698,8 @@ function offsetMinutes(offset) {
     }
     const hours = parseInt(match[2], 10);
     const mins = parseInt(match[3], 10);
-    if (hours > 14 || mins > 59) {
+    const maxHours = match[1] === '-' ? 12 : 14;
+    if (hours > maxHours || mins > 59) {
         throw new Error('Date and Time: offset "' + offset +
             '" is out of range. Real offsets run from -12:00 to +14:00');
     }
@@ -2781,7 +2782,10 @@ async function execute(config, input, context) {
         return result;
     }
 
-    const amount = Number(config.amount);
+    const rawAmount = config.amount === undefined || config.amount === null || config.amount === ''
+        ? 0
+        : config.amount;
+    const amount = Number(rawAmount);
     if (isNaN(amount)) {
         throw new Error('Date and Time: amount must be a number, got "' + config.amount + '"');
     }