Skip to content

Commit

Permalink
default year 2024
Browse files Browse the repository at this point in the history
  • Loading branch information
ericjeangirard committed Jan 17, 2025
1 parent d288a24 commit 63a8720
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions client/src/pages/openalex-affiliations/search.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import 'intro.js/introjs.css';
const { VITE_APP_TAG_LIMIT } = import.meta.env;

const START_YEAR = 2010;
const DEFAULT_YEAR = '2024';
// Generate an array of objects with all years from START_YEAR
const years = [...Array(new Date().getFullYear() - START_YEAR + 1).keys()]
.sort((a, b) => b - a)
Expand Down Expand Up @@ -52,10 +53,10 @@ export default function Search() {
setSearchParams({
affiliations: searchParams.getAll('affiliations') ?? [],
deletedAffiliations: searchParams.getAll('deletedAffiliations') ?? [],
endYear: searchParams.get('endYear') ?? '2023',
endYear: searchParams.get('endYear') ?? DEFAULT_YEAR,
excludedRors: searchParams.get('excludedRors') ?? '',
getRorChildren: searchParams.get('getRorChildren') ?? '0',
startYear: searchParams.get('startYear') ?? '2023',
startYear: searchParams.get('startYear') ?? DEFAULT_YEAR,
});
setTags([]);
} else {
Expand All @@ -65,10 +66,10 @@ export default function Search() {
setCurrentSearchParams({
affiliations,
deletedAffiliations: deletedAffiliations1,
endYear: searchParams.get('endYear') ?? '2023',
endYear: searchParams.get('endYear') ?? DEFAULT_YEAR,
excludedRors: searchParams.get('excludedRors') ?? '',
getRorChildren: searchParams.get('getRorChildren') ?? '0',
startYear: searchParams.get('startYear') ?? '2023',
startYear: searchParams.get('startYear') ?? DEFAULT_YEAR,
});
setExcludedRors(currentSearchParams.excludedRors);
const newSearchedAffiliations = affiliations.filter(
Expand Down

0 comments on commit 63a8720

Please sign in to comment.