LocalizedTimeAgo
LocalizedTimeAgo copied to clipboard
Optimize date component calculation
Before this change, the date components were being calculated on each if / else if condition. This change removes the redundant calculation by making a local copy of the components before the if / else if conditions are reached.
This change also adds the option to specify the reference date, rather than limiting the reference date to now.