(toCompare: Date)
| 14 | const now = new Date(2020, 5, 1, 12, 0, 0); |
| 15 | |
| 16 | export const getLabel = (toCompare: Date): string => { |
| 17 | const today = new Date(); |
| 18 | |
| 19 | if (isDateOnlyEqual(today, toCompare)) { |
| 20 | return 'Today'; |
| 21 | } |
| 22 | |
| 23 | if (isDateOnlyEqual(today, addDays(toCompare, 1))) { |
| 24 | return 'Yesterday'; |
| 25 | } |
| 26 | |
| 27 | return ''; |
| 28 | }; |
| 29 | |
| 30 | describe('postDateFormat', () => { |
| 31 | it('should return "Now" when less than a minute', () => { |
no test coverage detected