TP-56997 | fixed Allocation Date bug in filters (#828)

Co-authored-by: Mantri Ramkishor <mantri.ramkishor@navi.com>
This commit is contained in:
Ashish Deo
2024-02-14 13:30:21 +05:30
committed by GitHub
parent 685c8fb461
commit 6ae57d51e6

View File

@@ -34,6 +34,7 @@ import DateTimePickerComponent from '@cp/src/components/DateTimePicker/DateTimeP
import { DATE_TIME_TYPE } from '@cp/src/components/DateTimePicker/constants';
import { isFunction, isObjectEmpty } from '@cp/utils/commonUtils';
import { GenericObject } from '@cp/src/types/CommonConstans';
import { DateFormat, dateFormat } from '@cp/src/utils/DateHelper';
const CLEAR_ALL_FILTERS_COUNT = 1;
@@ -152,6 +153,12 @@ const TableFilters = ({
} else {
selectedOptionFilterMap[filterKey] = option.value;
}
if (filterKey === CaseFilter.assignedAtFilters) {
if (option.value !== 'select_date_range') {
setFromAssignedAt(option.fromDate);
setTillAssignedAt(option.tillDate);
}
}
} else {
selectedOptionFilterMap = removeSpecificOption(
{ ...selectedOptions },
@@ -288,7 +295,10 @@ const TableFilters = ({
tooltipLabel = selectedOptions?.map((option: any) => option?.label)?.join(', ');
} else {
if (filterKey === CaseFilter.assignedAtFilters) {
tooltipLabel = `${fromAssignedAt} - ${tillAssignedAt}`;
tooltipLabel = `${dateFormat(
new Date(fromAssignedAt),
DateFormat.LONG_DATE_FORMAT_WITHOUT_TIME
)} - ${dateFormat(new Date(tillAssignedAt), DateFormat.LONG_DATE_FORMAT_WITHOUT_TIME)}`;
} else {
tooltipLabel = selectedOptions?.label || '';
}