### All major transitions: Extended ```jsx function get1201() { const d = new Date(); d.setHours(0, 0, 1, 0); return d.getTime(); } function getYesterday1159() { return get1201() - 2 * 60 * 1000; } function getJanuary1201() { const now = new Date(); const d = new Date(now.getFullYear(), 0, 1, 0, 1); return d.getTime(); } function getDecember1159() { return getJanuary1201() - 2 * 60 * 1000; }
{"500ms ago - all below 1 minute are 'now' -- "}
{'Five seconds ago -- '}
{'30 seconds ago -- '}
{'One minute ago - in minutes -- '}
{'30 minutes ago -- '}
{'45 minutes ago (used to round up to 1 hour with moment) -- '}
{'One hour ago - in hours -- '}
{'12:01am today -- '}
{'11:59pm yesterday - adds day name -- '}
{'24 hours ago -- '}
{'Two days ago -- '}
{'Seven days ago - adds month -- '}
{'Thirty days ago -- '}
{'January 1st at 12:01am -- '}
{'December 31st at 11:59pm - adds year -- '}
{'One year ago -- '}
; ``` ### All major transitions: Normal ```jsx function get1201() { const d = new Date(); d.setHours(0, 0, 1, 0); return d.getTime(); } function getYesterday1159() { return get1201() - 2 * 60 * 1000; } function getJanuary1201() { const now = new Date(); const d = new Date(now.getFullYear(), 0, 1, 0, 1); return d.getTime(); } function getDecember1159() { return getJanuary1201() - 2 * 60 * 1000; }
{"500ms ago - all below 1 minute are 'now' -- "}
{'Five seconds ago -- '}
{'30 seconds ago -- '}
{'One minute ago - in minutes -- '}
{'30 minutes ago -- '}
{'45 minutes ago (used to round up to 1 hour with moment) -- '}
{'One hour ago - in hours -- '}
{'12:01am today -- '}
{'11:59pm yesterday - adds day name -- '}
{'24 hours ago -- '}
{'Two days ago -- '}
{'Seven days ago - adds month -- '}
{'Thirty days ago -- '}
{'January 1st at 12:01am -- '}
{'December 31st at 11:59pm - adds year -- '}
{'One year ago -- '}
; ```