Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): update typescript-eslint monorepo to v5.43.0 #4473

Merged
merged 3 commits into from
Nov 20, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
chore: use optional chain to simplified how to convert a date range t…
…o a date option
  • Loading branch information
PenghaiZhang committed Nov 18, 2022
commit d61bc9b11026be817ffd6beaef50f261701aca8e
8 changes: 3 additions & 5 deletions react-front-end/tsrc/components/DateRangeSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -250,18 +250,16 @@ export const DateRangeSelector = ({
const dateRangeToDateOptionConverter = (dateRange?: DateRange): string => {
let option = quickOptionLabels.all;
if (
!dateRange ||
!dateRange.start ||
(dateRange.end &&
dateRange.end.toDateString() !== new Date().toDateString())
!dateRange?.start ||
dateRange.end?.toDateString() !== new Date().toDateString()
) {
return option;
}

const start = DateTime.fromJSDate(dateRange.start);
getDateRangeOptions().forEach(
(dateTime: DateTime | undefined, label: string) => {
if (dateTime && dateTime.toISODate() === start.toISODate()) {
if (dateTime?.toISODate() === start.toISODate()) {
option = label;
}
}
Expand Down