I want to create a date range picker component for the charts I was building, but I want it to be able to display the range as human readable text when possible.
It should display text like:
last n days
last n weeks
Jan 1st - Jan 5th
So I built a function that takes two dates,
to, and formats them accordingly.