|
|
@@ -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 + '"');
|
|
|
}
|