mirror of
https://github.com/zulip/zulip.git
synced 2025-11-07 07:23:22 +00:00
refactor: Remove current_date arg from relative_time_string_from_date.
The current_date argument was only used in tests and now we're using MockDate to set the current date.
This commit is contained in:
committed by
Tim Abbott
parent
3a233d73c1
commit
d5de26ff3b
@@ -213,15 +213,8 @@ export function render_now(time: Date, today = new Date()): TimeRender {
|
||||
}
|
||||
|
||||
// Relative time rendering for use in most screens like Recent conversations.
|
||||
//
|
||||
// Current date is passed as an argument for unit testing
|
||||
export function relative_time_string_from_date({
|
||||
date,
|
||||
current_date = new Date(),
|
||||
}: {
|
||||
date: Date;
|
||||
current_date?: Date;
|
||||
}): string {
|
||||
export function relative_time_string_from_date(date: Date): string {
|
||||
const current_date = new Date();
|
||||
const minutes = differenceInMinutes(current_date, date);
|
||||
if (minutes <= 2) {
|
||||
return $t({defaultMessage: "Just now"});
|
||||
|
||||
Reference in New Issue
Block a user