[WEB-782] fix: Date timezone changes error (#3992)
* fix date related exceptions * replace new Date from develop branch changes as well * changes from self review * wrap getDate logic with try catch to handle in case of error scenarios * fix formatted time
This commit is contained in:
parent
7d3a96b3d0
commit
cb4cfa1dd5
17 changed files with 127 additions and 83 deletions
|
|
@ -1,6 +1,7 @@
|
|||
import sortBy from "lodash/sortBy";
|
||||
// helpers
|
||||
import { satisfiesDateFilter } from "@/helpers/filter.helper";
|
||||
import { getDate } from "@/helpers/date-time.helper";
|
||||
// types
|
||||
import { IModule, TModuleDisplayFilters, TModuleFilters, TModuleOrderByOptions } from "@plane/types";
|
||||
|
||||
|
|
@ -62,15 +63,15 @@ export const shouldFilterModule = (
|
|||
fallsInFilters = fallsInFilters && filters.members.some((memberId) => memberIds.includes(memberId));
|
||||
}
|
||||
if (filterKey === "start_date" && filters.start_date && filters.start_date.length > 0) {
|
||||
const startDate = getDate(module.start_date);
|
||||
filters.start_date.forEach((dateFilter) => {
|
||||
fallsInFilters =
|
||||
fallsInFilters && !!module.start_date && satisfiesDateFilter(new Date(module.start_date), dateFilter);
|
||||
fallsInFilters = fallsInFilters && !!startDate && satisfiesDateFilter(startDate, dateFilter);
|
||||
});
|
||||
}
|
||||
if (filterKey === "target_date" && filters.target_date && filters.target_date.length > 0) {
|
||||
const endDate = getDate(module.target_date);
|
||||
filters.target_date.forEach((dateFilter) => {
|
||||
fallsInFilters =
|
||||
fallsInFilters && !!module.target_date && satisfiesDateFilter(new Date(module.target_date), dateFilter);
|
||||
fallsInFilters = fallsInFilters && !!endDate && satisfiesDateFilter(endDate, dateFilter);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue