drapcode-utility 2.6.6 → 2.6.7
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/build/utils/util.d.ts +1 -1
- package/build/utils/util.js +3 -3
- package/package.json +1 -1
package/build/utils/util.d.ts
CHANGED
|
@@ -102,7 +102,7 @@ export declare const evaluateExpression: (expression: string, data: any, user: a
|
|
|
102
102
|
export declare const evaluateCurrency: (formatType: string, subject: number | string | any, currency: string, position: string, maxFraction: number, user?: any, tenant?: any) => string;
|
|
103
103
|
export declare const evaluateJSLogic: (expression: string, data: any, user: any, envConstants: any) => any;
|
|
104
104
|
export declare const formatDate: (formatType: string, datentime: any, timezone: string, unixType: any, offset?: boolean) => string;
|
|
105
|
-
export declare const dateDifference: (formatType: string, datentime1: any, datentime2: any, timezone: string) => string;
|
|
105
|
+
export declare const dateDifference: (formatType: string, datentime1: any, datentime2: any, timezone: string, dateFormat: string) => string;
|
|
106
106
|
export declare const mergeObjects: (arrayOfObjects: any, data?: any, user?: any, tenant?: any, userSetting?: any, subTenant?: any, sessionValue?: any, envConstants?: any, sessionFormValue?: any, dataTransferObject?: any, localStorageValue?: any, cookiesValue?: any) => any;
|
|
107
107
|
export declare const getFindQuery: (item: any, customKey?: string) => {
|
|
108
108
|
[x: string]: any;
|
package/build/utils/util.js
CHANGED
|
@@ -1114,15 +1114,15 @@ const formatDate = function (formatType, datentime, timezone, unixType, offset =
|
|
|
1114
1114
|
return datentime ? formatDateNTime.format(formatType) : "";
|
|
1115
1115
|
};
|
|
1116
1116
|
exports.formatDate = formatDate;
|
|
1117
|
-
const dateDifference = (formatType, datentime1, datentime2, timezone) => {
|
|
1117
|
+
const dateDifference = (formatType, datentime1, datentime2, timezone, dateFormat) => {
|
|
1118
1118
|
let result = "";
|
|
1119
1119
|
const dateExist = !datentime1 || !datentime2;
|
|
1120
1120
|
const firstDate = datentime1 === "CURRENT_DATE_TIME"
|
|
1121
1121
|
? (0, moment_1.default)().utcOffset(timezone)
|
|
1122
|
-
: (0, moment_1.default)(datentime1).utcOffset(timezone);
|
|
1122
|
+
: (0, moment_1.default)(datentime1, dateFormat).utcOffset(timezone);
|
|
1123
1123
|
const secondDate = datentime2 === "CURRENT_DATE_TIME"
|
|
1124
1124
|
? (0, moment_1.default)().utcOffset(timezone)
|
|
1125
|
-
: (0, moment_1.default)(datentime2).utcOffset(timezone);
|
|
1125
|
+
: (0, moment_1.default)(datentime2, dateFormat).utcOffset(timezone);
|
|
1126
1126
|
const patterns = formatType.split(",");
|
|
1127
1127
|
patterns.forEach((format, i) => {
|
|
1128
1128
|
const diff = firstDate.diff(secondDate, format);
|