refactor: Remove today arg from render_date and use MockDate for tests.

Fixes #26774.
We don't need the today argument anymore since every value passed to
it was a new Date() except the tests where we are using MockDate now.
This commit is contained in:
Shubham Padia
2024-01-15 13:38:00 +07:00
committed by Tim Abbott
parent a15d4e2be7
commit 3a233d73c1
3 changed files with 10 additions and 11 deletions

View File

@@ -364,10 +364,10 @@ function render_date_span($elem: JQuery, rendered_time: TimeRender): JQuery {
// (What's actually spliced into the message template is the contents
// of this DOM node as HTML, so effectively a copy of the node. That's
// okay since to update the time later we look up the node by its id.)
export function render_date(time: Date, today: Date): JQuery {
export function render_date(time: Date): JQuery {
const className = `timerender${next_timerender_id}`;
next_timerender_id += 1;
const rendered_time = render_now(time, today);
const rendered_time = render_now(time);
let $node = $("<span>").attr("class", className);
$node = render_date_span($node, rendered_time);
maybe_add_update_list_entry({