Write a function named timeAgo
that receives 2 Dates as parameters.
The function should return a string that describes the amount of time that has passed between those 2 dates, following this format:
- if less than a minute has passed, return "just now"
- if less than an hour has passed, return "x minutes ago"
- if less than a day has passed, return "x hours ago"
- if less than a month has passed, return "x days ago" (we can consider a month having 30 days)
- if less than a year has passed, return "x months ago"
- else, return "more than a year ago"