refactor: Remove today arg from absolute_time.

The today argument was only used in tests and now we're using
MockDate to set the current date.
This commit is contained in:
Shubham Padia
2024-01-15 14:15:56 +07:00
committed by Tim Abbott
parent 3d2110be51
commit a43a898e12
2 changed files with 22 additions and 10 deletions

View File

@@ -465,7 +465,8 @@ export function format_time_modern(time: number | Date, today = new Date()): str
// this is for rendering absolute time based off the preferences for twenty-four
// hour time in the format of "%mmm %d, %h:%m %p".
export function absolute_time(timestamp: number, today = new Date()): string {
export function absolute_time(timestamp: number): string {
const today = new Date();
const date = new Date(timestamp);
const is_older_year = today.getFullYear() - date.getFullYear() > 0;