@odoo/o-spreadsheet 16.4.17 → 16.4.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/o-spreadsheet.cjs.js +118 -47
- package/dist/o-spreadsheet.d.ts +29 -1
- package/dist/o-spreadsheet.esm.js +118 -47
- package/dist/o-spreadsheet.iife.js +118 -47
- package/dist/o-spreadsheet.iife.min.js +258 -254
- package/dist/o_spreadsheet.xml +4 -4
- package/package.json +1 -1
|
@@ -1166,16 +1166,81 @@ function toXC(col, row, rangePart = { colFixed: false, rowFixed: false }) {
|
|
|
1166
1166
|
}
|
|
1167
1167
|
|
|
1168
1168
|
// -----------------------------------------------------------------------------
|
|
1169
|
+
/**
|
|
1170
|
+
* A DateTime object that can be used to manipulate spreadsheet dates.
|
|
1171
|
+
* Conceptually, a spreadsheet date is simply a number with a date format,
|
|
1172
|
+
* and it is timezone-agnostic.
|
|
1173
|
+
* This DateTime object consistently uses UTC time to represent a naive date and time.
|
|
1174
|
+
*/
|
|
1175
|
+
class DateTime {
|
|
1176
|
+
jsDate;
|
|
1177
|
+
constructor(year, month, day, hours = 0, minutes = 0, seconds = 0) {
|
|
1178
|
+
this.jsDate = new Date(Date.UTC(year, month, day, hours, minutes, seconds, 0));
|
|
1179
|
+
}
|
|
1180
|
+
static fromTimestamp(timestamp) {
|
|
1181
|
+
const date = new Date(timestamp);
|
|
1182
|
+
return new DateTime(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate(), date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds());
|
|
1183
|
+
}
|
|
1184
|
+
static now() {
|
|
1185
|
+
const now = new Date();
|
|
1186
|
+
return new DateTime(now.getFullYear(), now.getMonth(), now.getDate(), now.getHours(), now.getMinutes(), now.getSeconds());
|
|
1187
|
+
}
|
|
1188
|
+
toString() {
|
|
1189
|
+
return this.jsDate.toString();
|
|
1190
|
+
}
|
|
1191
|
+
toLocaleDateString() {
|
|
1192
|
+
return this.jsDate.toLocaleDateString();
|
|
1193
|
+
}
|
|
1194
|
+
getTime() {
|
|
1195
|
+
return this.jsDate.getTime();
|
|
1196
|
+
}
|
|
1197
|
+
getFullYear() {
|
|
1198
|
+
return this.jsDate.getUTCFullYear();
|
|
1199
|
+
}
|
|
1200
|
+
getMonth() {
|
|
1201
|
+
return this.jsDate.getUTCMonth();
|
|
1202
|
+
}
|
|
1203
|
+
getDate() {
|
|
1204
|
+
return this.jsDate.getUTCDate();
|
|
1205
|
+
}
|
|
1206
|
+
getDay() {
|
|
1207
|
+
return this.jsDate.getUTCDay();
|
|
1208
|
+
}
|
|
1209
|
+
getHours() {
|
|
1210
|
+
return this.jsDate.getUTCHours();
|
|
1211
|
+
}
|
|
1212
|
+
getMinutes() {
|
|
1213
|
+
return this.jsDate.getUTCMinutes();
|
|
1214
|
+
}
|
|
1215
|
+
getSeconds() {
|
|
1216
|
+
return this.jsDate.getUTCSeconds();
|
|
1217
|
+
}
|
|
1218
|
+
setFullYear(year) {
|
|
1219
|
+
this.jsDate.setFullYear(year);
|
|
1220
|
+
}
|
|
1221
|
+
setDate(date) {
|
|
1222
|
+
this.jsDate.setUTCDate(date);
|
|
1223
|
+
}
|
|
1224
|
+
setHours(hours) {
|
|
1225
|
+
this.jsDate.setUTCHours(hours);
|
|
1226
|
+
}
|
|
1227
|
+
setMinutes(minutes) {
|
|
1228
|
+
this.jsDate.setUTCMinutes(minutes);
|
|
1229
|
+
}
|
|
1230
|
+
setSeconds(seconds) {
|
|
1231
|
+
this.jsDate.setUTCSeconds(seconds);
|
|
1232
|
+
}
|
|
1233
|
+
}
|
|
1169
1234
|
// -----------------------------------------------------------------------------
|
|
1170
1235
|
// Parsing
|
|
1171
1236
|
// -----------------------------------------------------------------------------
|
|
1172
|
-
const INITIAL_1900_DAY = new
|
|
1237
|
+
const INITIAL_1900_DAY = new DateTime(1899, 11, 30);
|
|
1173
1238
|
const MS_PER_DAY = 24 * 60 * 60 * 1000;
|
|
1174
1239
|
const CURRENT_MILLENIAL = 2000; // note: don't forget to update this in 2999
|
|
1175
|
-
const CURRENT_YEAR =
|
|
1176
|
-
const CURRENT_MONTH =
|
|
1177
|
-
const INITIAL_JS_DAY =
|
|
1178
|
-
const DATE_JS_1900_OFFSET = INITIAL_JS_DAY - INITIAL_1900_DAY;
|
|
1240
|
+
const CURRENT_YEAR = DateTime.now().getFullYear();
|
|
1241
|
+
const CURRENT_MONTH = DateTime.now().getMonth();
|
|
1242
|
+
const INITIAL_JS_DAY = DateTime.fromTimestamp(0);
|
|
1243
|
+
const DATE_JS_1900_OFFSET = INITIAL_JS_DAY.getTime() - INITIAL_1900_DAY.getTime();
|
|
1179
1244
|
const mdyDateRegexp = /^\d{1,2}(\/|-|\s)\d{1,2}((\/|-|\s)\d{1,4})?$/;
|
|
1180
1245
|
const ymdDateRegexp = /^\d{3,4}(\/|-|\s)\d{1,2}(\/|-|\s)\d{1,2}$/;
|
|
1181
1246
|
const dateSeparatorsRegex = /\/|-|\s/;
|
|
@@ -1222,7 +1287,7 @@ function _parseDateTime(str, locale) {
|
|
|
1222
1287
|
return {
|
|
1223
1288
|
value: date.value + time.value,
|
|
1224
1289
|
format: date.format + " " + (time.format === "hhhh:mm:ss" ? "hh:mm:ss" : time.format),
|
|
1225
|
-
jsDate: new
|
|
1290
|
+
jsDate: new DateTime(date.jsDate.getFullYear() + time.jsDate.getFullYear() - 1899, date.jsDate.getMonth() + time.jsDate.getMonth() - 11, date.jsDate.getDate() + time.jsDate.getDate() - 30, date.jsDate.getHours() + time.jsDate.getHours(), date.jsDate.getMinutes() + time.jsDate.getMinutes(), date.jsDate.getSeconds() + time.jsDate.getSeconds()),
|
|
1226
1291
|
};
|
|
1227
1292
|
}
|
|
1228
1293
|
return date || time;
|
|
@@ -1294,12 +1359,12 @@ function parseDate(parts, separator) {
|
|
|
1294
1359
|
// month + 1: months are 0-indexed in JS
|
|
1295
1360
|
const leadingZero = (monthStr?.length === 2 && month + 1 < 10) || (dayStr?.length === 2 && day < 10);
|
|
1296
1361
|
const fullYear = yearStr?.length !== 2;
|
|
1297
|
-
const jsDate = new
|
|
1362
|
+
const jsDate = new DateTime(year, month, day);
|
|
1298
1363
|
if (jsDate.getMonth() !== month || jsDate.getDate() !== day) {
|
|
1299
1364
|
// invalid date
|
|
1300
1365
|
return null;
|
|
1301
1366
|
}
|
|
1302
|
-
const delta = jsDate - INITIAL_1900_DAY;
|
|
1367
|
+
const delta = jsDate.getTime() - INITIAL_1900_DAY.getTime();
|
|
1303
1368
|
const format = getFormatFromDateParts(parts, separator, leadingZero, fullYear);
|
|
1304
1369
|
return {
|
|
1305
1370
|
value: Math.round(delta / MS_PER_DAY),
|
|
@@ -1390,7 +1455,7 @@ function parseTime(str) {
|
|
|
1390
1455
|
if (hours >= 24) {
|
|
1391
1456
|
format = "hhhh:mm:ss";
|
|
1392
1457
|
}
|
|
1393
|
-
const jsDate = new
|
|
1458
|
+
const jsDate = new DateTime(1899, 11, 30, hours, minutes, seconds);
|
|
1394
1459
|
return {
|
|
1395
1460
|
value: hours / 24 + minutes / 1440 + seconds / 86400,
|
|
1396
1461
|
format: format,
|
|
@@ -1404,7 +1469,7 @@ function parseTime(str) {
|
|
|
1404
1469
|
// -----------------------------------------------------------------------------
|
|
1405
1470
|
function numberToJsDate(value) {
|
|
1406
1471
|
const truncValue = Math.trunc(value);
|
|
1407
|
-
let date =
|
|
1472
|
+
let date = DateTime.fromTimestamp(truncValue * MS_PER_DAY - DATE_JS_1900_OFFSET);
|
|
1408
1473
|
let time = value - truncValue;
|
|
1409
1474
|
time = time < 0 ? 1 + time : time;
|
|
1410
1475
|
const hours = Math.round(time * 24);
|
|
@@ -1421,7 +1486,7 @@ function jsDateToRoundNumber(date) {
|
|
|
1421
1486
|
}
|
|
1422
1487
|
/** Return the number of days in the current month of the given date */
|
|
1423
1488
|
function getDaysInMonth(date) {
|
|
1424
|
-
return new
|
|
1489
|
+
return new DateTime(date.getFullYear(), date.getMonth() + 1, 0).getDate();
|
|
1425
1490
|
}
|
|
1426
1491
|
function isLastDayOfMonth(date) {
|
|
1427
1492
|
return getDaysInMonth(date) === date.getDate();
|
|
@@ -1439,7 +1504,7 @@ function addMonthsToDate(date, months, keepEndOfMonth) {
|
|
|
1439
1504
|
const yStart = date.getFullYear();
|
|
1440
1505
|
const mStart = date.getMonth();
|
|
1441
1506
|
const dStart = date.getDate();
|
|
1442
|
-
const jsDate = new
|
|
1507
|
+
const jsDate = new DateTime(yStart, mStart + months, 1);
|
|
1443
1508
|
if (keepEndOfMonth && dStart === getDaysInMonth(date)) {
|
|
1444
1509
|
jsDate.setDate(getDaysInMonth(jsDate));
|
|
1445
1510
|
}
|
|
@@ -2043,7 +2108,7 @@ function formatJSTime(jsDate, format) {
|
|
|
2043
2108
|
.map((p) => {
|
|
2044
2109
|
switch (p) {
|
|
2045
2110
|
case "hhhh":
|
|
2046
|
-
const helapsedHours = Math.floor((jsDate.getTime() - INITIAL_1900_DAY) / (60 * 60 * 1000));
|
|
2111
|
+
const helapsedHours = Math.floor((jsDate.getTime() - INITIAL_1900_DAY.getTime()) / (60 * 60 * 1000));
|
|
2047
2112
|
return helapsedHours.toString();
|
|
2048
2113
|
case "hh":
|
|
2049
2114
|
return hours.toString().padStart(2, "0");
|
|
@@ -5985,6 +6050,10 @@ css /* scss */ `
|
|
|
5985
6050
|
justify-content: space-between;
|
|
5986
6051
|
}
|
|
5987
6052
|
|
|
6053
|
+
.o-menu-item-name {
|
|
6054
|
+
min-width: 40%;
|
|
6055
|
+
}
|
|
6056
|
+
|
|
5988
6057
|
.o-menu-item-icon {
|
|
5989
6058
|
display: inline-block;
|
|
5990
6059
|
margin: 0px 8px 0px 0px;
|
|
@@ -6319,6 +6388,9 @@ function arg(definition, description = "") {
|
|
|
6319
6388
|
function makeArg(str, description) {
|
|
6320
6389
|
let parts = str.match(ARG_REGEXP);
|
|
6321
6390
|
let name = parts[1].trim();
|
|
6391
|
+
if (!name) {
|
|
6392
|
+
throw new Error(`Function argument definition is missing a name: '${str}'.`);
|
|
6393
|
+
}
|
|
6322
6394
|
let types = [];
|
|
6323
6395
|
let isOptional = false;
|
|
6324
6396
|
let isRepeating = false;
|
|
@@ -9569,7 +9641,7 @@ const DATE = {
|
|
|
9569
9641
|
if (_year < 1900) {
|
|
9570
9642
|
_year += 1900;
|
|
9571
9643
|
}
|
|
9572
|
-
const jsDate = new
|
|
9644
|
+
const jsDate = new DateTime(_year, _month - 1, _day);
|
|
9573
9645
|
const result = jsDateToRoundNumber(jsDate);
|
|
9574
9646
|
assert(() => result >= 0, _lt(`The function [[FUNCTION_NAME]] result must be greater than or equal 01/01/1900.`));
|
|
9575
9647
|
return result;
|
|
@@ -9612,7 +9684,7 @@ const DATEDIF = {
|
|
|
9612
9684
|
// See: https://support.microsoft.com/en-us/office/datedif-function-25dba1a4-2812-480b-84dd-8b32a451b35c
|
|
9613
9685
|
let days = jsEndDate.getDate() - jsStartDate.getDate();
|
|
9614
9686
|
if (days < 0) {
|
|
9615
|
-
const monthBeforeEndMonth = new
|
|
9687
|
+
const monthBeforeEndMonth = new DateTime(jsEndDate.getFullYear(), jsEndDate.getMonth() - 1, 1);
|
|
9616
9688
|
const daysInMonthBeforeEndMonth = getDaysInMonth(monthBeforeEndMonth);
|
|
9617
9689
|
days = daysInMonthBeforeEndMonth - Math.abs(days);
|
|
9618
9690
|
}
|
|
@@ -9621,7 +9693,7 @@ const DATEDIF = {
|
|
|
9621
9693
|
if (areTwoDatesWithinOneYear(_startDate, _endDate)) {
|
|
9622
9694
|
return getTimeDifferenceInWholeDays(jsStartDate, jsEndDate);
|
|
9623
9695
|
}
|
|
9624
|
-
const endDateWithinOneYear = new
|
|
9696
|
+
const endDateWithinOneYear = new DateTime(jsStartDate.getFullYear(), jsEndDate.getMonth(), jsEndDate.getDate());
|
|
9625
9697
|
let days = getTimeDifferenceInWholeDays(jsStartDate, endDateWithinOneYear);
|
|
9626
9698
|
if (days < 0) {
|
|
9627
9699
|
endDateWithinOneYear.setFullYear(jsStartDate.getFullYear() + 1);
|
|
@@ -9738,7 +9810,7 @@ const EOMONTH = {
|
|
|
9738
9810
|
const _months = Math.trunc(toNumber(months, this.locale));
|
|
9739
9811
|
const yStart = _startDate.getFullYear();
|
|
9740
9812
|
const mStart = _startDate.getMonth();
|
|
9741
|
-
const jsDate = new
|
|
9813
|
+
const jsDate = new DateTime(yStart, mStart + _months + 1, 0);
|
|
9742
9814
|
return jsDateToRoundNumber(jsDate);
|
|
9743
9815
|
},
|
|
9744
9816
|
isExported: true,
|
|
@@ -9775,17 +9847,17 @@ const ISOWEEKNUM = {
|
|
|
9775
9847
|
// The first week of the year is the week that contains the first
|
|
9776
9848
|
// Thursday of the year.
|
|
9777
9849
|
let firstThursday = 1;
|
|
9778
|
-
while (new
|
|
9850
|
+
while (new DateTime(y, 0, firstThursday).getDay() !== 4) {
|
|
9779
9851
|
firstThursday += 1;
|
|
9780
9852
|
}
|
|
9781
|
-
const firstDayOfFirstWeek = new
|
|
9853
|
+
const firstDayOfFirstWeek = new DateTime(y, 0, firstThursday - 3);
|
|
9782
9854
|
// The last week of the year is the week that contains the last Thursday of
|
|
9783
9855
|
// the year.
|
|
9784
9856
|
let lastThursday = 31;
|
|
9785
|
-
while (new
|
|
9857
|
+
while (new DateTime(y, 11, lastThursday).getDay() !== 4) {
|
|
9786
9858
|
lastThursday -= 1;
|
|
9787
9859
|
}
|
|
9788
|
-
const lastDayOfLastWeek = new
|
|
9860
|
+
const lastDayOfLastWeek = new DateTime(y, 11, lastThursday + 3);
|
|
9789
9861
|
// B - If our date > lastDayOfLastWeek then it's in the weeks of the year after
|
|
9790
9862
|
// If our date < firstDayOfFirstWeek then it's in the weeks of the year before
|
|
9791
9863
|
let offsetYear;
|
|
@@ -9811,17 +9883,17 @@ const ISOWEEKNUM = {
|
|
|
9811
9883
|
case 1:
|
|
9812
9884
|
// firstDay is the 1st day of the 1st week of the year after
|
|
9813
9885
|
// firstDay = lastDayOfLastWeek + 1 Day
|
|
9814
|
-
firstDay = new
|
|
9886
|
+
firstDay = new DateTime(y, 11, lastThursday + 3 + 1);
|
|
9815
9887
|
break;
|
|
9816
9888
|
case -1:
|
|
9817
9889
|
// firstDay is the 1st day of the 1st week of the previous year.
|
|
9818
9890
|
// The first week of the previous year is the week that contains the
|
|
9819
9891
|
// first Thursday of the previous year.
|
|
9820
9892
|
let firstThursdayPreviousYear = 1;
|
|
9821
|
-
while (new
|
|
9893
|
+
while (new DateTime(y - 1, 0, firstThursdayPreviousYear).getDay() !== 4) {
|
|
9822
9894
|
firstThursdayPreviousYear += 1;
|
|
9823
9895
|
}
|
|
9824
|
-
firstDay = new
|
|
9896
|
+
firstDay = new DateTime(y - 1, 0, firstThursdayPreviousYear - 3);
|
|
9825
9897
|
break;
|
|
9826
9898
|
}
|
|
9827
9899
|
const diff = (_date.getTime() - firstDay.getTime()) / MS_PER_DAY;
|
|
@@ -9956,8 +10028,8 @@ const NETWORKDAYS_INTL = {
|
|
|
9956
10028
|
});
|
|
9957
10029
|
}
|
|
9958
10030
|
const invertDate = _startDate.getTime() > _endDate.getTime();
|
|
9959
|
-
const stopDate =
|
|
9960
|
-
let stepDate =
|
|
10031
|
+
const stopDate = DateTime.fromTimestamp((invertDate ? _startDate : _endDate).getTime());
|
|
10032
|
+
let stepDate = DateTime.fromTimestamp((invertDate ? _endDate : _startDate).getTime());
|
|
9961
10033
|
const timeStopDate = stopDate.getTime();
|
|
9962
10034
|
let timeStepDate = stepDate.getTime();
|
|
9963
10035
|
let netWorkingDay = 0;
|
|
@@ -9983,8 +10055,7 @@ const NOW = {
|
|
|
9983
10055
|
return this.locale.dateFormat + " " + this.locale.timeFormat;
|
|
9984
10056
|
},
|
|
9985
10057
|
compute: function () {
|
|
9986
|
-
let today =
|
|
9987
|
-
today.setMilliseconds(0);
|
|
10058
|
+
let today = DateTime.now();
|
|
9988
10059
|
const delta = today.getTime() - INITIAL_1900_DAY.getTime();
|
|
9989
10060
|
const time = today.getHours() / 24 + today.getMinutes() / 1440 + today.getSeconds() / 86400;
|
|
9990
10061
|
return Math.floor(delta / MS_PER_DAY) + time;
|
|
@@ -10058,8 +10129,8 @@ const TODAY = {
|
|
|
10058
10129
|
return this.locale.dateFormat;
|
|
10059
10130
|
},
|
|
10060
10131
|
compute: function () {
|
|
10061
|
-
const today =
|
|
10062
|
-
const jsDate = new
|
|
10132
|
+
const today = DateTime.now();
|
|
10133
|
+
const jsDate = new DateTime(today.getFullYear(), today.getMonth(), today.getDate());
|
|
10063
10134
|
return jsDateToRoundNumber(jsDate);
|
|
10064
10135
|
},
|
|
10065
10136
|
isExported: true,
|
|
@@ -10114,10 +10185,10 @@ const WEEKNUM = {
|
|
|
10114
10185
|
}
|
|
10115
10186
|
const y = _date.getFullYear();
|
|
10116
10187
|
let dayStart = 1;
|
|
10117
|
-
let startDayOfFirstWeek = new
|
|
10188
|
+
let startDayOfFirstWeek = new DateTime(y, 0, dayStart);
|
|
10118
10189
|
while (startDayOfFirstWeek.getDay() !== startDayOfWeek) {
|
|
10119
10190
|
dayStart += 1;
|
|
10120
|
-
startDayOfFirstWeek = new
|
|
10191
|
+
startDayOfFirstWeek = new DateTime(y, 0, dayStart);
|
|
10121
10192
|
}
|
|
10122
10193
|
const dif = (_date.getTime() - startDayOfFirstWeek.getTime()) / MS_PER_DAY;
|
|
10123
10194
|
if (dif < 0) {
|
|
@@ -10175,7 +10246,7 @@ const WORKDAY_INTL = {
|
|
|
10175
10246
|
timesHoliday.add(holiday.getTime());
|
|
10176
10247
|
});
|
|
10177
10248
|
}
|
|
10178
|
-
let stepDate =
|
|
10249
|
+
let stepDate = DateTime.fromTimestamp(_startDate.getTime());
|
|
10179
10250
|
let timeStepDate = stepDate.getTime();
|
|
10180
10251
|
const unitDay = Math.sign(_numDays);
|
|
10181
10252
|
let stepDay = Math.abs(_numDays);
|
|
@@ -10239,7 +10310,7 @@ const MONTH_START = {
|
|
|
10239
10310
|
const _startDate = toJsDate(date, this.locale);
|
|
10240
10311
|
const yStart = _startDate.getFullYear();
|
|
10241
10312
|
const mStart = _startDate.getMonth();
|
|
10242
|
-
const jsDate = new
|
|
10313
|
+
const jsDate = new DateTime(yStart, mStart, 1);
|
|
10243
10314
|
return jsDateToRoundNumber(jsDate);
|
|
10244
10315
|
},
|
|
10245
10316
|
};
|
|
@@ -10281,7 +10352,7 @@ const QUARTER_START = {
|
|
|
10281
10352
|
compute: function (date) {
|
|
10282
10353
|
const quarter = QUARTER.compute.bind(this)(date);
|
|
10283
10354
|
const year = YEAR.compute.bind(this)(date);
|
|
10284
|
-
const jsDate = new
|
|
10355
|
+
const jsDate = new DateTime(year, (quarter - 1) * 3, 1);
|
|
10285
10356
|
return jsDateToRoundNumber(jsDate);
|
|
10286
10357
|
},
|
|
10287
10358
|
};
|
|
@@ -10298,7 +10369,7 @@ const QUARTER_END = {
|
|
|
10298
10369
|
compute: function (date) {
|
|
10299
10370
|
const quarter = QUARTER.compute.bind(this)(date);
|
|
10300
10371
|
const year = YEAR.compute.bind(this)(date);
|
|
10301
|
-
const jsDate = new
|
|
10372
|
+
const jsDate = new DateTime(year, quarter * 3, 0);
|
|
10302
10373
|
return jsDateToRoundNumber(jsDate);
|
|
10303
10374
|
},
|
|
10304
10375
|
};
|
|
@@ -10314,7 +10385,7 @@ const YEAR_START = {
|
|
|
10314
10385
|
},
|
|
10315
10386
|
compute: function (date) {
|
|
10316
10387
|
const year = YEAR.compute.bind(this)(date);
|
|
10317
|
-
const jsDate = new
|
|
10388
|
+
const jsDate = new DateTime(year, 0, 1);
|
|
10318
10389
|
return jsDateToRoundNumber(jsDate);
|
|
10319
10390
|
},
|
|
10320
10391
|
};
|
|
@@ -10330,7 +10401,7 @@ const YEAR_END = {
|
|
|
10330
10401
|
},
|
|
10331
10402
|
compute: function (date) {
|
|
10332
10403
|
const year = YEAR.compute.bind(this)(date);
|
|
10333
|
-
const jsDate = new
|
|
10404
|
+
const jsDate = new DateTime(year + 1, 0, 0);
|
|
10334
10405
|
return jsDateToRoundNumber(jsDate);
|
|
10335
10406
|
},
|
|
10336
10407
|
};
|
|
@@ -10378,8 +10449,8 @@ const DEFAULT_DELTA_ARG = 0;
|
|
|
10378
10449
|
const DELTA = {
|
|
10379
10450
|
description: _lt("Compare two numeric values, returning 1 if they're equal."),
|
|
10380
10451
|
args: [
|
|
10381
|
-
arg(" (number)", _lt("The first number to compare.")),
|
|
10382
|
-
arg(` (number, default=${DEFAULT_DELTA_ARG})`, _lt("The second number to compare.")),
|
|
10452
|
+
arg("number1 (number)", _lt("The first number to compare.")),
|
|
10453
|
+
arg(`number2 (number, default=${DEFAULT_DELTA_ARG})`, _lt("The second number to compare.")),
|
|
10383
10454
|
],
|
|
10384
10455
|
returns: ["NUMBER"],
|
|
10385
10456
|
compute: function (number1, number2 = DEFAULT_DELTA_ARG) {
|
|
@@ -10548,7 +10619,7 @@ function assertDeprecationFactorStrictlyPositive(factor) {
|
|
|
10548
10619
|
function assertSettlementLessThanOneYearBeforeMaturity(settlement, maturity, locale) {
|
|
10549
10620
|
const startDate = toJsDate(settlement, locale);
|
|
10550
10621
|
const endDate = toJsDate(maturity, locale);
|
|
10551
|
-
const startDatePlusOneYear =
|
|
10622
|
+
const startDatePlusOneYear = toJsDate(settlement, locale);
|
|
10552
10623
|
startDatePlusOneYear.setFullYear(startDate.getFullYear() + 1);
|
|
10553
10624
|
assert(() => endDate.getTime() <= startDatePlusOneYear.getTime(), _lt("The settlement date (%s) must at most one year after the maturity date (%s).", settlement.toString(), maturity.toString()));
|
|
10554
10625
|
}
|
|
@@ -10683,7 +10754,7 @@ const AMORLINC = {
|
|
|
10683
10754
|
arg("salvage (number)", _lt("The value of the asset at the end of depreciation.")),
|
|
10684
10755
|
arg("period (number)", _lt("The single period within life for which to calculate depreciation.")),
|
|
10685
10756
|
arg("rate (number)", _lt("The deprecation rate.")),
|
|
10686
|
-
arg(" (number, optional)", _lt("An indicator of what day count method to use.")),
|
|
10757
|
+
arg("day_count_convention (number, optional)", _lt("An indicator of what day count method to use.")),
|
|
10687
10758
|
],
|
|
10688
10759
|
returns: ["NUMBER"],
|
|
10689
10760
|
compute: function (cost, purchaseDate, firstPeriodEnd, salvage, period, rate, dayCountConvention = DEFAULT_DAY_COUNT_CONVENTION) {
|
|
@@ -13702,8 +13773,8 @@ const MID = {
|
|
|
13702
13773
|
description: _lt("A segment of a string."),
|
|
13703
13774
|
args: [
|
|
13704
13775
|
arg("text (string)", _lt("The string to extract a segment from.")),
|
|
13705
|
-
arg(" (number)", _lt("The index from the left of string from which to begin extracting. The first character in string has the index 1.")),
|
|
13706
|
-
arg(" (number)", _lt("The length of the segment to extract.")),
|
|
13776
|
+
arg("starting_at (number)", _lt("The index from the left of string from which to begin extracting. The first character in string has the index 1.")),
|
|
13777
|
+
arg("extract_length (number)", _lt("The length of the segment to extract.")),
|
|
13707
13778
|
],
|
|
13708
13779
|
returns: ["STRING"],
|
|
13709
13780
|
compute: function (text, starting_at, extract_length) {
|
|
@@ -51490,6 +51561,6 @@ const constants = {
|
|
|
51490
51561
|
export { AbstractChart, CommandResult, CorePlugin, DispatchResult, EvaluationError, Model, Registry, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, UIPlugin, __info__, addFunction, astToFormula, compile, components, constants, convertAstNodes, coreTypes, findCellInNewZone, functionCache, helpers, invalidateCFEvaluationCommands, invalidateDependenciesCommands, invalidateEvaluationCommands, iterateAstNodes, links, load, parse, readonlyAllowedCommands, registries, setDefaultSheetViewSize, setTranslationMethod, tokenize };
|
|
51491
51562
|
|
|
51492
51563
|
|
|
51493
|
-
__info__.version = '16.4.
|
|
51494
|
-
__info__.date = '2024-01-
|
|
51495
|
-
__info__.hash = '
|
|
51564
|
+
__info__.version = '16.4.18';
|
|
51565
|
+
__info__.date = '2024-01-12T13:43:10.143Z';
|
|
51566
|
+
__info__.hash = 'f438e08';
|