handling of year & planetary computer
mrd opened this issue · comments
Line 266 in 7a52a5d
Note that year
here is a string (character) not a number so the <, > operators are probably doing lexicographical comparison, not numerical. If someone provides a string like '2020a' it would pass your check even though that is a bad input. The initial thought is just to check directly if the year is '2020' or '2021' explicitly, no need to use inequalities.
More generally, this is something that will probably change in the future and for production purposes it's probably best not to hardcode these years into the code. Can valid years be detected from the planetary computer API?
Changed it by detecting the date in PC