« first day (159 days earlier)      last day (1511 days later) » 

mat
1:56 PM
One thing seems clear: Even if you run it as is, you get error messages in Try it online: "Type error: character_code' expected, found -1' (an integer)". So, it seems to have problems with this input in the first place. I recommend you also try it on the terminal for comparison.
 

« first day (159 days earlier)      last day (1511 days later) »