investira.sdk 2.4.21 → 2.4.23

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/CHANGELOG.md CHANGED
@@ -633,3 +633,7 @@ O contrutor para a criação das mensagem foi alterado.
633
633
  # 2.4.20
634
634
 
635
635
  - [objects] Novo deleteZeros
636
+
637
+ # 2.4.23
638
+
639
+ - [dates] scheduleToDate com atributo nextDay
@@ -1082,11 +1082,13 @@ const dates = {
1082
1082
  xNextDate = dates.scheduleToDate({ ...pSchedule, type: 'W' }, xNextDate);
1083
1083
  }
1084
1084
  }
1085
+ //Ajusta data para o próximo dia util
1085
1086
  if (pSchedule?.workingDay) {
1086
- xNextDate = dates.addWorkingDays(xNextDate, 0);
1087
- //Adiciona um dia, para casos qu deva-se processar no dia seguinte a um dia útil
1088
- if (pSchedule?.nextDay) {
1089
- xNextDate = dates.addDays(xNextDate, 1);
1087
+ //Se não for dia útil, ajusta para o próximo dia útil
1088
+ //A opção nextDay força para que o próxima data não precise ser dia util, desde que a data atual seja dia útil
1089
+ if (!pSchedule?.nextDay || !dates.isWorkingDay(xCurrentDate)) {
1090
+ //Garante que seja dia útil se próxima data ainda não for
1091
+ xNextDate = dates.addWorkingDays(xNextDate, 0);
1090
1092
  }
1091
1093
  }
1092
1094
  return xNextDate;
package/package.json CHANGED
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "investira.sdk",
3
- "version": "2.4.21",
3
+ "version": "2.4.23",
4
4
  "author": "Investira",
5
5
  "description": "Investira SDK",
6
6
  "main": "index.js",
7
7
  "type": "commonjs",
8
8
  "registry": true,
9
- "raw": "investira.sdk@2.4.21",
9
+ "raw": "investira.sdk@2.4.23",
10
10
  "escapedName": "investira.sdk",
11
- "rawSpec": "2.4.21",
11
+ "rawSpec": "2.4.23",
12
12
  "saveSpec": null,
13
- "fetchSpec": "2.4.21",
13
+ "fetchSpec": "2.4.23",
14
14
  "homepage": "https://investira.com.br/",
15
15
  "engines": {
16
16
  "node": ">=11.11.0 <=18.12",