fix the page could not load properly when selecting the same date in trend analysis

This commit is contained in:
MaysWind
2024-08-12 01:06:03 +08:00
parent 52dfee9ca6
commit 80396a444e
2 changed files with 18 additions and 2 deletions
+15
View File
@@ -99,6 +99,21 @@ export function isEquals(obj1, obj2) {
}
}
export function isYearMonthEquals(val1, val2) {
if (typeof(val1) !== 'string' || typeof(val2) !== 'string') {
return false;
}
const items1 = val1.split('-');
const items2 = val2.split('-');
if (items1.length !== 2 || items2.length !== 2) {
return false;
}
return (parseInt(items1[0]) && parseInt(items1[1])) && (parseInt(items1[0]) === parseInt(items2[0])) && (parseInt(items1[1]) === parseInt(items2[1]));
}
export function isObjectEmpty(obj) {
if (!obj) {
return true;