@molopos/shared 2.0.64 → 2.0.66
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/date/index.js +6 -5
- package/enum/index.d.ts +1 -0
- package/enum/index.js +1 -0
- package/package.json +1 -1
package/date/index.js
CHANGED
|
@@ -167,11 +167,12 @@ const recurrenceDate = ({ date, recurrence, duration = 1, isRecurrence = false,
|
|
|
167
167
|
if (!isRecurrence) {
|
|
168
168
|
return null;
|
|
169
169
|
}
|
|
170
|
+
const dateInit = date instanceof Date ? date : new Date(date);
|
|
170
171
|
const dateNowUnix = (0, exports.dateTimeNowUtcUnixInteger)();
|
|
171
|
-
const dateUnix = (0, exports.formateDateUnixInteger)(
|
|
172
|
+
const dateUnix = (0, exports.formateDateUnixInteger)(dateInit);
|
|
172
173
|
const isFutureDate = dateUnix > dateNowUnix;
|
|
173
174
|
const dateNowInit = isFutureDate
|
|
174
|
-
? luxon_1.DateTime.fromJSDate(
|
|
175
|
+
? luxon_1.DateTime.fromJSDate(dateInit)
|
|
175
176
|
: luxon_1.DateTime.fromJSDate((0, exports.dateTimeNowUtc)());
|
|
176
177
|
switch (recurrence) {
|
|
177
178
|
case enum_1.RecurrenceEnum.Daily:
|
|
@@ -183,7 +184,7 @@ const recurrenceDate = ({ date, recurrence, duration = 1, isRecurrence = false,
|
|
|
183
184
|
return dateNowInit.plus({ months: duration }).toJSDate();
|
|
184
185
|
}
|
|
185
186
|
const now = luxon_1.DateTime.fromJSDate((0, exports.dateTimeNowUtc)());
|
|
186
|
-
let nextOccurrence = now.set({ day:
|
|
187
|
+
let nextOccurrence = now.set({ day: dateInit.getDate() });
|
|
187
188
|
if (nextOccurrence.toUnixInteger() <= dateNowUnix) {
|
|
188
189
|
nextOccurrence = nextOccurrence.plus({ months: duration });
|
|
189
190
|
}
|
|
@@ -195,8 +196,8 @@ const recurrenceDate = ({ date, recurrence, duration = 1, isRecurrence = false,
|
|
|
195
196
|
}
|
|
196
197
|
const now = luxon_1.DateTime.fromJSDate((0, exports.dateTimeNowUtc)());
|
|
197
198
|
let nextOccurrence = now.set({
|
|
198
|
-
month:
|
|
199
|
-
day:
|
|
199
|
+
month: dateInit.getMonth() + 1,
|
|
200
|
+
day: dateInit.getDate(),
|
|
200
201
|
});
|
|
201
202
|
if (nextOccurrence.toUnixInteger() <= dateNowUnix) {
|
|
202
203
|
nextOccurrence = nextOccurrence.plus({ years: duration });
|
package/enum/index.d.ts
CHANGED
package/enum/index.js
CHANGED
|
@@ -269,6 +269,7 @@ var ApplicationSectionModuleEnum;
|
|
|
269
269
|
ApplicationSectionModuleEnum["Quote"] = "QUOTE";
|
|
270
270
|
ApplicationSectionModuleEnum["Product"] = "PRODUCT";
|
|
271
271
|
ApplicationSectionModuleEnum["Expense"] = "EXPENSE";
|
|
272
|
+
ApplicationSectionModuleEnum["Project"] = "PROJECT";
|
|
272
273
|
ApplicationSectionModuleEnum["CollaborativeFund"] = "COLLABORATIVEFUND";
|
|
273
274
|
})(ApplicationSectionModuleEnum || (exports.ApplicationSectionModuleEnum = ApplicationSectionModuleEnum = {}));
|
|
274
275
|
/**
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@molopos/shared","publishConfig":{"access":"public"},"version":"2.0.
|
|
1
|
+
{"name":"@molopos/shared","publishConfig":{"access":"public"},"version":"2.0.66","description":"Shared between backend and frontend repos","license":"ISC","repository":{"type":"git","url":"https://github.com/unicubate/molopos-shared.git"},"dependencies":{"class-transformer":"^0.5.1","date-fns":"^4.4.0","luxon":"^3.7.2"}}
|