Skip to content

Commit

Permalink
Assuring start-date is never before 1980-01-01 (#52)
Browse files Browse the repository at this point in the history
This is an issue that may happen when users select start dates beyond
the range defined for this dataset.

Reported-by: Wouter Knoben <[email protected]>

Signed-off-by: Kasra Keshavarz <[email protected]>
  • Loading branch information
kasra-keshavarz authored May 21, 2024
1 parent ffdef9d commit 5b2a53a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions scripts/eccc-rdrs/rdrs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,11 @@ endDateInt=$(date --date="$endDate" +"%Y%m%d")
if [[ $endDateInt -gt "20181230" ]]; then
endDate="2018-12-30T23:00:00"
fi
# Assure the start-date is not before 1980-01-01
startDateInt=$(date --date="$startDate" +"%Y%m%d")
if [[ $startDateInt -lt "19800101" ]]; then
startDate="1980-01-01T12:00:00"
fi

# assign proper variables for dates
startYear=$(date --date="$startDate" +"%Y") # start year (first folder)
Expand Down

0 comments on commit 5b2a53a

Please sign in to comment.