mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +00:00 
			
		
		
		
	user popover: Remove repetitive "Last seen" text from all last seens.
This text was unnecessary. Fixes part of #10303.
This commit is contained in:
		
				
					committed by
					
						
						Tim Abbott
					
				
			
			
				
	
			
			
			
						parent
						
							7b307fa58f
						
					
				
				
					commit
					e398b25429
				
			@@ -241,34 +241,34 @@ run_test('last_seen_status_from_date', () => {
 | 
			
		||||
                i18n.t("Just now"));
 | 
			
		||||
 | 
			
		||||
    assert_same(function (d) { return d.addMinutes(-30); },
 | 
			
		||||
                i18n.t("Last seen 30 minutes ago"));
 | 
			
		||||
                i18n.t("30 minutes ago"));
 | 
			
		||||
 | 
			
		||||
    assert_same(function (d) { return d.addHours(-1); },
 | 
			
		||||
                i18n.t("Last seen an hour ago"));
 | 
			
		||||
                i18n.t("An hour ago"));
 | 
			
		||||
 | 
			
		||||
    assert_same(function (d) { return d.addHours(-2); },
 | 
			
		||||
                i18n.t("Last seen 2 hours ago"));
 | 
			
		||||
                i18n.t("2 hours ago"));
 | 
			
		||||
 | 
			
		||||
    assert_same(function (d) { return d.addHours(-20); },
 | 
			
		||||
                i18n.t("Last seen 20 hours ago"));
 | 
			
		||||
                i18n.t("20 hours ago"));
 | 
			
		||||
 | 
			
		||||
    assert_same(function (d) { return d.addDays(-1); },
 | 
			
		||||
                i18n.t("Last seen yesterday"));
 | 
			
		||||
                i18n.t("Yesterday"));
 | 
			
		||||
 | 
			
		||||
    assert_same(function (d) { return d.addDays(-2); },
 | 
			
		||||
                i18n.t("Last seen on Feb 28"));
 | 
			
		||||
                i18n.t("On Feb 28"));
 | 
			
		||||
 | 
			
		||||
    assert_same(function (d) { return d.addDays(-61); },
 | 
			
		||||
                i18n.t("Last seen on Dec 31"));
 | 
			
		||||
                i18n.t("On Dec 31"));
 | 
			
		||||
 | 
			
		||||
    assert_same(function (d) { return d.addDays(-300); },
 | 
			
		||||
                i18n.t("Last seen on May 06"));
 | 
			
		||||
                i18n.t("On May 06"));
 | 
			
		||||
 | 
			
		||||
    assert_same(function (d) { return d.addDays(-366); },
 | 
			
		||||
                i18n.t("Last seen on Mar 01, 2015"));
 | 
			
		||||
                i18n.t("On Mar 01, 2015"));
 | 
			
		||||
 | 
			
		||||
    assert_same(function (d) { return d.addYears(-3); },
 | 
			
		||||
                i18n.t("Last seen on Mar 01, 2013"));
 | 
			
		||||
                i18n.t("On Mar 01, 2013"));
 | 
			
		||||
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -73,27 +73,27 @@ exports.last_seen_status_from_date = function (last_active_date, current_date) {
 | 
			
		||||
        return i18n.t("Just now");
 | 
			
		||||
    }
 | 
			
		||||
    if (minutes < 60) {
 | 
			
		||||
        return i18n.t("Last seen __minutes__ minutes ago", {minutes: minutes});
 | 
			
		||||
        return i18n.t("__minutes__ minutes ago", {minutes: minutes});
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    var hours = Math.floor(minutes / 60);
 | 
			
		||||
    if (hours === 1) {
 | 
			
		||||
        return i18n.t("Last seen an hour ago");
 | 
			
		||||
        return i18n.t("An hour ago");
 | 
			
		||||
    }
 | 
			
		||||
    if (hours < 24) {
 | 
			
		||||
        return i18n.t("Last seen __hours__ hours ago", {hours: hours});
 | 
			
		||||
        return i18n.t("__hours__ hours ago", {hours: hours});
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    var days = Math.floor(hours / 24);
 | 
			
		||||
    if (days === 1) {
 | 
			
		||||
        return [i18n.t("Last seen yesterday")];
 | 
			
		||||
        return [i18n.t("Yesterday")];
 | 
			
		||||
    }
 | 
			
		||||
    if (days < 365) {
 | 
			
		||||
        return i18n.t("Last seen on __last_active__",
 | 
			
		||||
        return i18n.t("On __last_active__",
 | 
			
		||||
                      {last_active: last_active_date.toString("MMM\xa0dd")});
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    return i18n.t("Last seen on __last_active_date__",
 | 
			
		||||
    return i18n.t("On __last_active_date__",
 | 
			
		||||
                  {last_active_date: last_active_date.toString("MMM\xa0dd,\xa0yyyy")});
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user