fenextjs-date
Advanced tools
Comparing version 3.2.3 to 3.2.4
@@ -47,3 +47,3 @@ export interface FenextjsDateFormatOptions extends Intl.DateTimeFormatOptions { | ||
}): boolean; | ||
onCompareDate({ date, dateCompare: dateCompareProps, compare, compareSymbol, }: { | ||
onCompareDate({ date, dateCompare: dateCompareProps, compare, }: { | ||
date?: Date; | ||
@@ -54,13 +54,10 @@ dateCompare: Date; | ||
}; | ||
compareSymbol: { | ||
[id in FenextjsDateCompareSymbolType]?: boolean; | ||
}; | ||
}): { | ||
"=="?: boolean | undefined; | ||
"!="?: boolean | undefined; | ||
">"?: boolean | undefined; | ||
">="?: boolean | undefined; | ||
"<"?: boolean | undefined; | ||
"<="?: boolean | undefined; | ||
"==": boolean; | ||
"!=": boolean; | ||
">": boolean; | ||
">=": boolean; | ||
"<": boolean; | ||
"<=": boolean; | ||
}; | ||
} |
@@ -147,6 +147,13 @@ "use strict"; | ||
} | ||
onCompareDate({ date, dateCompare: dateCompareProps, compare, compareSymbol, }) { | ||
onCompareDate({ date, dateCompare: dateCompareProps, compare, }) { | ||
const d = new Date(date ?? this.date); | ||
const dateCompare = new Date(dateCompareProps); | ||
const compareValue = {}; | ||
const compareValue = { | ||
"!=": true, | ||
"<": true, | ||
"<=": true, | ||
"==": true, | ||
">": true, | ||
">=": true, | ||
}; | ||
exports.FenextjsDateCompare.forEach((e) => { | ||
@@ -162,5 +169,3 @@ const compareKey = e; | ||
const compareKeySymbol = b; | ||
if (compareSymbol[compareKeySymbol] === true) { | ||
compareValue[compareKeySymbol] = eval(`${d.getTime()} ${compareKeySymbol} ${dateCompare.getTime()}`); | ||
} | ||
compareValue[compareKeySymbol] = eval(`${d.getTime()} ${compareKeySymbol} ${dateCompare.getTime()}`); | ||
}); | ||
@@ -167,0 +172,0 @@ return compareValue; |
{ | ||
"name": "fenextjs-date", | ||
"version": "3.2.3", | ||
"version": "3.2.4", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "./cjs/index.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
234
15300