Skip to content

Commit 5b2a53a

Browse files
Assuring start-date is never before 1980-01-01 (#52)
This is an issue that may happen when users select start dates beyond the range defined for this dataset. Reported-by: Wouter Knoben <wouter.knoben@ucalgary.ca> Signed-off-by: Kasra Keshavarz <kasra.keshavarz1@ucalgary.ca>
1 parent ffdef9d commit 5b2a53a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

scripts/eccc-rdrs/rdrs.sh

+5
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,11 @@ endDateInt=$(date --date="$endDate" +"%Y%m%d")
249249
if [[ $endDateInt -gt "20181230" ]]; then
250250
endDate="2018-12-30T23:00:00"
251251
fi
252+
# Assure the start-date is not before 1980-01-01
253+
startDateInt=$(date --date="$startDate" +"%Y%m%d")
254+
if [[ $startDateInt -lt "19800101" ]]; then
255+
startDate="1980-01-01T12:00:00"
256+
fi
252257

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

0 commit comments

Comments
 (0)