@michalrakus/x-react-web-lib 1.8.0 → 1.10.0
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/README.md +3 -3
- package/XInputInterval.d.ts +3 -0
- package/XInputInterval.js +5 -0
- package/XInputIntervalBase.d.ts +3 -0
- package/XInputIntervalBase.js +5 -0
- package/gulpfile.js +84 -82
- package/lib/administration/XBrowseMetaBrowse.d.ts +2 -2
- package/lib/administration/XBrowseMetaBrowse.js +21 -21
- package/lib/administration/XBrowseMetaForm.d.ts +5 -5
- package/lib/administration/XBrowseMetaForm.js +63 -63
- package/lib/administration/XUserBrowse.d.ts +2 -2
- package/lib/administration/XUserBrowse.js +88 -87
- package/lib/administration/XUserForm.d.ts +9 -9
- package/lib/administration/XUserForm.js +195 -194
- package/lib/components/SearchTableParams.d.ts +11 -11
- package/lib/components/SearchTableParams.js +2 -2
- package/lib/components/SourceCodeLinkEntity.d.ts +4 -4
- package/lib/components/SourceCodeLinkEntity.js +14 -14
- package/lib/components/XAutoComplete.d.ts +36 -36
- package/lib/components/XAutoComplete.js +155 -155
- package/lib/components/XAutoCompleteBase.d.ts +45 -45
- package/lib/components/XAutoCompleteBase.js +371 -371
- package/lib/components/XAutoCompleteDT.d.ts +33 -33
- package/lib/components/XAutoCompleteDT.js +140 -140
- package/lib/components/XBrowse.d.ts +33 -33
- package/lib/components/XBrowse.js +360 -360
- package/lib/components/XButton.d.ts +9 -9
- package/lib/components/XButton.js +13 -13
- package/lib/components/XButtonIconMedium.d.ts +9 -9
- package/lib/components/XButtonIconMedium.js +13 -13
- package/lib/components/XButtonIconNarrow.d.ts +10 -10
- package/lib/components/XButtonIconNarrow.js +25 -25
- package/lib/components/XButtonIconSmall.d.ts +9 -9
- package/lib/components/XButtonIconSmall.js +13 -13
- package/lib/components/XCalendar.d.ts +9 -8
- package/lib/components/XCalendar.js +27 -27
- package/lib/components/XChangePasswordForm.d.ts +5 -5
- package/lib/components/XChangePasswordForm.js +160 -160
- package/lib/components/XCheckbox.d.ts +8 -8
- package/lib/components/XCheckbox.js +57 -57
- package/lib/components/XCheckboxDT.d.ts +10 -10
- package/lib/components/XCheckboxDT.js +46 -46
- package/lib/components/XDataTable.d.ts +11 -11
- package/lib/components/XDataTable.js +197 -197
- package/lib/components/XDropdown.d.ts +18 -18
- package/lib/components/XDropdown.js +57 -57
- package/lib/components/XDropdownDT.d.ts +16 -13
- package/lib/components/XDropdownDT.js +135 -128
- package/lib/components/XDropdownDTFilter.d.ts +7 -7
- package/lib/components/XDropdownDTFilter.js +121 -121
- package/lib/components/XDropdownForEntity.d.ts +26 -25
- package/lib/components/XDropdownForEntity.js +151 -149
- package/lib/components/XDropdownFormDTFilter.d.ts +7 -7
- package/lib/components/XDropdownFormDTFilter.js +121 -121
- package/lib/components/XEditColumnDialog.d.ts +13 -13
- package/lib/components/XEditColumnDialog.js +112 -112
- package/lib/components/XEnvVars.d.ts +15 -12
- package/lib/components/XEnvVars.js +23 -20
- package/lib/components/XErrors.d.ts +12 -12
- package/lib/components/XErrors.js +2 -2
- package/lib/components/XExportRowsDialog.d.ts +15 -15
- package/lib/components/XExportRowsDialog.js +184 -184
- package/lib/components/XFieldChangeEvent.d.ts +11 -11
- package/lib/components/XFieldChangeEvent.js +2 -2
- package/lib/components/XFieldSelector.d.ts +7 -7
- package/lib/components/XFieldSelector.js +113 -113
- package/lib/components/XFormBase.d.ts +68 -59
- package/lib/components/XFormBase.js +613 -526
- package/lib/components/XFormBaseModif.d.ts +5 -5
- package/lib/components/XFormBaseModif.js +33 -33
- package/lib/components/XFormBaseT.d.ts +4 -4
- package/lib/components/XFormBaseT.js +31 -31
- package/lib/components/XFormComponent.d.ts +40 -40
- package/lib/components/XFormComponent.js +177 -177
- package/lib/components/XFormComponentDT.d.ts +30 -30
- package/lib/components/XFormComponentDT.js +145 -145
- package/lib/components/XFormDataTable2.d.ts +144 -143
- package/lib/components/XFormDataTable2.js +679 -686
- package/lib/components/XFormFooter.d.ts +6 -6
- package/lib/components/XFormFooter.js +19 -19
- package/lib/components/XFormNavigator3.d.ts +12 -12
- package/lib/components/XFormNavigator3.js +130 -130
- package/lib/components/XHolders.d.ts +7 -7
- package/lib/components/XHolders.js +15 -15
- package/lib/components/XInput.d.ts +13 -13
- package/lib/components/XInput.js +38 -38
- package/lib/components/XInputDT.d.ts +11 -11
- package/lib/components/XInputDT.js +37 -37
- package/lib/components/XInputDate.d.ts +13 -13
- package/lib/components/XInputDate.js +63 -63
- package/lib/components/XInputDateDT.d.ts +10 -10
- package/lib/components/XInputDateDT.js +55 -55
- package/lib/components/XInputDecimal.d.ts +15 -15
- package/lib/components/XInputDecimal.js +78 -78
- package/lib/components/XInputDecimalBase.d.ts +12 -12
- package/lib/components/XInputDecimalBase.js +18 -18
- package/lib/components/XInputDecimalDT.d.ts +11 -11
- package/lib/components/XInputDecimalDT.js +74 -74
- package/lib/components/XInputFileList.d.ts +36 -36
- package/lib/components/XInputFileList.js +251 -251
- package/lib/components/XInputInterval.d.ts +14 -0
- package/lib/components/XInputInterval.js +56 -0
- package/lib/components/XInputIntervalBase.d.ts +10 -0
- package/lib/components/XInputIntervalBase.js +97 -0
- package/lib/components/XInputIntervalDT.d.ts +11 -0
- package/lib/components/XInputIntervalDT.js +43 -0
- package/lib/components/XInputText.d.ts +12 -12
- package/lib/components/XInputText.js +69 -69
- package/lib/components/XInputTextDT.d.ts +9 -9
- package/lib/components/XInputTextDT.js +42 -42
- package/lib/components/XInputTextarea.d.ts +18 -18
- package/lib/components/XInputTextarea.js +85 -85
- package/lib/components/XLazyDataTable.d.ts +78 -78
- package/lib/components/XLazyDataTable.js +899 -885
- package/lib/components/XLocale.d.ts +26 -26
- package/lib/components/XLocale.js +59 -59
- package/lib/components/XLoginDialog.d.ts +8 -8
- package/lib/components/XLoginDialog.js +21 -21
- package/lib/components/XLoginForm.d.ts +7 -7
- package/lib/components/XLoginForm.js +128 -128
- package/lib/components/XObject.d.ts +3 -3
- package/lib/components/XObject.js +2 -2
- package/lib/components/XResponseError.d.ts +11 -11
- package/lib/components/XResponseError.js +32 -32
- package/lib/components/XSearchButton.d.ts +26 -26
- package/lib/components/XSearchButton.js +225 -225
- package/lib/components/XSearchButtonDT.d.ts +12 -12
- package/lib/components/XSearchButtonDT.js +188 -188
- package/lib/components/XSearchButtonOld.d.ts +13 -13
- package/lib/components/XSearchButtonOld.js +212 -212
- package/lib/components/XToOneAssocButton.d.ts +8 -8
- package/lib/components/XToOneAssocButton.js +30 -30
- package/lib/components/XToken.d.ts +6 -6
- package/lib/components/XToken.js +2 -2
- package/lib/components/XUtils.d.ts +84 -74
- package/lib/components/XUtils.js +664 -627
- package/lib/components/XUtilsConversions.d.ts +15 -12
- package/lib/components/XUtilsConversions.js +177 -125
- package/lib/components/XUtilsMetadata.d.ts +39 -39
- package/lib/components/XUtilsMetadata.js +452 -452
- package/lib/components/locale/x-en.json +26 -26
- package/lib/components/useXToken.d.ts +2 -2
- package/lib/components/useXToken.js +44 -44
- package/lib/serverApi/ExportImportParam.d.ts +51 -51
- package/lib/serverApi/ExportImportParam.js +34 -34
- package/lib/serverApi/FindParam.d.ts +35 -34
- package/lib/serverApi/FindParam.js +30 -30
- package/lib/serverApi/FindResult.d.ts +8 -8
- package/lib/serverApi/FindResult.js +2 -2
- package/lib/serverApi/XBrowseMetadata.d.ts +19 -19
- package/lib/serverApi/XBrowseMetadata.js +2 -2
- package/lib/serverApi/XEntityMetadata.d.ts +35 -35
- package/lib/serverApi/XEntityMetadata.js +2 -2
- package/lib/serverApi/XFileJsonField.d.ts +6 -6
- package/lib/serverApi/XFileJsonField.js +2 -2
- package/lib/serverApi/XUser.d.ts +8 -7
- package/lib/serverApi/XUser.js +2 -2
- package/lib/serverApi/XUserAuthenticationIfc.d.ts +9 -9
- package/lib/serverApi/XUserAuthenticationIfc.js +2 -2
- package/lib/serverApi/XUtilsCommon.d.ts +14 -13
- package/lib/serverApi/XUtilsCommon.js +180 -110
- package/package.json +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { XUser } from "./XUser";
|
|
2
|
-
export interface XUserAuthenticationRequest {
|
|
3
|
-
username: string;
|
|
4
|
-
password: string;
|
|
5
|
-
}
|
|
6
|
-
export interface XUserAuthenticationResponse {
|
|
7
|
-
authenticationOk: boolean;
|
|
8
|
-
xUser?: XUser;
|
|
9
|
-
}
|
|
1
|
+
import { XUser } from "./XUser";
|
|
2
|
+
export interface XUserAuthenticationRequest {
|
|
3
|
+
username: string;
|
|
4
|
+
password: string;
|
|
5
|
+
}
|
|
6
|
+
export interface XUserAuthenticationResponse {
|
|
7
|
+
authenticationOk: boolean;
|
|
8
|
+
xUser?: XUser;
|
|
9
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
export declare class XUtilsCommon {
|
|
2
|
-
static newLine: string;
|
|
3
|
-
static getValueByPath(object: any, path: string): any;
|
|
4
|
-
static
|
|
5
|
-
static
|
|
6
|
-
static
|
|
7
|
-
static
|
|
8
|
-
static
|
|
9
|
-
static
|
|
10
|
-
static
|
|
11
|
-
static
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
export declare class XUtilsCommon {
|
|
2
|
+
static newLine: string;
|
|
3
|
+
static getValueByPath(object: any, path: string): any;
|
|
4
|
+
static getValueOrValueListByPath(object: any, path: string): any | any[];
|
|
5
|
+
static getFieldListForPath(path: string): string[];
|
|
6
|
+
static getFieldAndRestPath(path: string): [string, string | null];
|
|
7
|
+
static getPathToAssoc(path: string): string;
|
|
8
|
+
static isSingleField(path: string): boolean;
|
|
9
|
+
static objectAsJSON(value: any): string;
|
|
10
|
+
static getDayName(date: Date | null | undefined): string | undefined;
|
|
11
|
+
static dateAddDays(date: Date | null, days: number): Date | null;
|
|
12
|
+
static findFirstMatch(pattern: RegExp, value: string): string | null;
|
|
13
|
+
}
|
|
14
|
+
export declare const dateFormat: any;
|
|
@@ -1,110 +1,180 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __read = (this && this.__read) || function (o, n) {
|
|
3
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
4
|
-
if (!m) return o;
|
|
5
|
-
var i = m.call(o), r, ar = [], e;
|
|
6
|
-
try {
|
|
7
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
8
|
-
}
|
|
9
|
-
catch (error) { e = { error: error }; }
|
|
10
|
-
finally {
|
|
11
|
-
try {
|
|
12
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
13
|
-
}
|
|
14
|
-
finally { if (e) throw e.error; }
|
|
15
|
-
}
|
|
16
|
-
return ar;
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
var
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
3
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
4
|
+
if (!m) return o;
|
|
5
|
+
var i = m.call(o), r, ar = [], e;
|
|
6
|
+
try {
|
|
7
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
8
|
+
}
|
|
9
|
+
catch (error) { e = { error: error }; }
|
|
10
|
+
finally {
|
|
11
|
+
try {
|
|
12
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
13
|
+
}
|
|
14
|
+
finally { if (e) throw e.error; }
|
|
15
|
+
}
|
|
16
|
+
return ar;
|
|
17
|
+
};
|
|
18
|
+
var __values = (this && this.__values) || function(o) {
|
|
19
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
20
|
+
if (m) return m.call(o);
|
|
21
|
+
if (o && typeof o.length === "number") return {
|
|
22
|
+
next: function () {
|
|
23
|
+
if (o && i >= o.length) o = void 0;
|
|
24
|
+
return { value: o && o[i++], done: !o };
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
28
|
+
};
|
|
29
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
30
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
31
|
+
if (ar || !(i in from)) {
|
|
32
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
33
|
+
ar[i] = from[i];
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.dateFormat = exports.XUtilsCommon = void 0;
|
|
40
|
+
// funkcie spolocne pre Web i pre Server
|
|
41
|
+
var XUtilsCommon = /** @class */ (function () {
|
|
42
|
+
function XUtilsCommon() {
|
|
43
|
+
}
|
|
44
|
+
// TODO - toto by sme mohli doplnit o kontrolu ak programator urobil preklep
|
|
45
|
+
XUtilsCommon.getValueByPath = function (object, path) {
|
|
46
|
+
var _a = __read(XUtilsCommon.getFieldAndRestPath(path), 2), field = _a[0], restPath = _a[1];
|
|
47
|
+
if (restPath === null) {
|
|
48
|
+
return object[field];
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
var assocObject = object[field];
|
|
52
|
+
// pri vytvarani noveho riadku - assocObject neni v novom objekte ani ako null (je undefined)
|
|
53
|
+
if (assocObject !== null && assocObject !== undefined) {
|
|
54
|
+
return XUtilsCommon.getValueByPath(assocObject, restPath);
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
return null; // asociovany objekt je null, aj hodnota atributu bude null
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
// vseobecnejsia verzia, ktora funguje aj pre *toMany asociacie
|
|
62
|
+
// TODO - toto by sme mohli doplnit o kontrolu ak programator urobil preklep
|
|
63
|
+
XUtilsCommon.getValueOrValueListByPath = function (object, path) {
|
|
64
|
+
var e_1, _a;
|
|
65
|
+
var _b = __read(XUtilsCommon.getFieldAndRestPath(path), 2), field = _b[0], restPath = _b[1];
|
|
66
|
+
if (restPath === null) {
|
|
67
|
+
return object[field];
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
var assocObject = object[field];
|
|
71
|
+
if (Array.isArray(assocObject)) {
|
|
72
|
+
// natrafili sme na pole (atribut "field" je *toMany asociacia), pozbierame hodnoty z pola
|
|
73
|
+
var resultValueList = [];
|
|
74
|
+
try {
|
|
75
|
+
for (var assocObject_1 = __values(assocObject), assocObject_1_1 = assocObject_1.next(); !assocObject_1_1.done; assocObject_1_1 = assocObject_1.next()) {
|
|
76
|
+
var assocObjectItem = assocObject_1_1.value;
|
|
77
|
+
if (assocObjectItem !== null && assocObjectItem !== undefined) { // pre istotu, nemalo by nastat
|
|
78
|
+
var itemValue = XUtilsCommon.getValueOrValueListByPath(assocObjectItem, restPath);
|
|
79
|
+
if (Array.isArray(itemValue)) {
|
|
80
|
+
resultValueList.push.apply(resultValueList, __spreadArray([], __read(itemValue), false));
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
resultValueList.push(itemValue);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
resultValueList.push(null);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
92
|
+
finally {
|
|
93
|
+
try {
|
|
94
|
+
if (assocObject_1_1 && !assocObject_1_1.done && (_a = assocObject_1.return)) _a.call(assocObject_1);
|
|
95
|
+
}
|
|
96
|
+
finally { if (e_1) throw e_1.error; }
|
|
97
|
+
}
|
|
98
|
+
return resultValueList;
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
// pri vytvarani noveho riadku - assocObject neni v novom objekte ani ako null (je undefined)
|
|
102
|
+
if (assocObject !== null && assocObject !== undefined) {
|
|
103
|
+
return XUtilsCommon.getValueOrValueListByPath(assocObject, restPath);
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
106
|
+
return null; // asociovany objekt je null, aj hodnota atributu bude null
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
XUtilsCommon.getFieldListForPath = function (path) {
|
|
112
|
+
return path.split('.');
|
|
113
|
+
};
|
|
114
|
+
XUtilsCommon.getFieldAndRestPath = function (path) {
|
|
115
|
+
var posDot = path.indexOf(".");
|
|
116
|
+
if (posDot === -1) {
|
|
117
|
+
return [path, null];
|
|
118
|
+
}
|
|
119
|
+
else {
|
|
120
|
+
var assocField = path.substring(0, posDot);
|
|
121
|
+
var restPath = path.substring(posDot + 1);
|
|
122
|
+
return [assocField, restPath];
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
XUtilsCommon.getPathToAssoc = function (path) {
|
|
126
|
+
var posDot = path.lastIndexOf(".");
|
|
127
|
+
if (posDot === -1) {
|
|
128
|
+
throw "Path to assoc could not be retrieved. Path ".concat(path, " must have at least 2 items.");
|
|
129
|
+
}
|
|
130
|
+
else {
|
|
131
|
+
return path.substring(0, posDot);
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
XUtilsCommon.isSingleField = function (path) {
|
|
135
|
+
return path.indexOf(".") === -1;
|
|
136
|
+
};
|
|
137
|
+
XUtilsCommon.objectAsJSON = function (value) {
|
|
138
|
+
// sem treba dat nejaku pre nas vhodnu serializaciu
|
|
139
|
+
// zatial provizorne robene cez antipatern - modifikaciu prototype funcii primitivnych typov
|
|
140
|
+
// TODO - bud pouzit nejaky serializator alebo nakodit vlastnu rekurzivnu iteraciu objektov alebo pouzit druhy parameter v JSON.stringify - konvertovaciu funkciu
|
|
141
|
+
var dateToJSONOriginal = Date.prototype.toJSON;
|
|
142
|
+
Date.prototype.toJSON = function () {
|
|
143
|
+
// TODO - ak pre datetime nastavime vsetky zlozky casu na 00:00:00, tak sformatuje hodnotu ako datum a spravi chybu pri zapise do DB - zapise 1:00:00
|
|
144
|
+
var dateStr;
|
|
145
|
+
if (this.getHours() === 0 && this.getMinutes() === 0 && this.getSeconds() === 0) {
|
|
146
|
+
dateStr = (0, exports.dateFormat)(this, 'yyyy-mm-dd');
|
|
147
|
+
}
|
|
148
|
+
else {
|
|
149
|
+
// jedna sa o datetime
|
|
150
|
+
dateStr = (0, exports.dateFormat)(this, 'yyyy-mm-dd HH:MM:ss');
|
|
151
|
+
}
|
|
152
|
+
return dateStr;
|
|
153
|
+
};
|
|
154
|
+
var json = JSON.stringify(value);
|
|
155
|
+
// vratime naspet povodnu funkciu
|
|
156
|
+
Date.prototype.toJSON = dateToJSONOriginal;
|
|
157
|
+
return json;
|
|
158
|
+
};
|
|
159
|
+
XUtilsCommon.getDayName = function (date) {
|
|
160
|
+
var days = ['nedeľa', 'pondelok', 'utorok', 'streda', 'štvrtok', 'piatok', 'sobota'];
|
|
161
|
+
return date ? days[date.getDay()] : undefined;
|
|
162
|
+
};
|
|
163
|
+
XUtilsCommon.dateAddDays = function (date, days) {
|
|
164
|
+
var result = null;
|
|
165
|
+
if (date !== null) {
|
|
166
|
+
result = new Date(date);
|
|
167
|
+
result.setDate(result.getDate() + days);
|
|
168
|
+
}
|
|
169
|
+
return result;
|
|
170
|
+
};
|
|
171
|
+
XUtilsCommon.findFirstMatch = function (pattern, value) {
|
|
172
|
+
var match = pattern.exec(value);
|
|
173
|
+
return match != null ? match[0] : null;
|
|
174
|
+
};
|
|
175
|
+
XUtilsCommon.newLine = '\n';
|
|
176
|
+
return XUtilsCommon;
|
|
177
|
+
}());
|
|
178
|
+
exports.XUtilsCommon = XUtilsCommon;
|
|
179
|
+
// nevedel som importnut dateFormat, tak som to dal sem aby som nemusel vsade pouzivat require("dateformat")
|
|
180
|
+
exports.dateFormat = require("dateformat");
|