robbyson-frontend-library 1.0.62 → 1.0.64
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/models/theme-base.js +1 -0
- package/dist/utils/date.utils.js +16 -5
- package/package.json +1 -1
- package/src/components/context-menu/context-menu.interface.ts +2 -0
- package/src/components/table/table.interface.ts +2 -0
- package/src/models/result-params.model.ts +2 -0
- package/src/models/theme-base.ts +1 -0
- package/src/utils/date.utils.ts +19 -5
package/dist/utils/date.utils.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _ from "lodash";
|
|
2
2
|
import moment from "moment";
|
|
3
|
+
import { GlobalStore } from "redux-micro-frontend";
|
|
3
4
|
var DateUtils = /** @class */ (function () {
|
|
4
5
|
function DateUtils() {
|
|
5
6
|
}
|
|
@@ -26,11 +27,21 @@ var DateUtils = /** @class */ (function () {
|
|
|
26
27
|
return dates;
|
|
27
28
|
};
|
|
28
29
|
DateUtils.formatDate = function (dateString) {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
var _a, _b, _c, _d, _e;
|
|
31
|
+
if (!dateString)
|
|
32
|
+
return "";
|
|
33
|
+
try {
|
|
34
|
+
var globalState = GlobalStore.Get().GetGlobalState();
|
|
35
|
+
var locale = ((_e = (_d = (_c = (_b = (_a = globalState === null || globalState === void 0 ? void 0 : globalState.Global) === null || _a === void 0 ? void 0 : _a.RootApp) === null || _b === void 0 ? void 0 : _b.userSession) === null || _c === void 0 ? void 0 : _c.contractor) === null || _d === void 0 ? void 0 : _d.locale) === null || _e === void 0 ? void 0 : _e.identifier) || "pt-BR";
|
|
36
|
+
return new Date(dateString).toLocaleDateString(locale, {
|
|
37
|
+
day: "2-digit",
|
|
38
|
+
month: "long",
|
|
39
|
+
timeZone: "UTC",
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
catch (_f) {
|
|
43
|
+
return "";
|
|
44
|
+
}
|
|
34
45
|
};
|
|
35
46
|
DateUtils.toLocaleDateString = function (dateString, locale) {
|
|
36
47
|
try {
|
package/package.json
CHANGED
package/src/models/theme-base.ts
CHANGED
package/src/utils/date.utils.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import _ from "lodash";
|
|
2
2
|
import moment from "moment";
|
|
3
|
+
import { GlobalStore } from "redux-micro-frontend";
|
|
4
|
+
import { IPlatformState } from "../states";
|
|
3
5
|
|
|
4
6
|
type RemainingTime = {
|
|
5
7
|
timeRemainingText: string;
|
|
@@ -39,11 +41,23 @@ export class DateUtils {
|
|
|
39
41
|
}
|
|
40
42
|
|
|
41
43
|
static formatDate(dateString: string): string {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
if (!dateString) return "";
|
|
45
|
+
|
|
46
|
+
try {
|
|
47
|
+
const globalState: IPlatformState =
|
|
48
|
+
GlobalStore.Get().GetGlobalState();
|
|
49
|
+
const locale =
|
|
50
|
+
globalState?.Global?.RootApp?.userSession?.contractor?.locale
|
|
51
|
+
?.identifier || "pt-BR";
|
|
52
|
+
|
|
53
|
+
return new Date(dateString).toLocaleDateString(locale, {
|
|
54
|
+
day: "2-digit",
|
|
55
|
+
month: "long",
|
|
56
|
+
timeZone: "UTC",
|
|
57
|
+
});
|
|
58
|
+
} catch {
|
|
59
|
+
return "";
|
|
60
|
+
}
|
|
47
61
|
}
|
|
48
62
|
|
|
49
63
|
static toLocaleDateString(
|