@molopos/shared 2.0.68 → 2.0.70
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/data/langs.d.ts +12 -0
- package/data/langs.js +25 -0
- package/date/index.js +5 -15
- package/enum/index.d.ts +5 -1
- package/enum/index.js +4 -0
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/package.json +1 -1
package/data/langs.d.ts
ADDED
package/data/langs.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.locales = exports.LocaleEnum = void 0;
|
|
4
|
+
var LocaleEnum;
|
|
5
|
+
(function (LocaleEnum) {
|
|
6
|
+
LocaleEnum["en"] = "en";
|
|
7
|
+
LocaleEnum["it"] = "it";
|
|
8
|
+
LocaleEnum["fr"] = "fr";
|
|
9
|
+
LocaleEnum["de"] = "de";
|
|
10
|
+
LocaleEnum["es"] = "es";
|
|
11
|
+
})(LocaleEnum || (exports.LocaleEnum = LocaleEnum = {}));
|
|
12
|
+
exports.locales = [
|
|
13
|
+
{
|
|
14
|
+
name: "Italian",
|
|
15
|
+
code: LocaleEnum.it,
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
name: "French",
|
|
19
|
+
code: LocaleEnum.fr,
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
name: "English",
|
|
23
|
+
code: LocaleEnum.en,
|
|
24
|
+
},
|
|
25
|
+
];
|
package/date/index.js
CHANGED
|
@@ -17,9 +17,7 @@ const formateDate = (date, locale) => {
|
|
|
17
17
|
let dateReturn = null;
|
|
18
18
|
const todaysDate = (0, exports.dateTimeNowUtc)();
|
|
19
19
|
const currentYear = todaysDate.getFullYear();
|
|
20
|
-
const dateInit = date
|
|
21
|
-
? luxon_1.DateTime.fromISO(String(date))
|
|
22
|
-
: luxon_1.DateTime.fromJSDate(date);
|
|
20
|
+
const dateInit = luxon_1.DateTime.fromISO(String(date));
|
|
23
21
|
const dateYear = Number(dateInit.toFormat("yyyy"));
|
|
24
22
|
if (currentYear === dateYear) {
|
|
25
23
|
dateReturn = dateInit.setLocale(locale).toFormat("dd MMM HH:mm");
|
|
@@ -40,32 +38,24 @@ exports.formateDate = formateDate;
|
|
|
40
38
|
* formateddLLLyyyy("2026-01-01", "en-US"); // "1 Jan 2026"
|
|
41
39
|
*/
|
|
42
40
|
const formateddLLLyyyy = (date, locale) => {
|
|
43
|
-
const dateInit = date
|
|
44
|
-
? luxon_1.DateTime.fromISO(String(date))
|
|
45
|
-
: luxon_1.DateTime.fromJSDate(date);
|
|
41
|
+
const dateInit = luxon_1.DateTime.fromISO(String(date));
|
|
46
42
|
return dateInit.setLocale(locale).toFormat("dd LLL yyyy");
|
|
47
43
|
};
|
|
48
44
|
exports.formateddLLLyyyy = formateddLLLyyyy;
|
|
49
45
|
const formateYYDDMM = (date, locale) => {
|
|
50
|
-
const dateInit = date
|
|
51
|
-
? luxon_1.DateTime.fromISO(String(date))
|
|
52
|
-
: luxon_1.DateTime.fromJSDate(date);
|
|
46
|
+
const dateInit = luxon_1.DateTime.fromISO(String(date));
|
|
53
47
|
return dateInit.setLocale(locale).toFormat("ff");
|
|
54
48
|
};
|
|
55
49
|
exports.formateYYDDMM = formateYYDDMM;
|
|
56
50
|
const formateHHmm = (date, locale) => {
|
|
57
|
-
const dateInit = date
|
|
58
|
-
? luxon_1.DateTime.fromISO(String(date))
|
|
59
|
-
: luxon_1.DateTime.fromJSDate(date);
|
|
51
|
+
const dateInit = luxon_1.DateTime.fromISO(String(date));
|
|
60
52
|
return dateInit.setLocale(locale).toFormat("t");
|
|
61
53
|
};
|
|
62
54
|
exports.formateHHmm = formateHHmm;
|
|
63
55
|
const formatDateToUtc = (date) => (0, date_fns_1.format)(date, "dd-MM-yyyy");
|
|
64
56
|
exports.formatDateToUtc = formatDateToUtc;
|
|
65
57
|
const formatDateDDMMYYToUtc = (date, locale) => {
|
|
66
|
-
const dateInit = date
|
|
67
|
-
? luxon_1.DateTime.fromISO(String(date))
|
|
68
|
-
: luxon_1.DateTime.fromJSDate(date);
|
|
58
|
+
const dateInit = luxon_1.DateTime.fromISO(String(date));
|
|
69
59
|
return dateInit.setLocale(locale).toFormat("D");
|
|
70
60
|
};
|
|
71
61
|
exports.formatDateDDMMYYToUtc = formatDateDDMMYYToUtc;
|
package/enum/index.d.ts
CHANGED
|
@@ -69,6 +69,7 @@ export declare enum QueryTypeEnum {
|
|
|
69
69
|
ExpenseItem = "EXPENSEITEM",
|
|
70
70
|
Organization = "ORGANIZATION",
|
|
71
71
|
Advancement = "ADVANCEMENT",
|
|
72
|
+
PaymentOrigin = "PAYMENTORIGIN",
|
|
72
73
|
ApplicationSection = "APPLICATIONSECTION",
|
|
73
74
|
CollaborativeFund = "COLLABORATIVEFUND",
|
|
74
75
|
Subscription = "SUBSCRIPTION"
|
|
@@ -147,7 +148,10 @@ export declare enum ActivityModelEnum {
|
|
|
147
148
|
SubCategoryDelete = "SUBCATEGORY_DELETE",
|
|
148
149
|
CustomerCreate = "CUSTOMER_CREATE",
|
|
149
150
|
CustomerUpdate = "CUSTOMER_UPDATE",
|
|
150
|
-
CustomerDelete = "CUSTOMER_DELETE"
|
|
151
|
+
CustomerDelete = "CUSTOMER_DELETE",
|
|
152
|
+
PaymentOriginCreate = "PAYMENT_ORIGIN_CREATE",
|
|
153
|
+
PaymentOriginUpdate = "PAYMENT_ORIGIN_UPDATE",
|
|
154
|
+
PaymentOriginDelete = "PAYMENT_ORIGIN_DELETE"
|
|
151
155
|
}
|
|
152
156
|
/**
|
|
153
157
|
* Transaction direction enum
|
package/enum/index.js
CHANGED
|
@@ -77,6 +77,7 @@ var QueryTypeEnum;
|
|
|
77
77
|
QueryTypeEnum["ExpenseItem"] = "EXPENSEITEM";
|
|
78
78
|
QueryTypeEnum["Organization"] = "ORGANIZATION";
|
|
79
79
|
QueryTypeEnum["Advancement"] = "ADVANCEMENT";
|
|
80
|
+
QueryTypeEnum["PaymentOrigin"] = "PAYMENTORIGIN";
|
|
80
81
|
QueryTypeEnum["ApplicationSection"] = "APPLICATIONSECTION";
|
|
81
82
|
QueryTypeEnum["CollaborativeFund"] = "COLLABORATIVEFUND";
|
|
82
83
|
QueryTypeEnum["Subscription"] = "SUBSCRIPTION";
|
|
@@ -157,6 +158,9 @@ var ActivityModelEnum;
|
|
|
157
158
|
ActivityModelEnum["CustomerCreate"] = "CUSTOMER_CREATE";
|
|
158
159
|
ActivityModelEnum["CustomerUpdate"] = "CUSTOMER_UPDATE";
|
|
159
160
|
ActivityModelEnum["CustomerDelete"] = "CUSTOMER_DELETE";
|
|
161
|
+
ActivityModelEnum["PaymentOriginCreate"] = "PAYMENT_ORIGIN_CREATE";
|
|
162
|
+
ActivityModelEnum["PaymentOriginUpdate"] = "PAYMENT_ORIGIN_UPDATE";
|
|
163
|
+
ActivityModelEnum["PaymentOriginDelete"] = "PAYMENT_ORIGIN_DELETE";
|
|
160
164
|
})(ActivityModelEnum || (exports.ActivityModelEnum = ActivityModelEnum = {}));
|
|
161
165
|
/**
|
|
162
166
|
* Transaction direction enum
|
package/index.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -16,6 +16,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./data/countries"), exports);
|
|
18
18
|
__exportStar(require("./data/currencies"), exports);
|
|
19
|
+
__exportStar(require("./data/langs"), exports);
|
|
19
20
|
__exportStar(require("./date"), exports);
|
|
20
21
|
__exportStar(require("./enum"), exports);
|
|
21
22
|
__exportStar(require("./lib/utils"), exports);
|
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.70","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"}}
|