mirror of
https://github.com/discourse/discourse.git
synced 2024-11-26 19:00:32 -06:00
Show full dates with smaller font in topic lists
This commit is contained in:
parent
d16b4487d5
commit
845c2b62cc
@ -2,7 +2,7 @@ Discourse.Formatter = (function(){
|
||||
|
||||
var updateRelativeAge, autoUpdatingRelativeAge, relativeAge, relativeAgeTiny,
|
||||
relativeAgeMedium, relativeAgeMediumSpan, longDate, toTitleCase,
|
||||
shortDate, shortDateNoYear, tinyDateYear, breakUp;
|
||||
shortDate, shortDateNoYear, tinyDateYear, breakUp, relativeAgeTinyShowsYear;
|
||||
|
||||
/*
|
||||
* memoize.js
|
||||
@ -143,11 +143,17 @@ Discourse.Formatter = (function(){
|
||||
options.wrapInSpan = false;
|
||||
}
|
||||
|
||||
var relAge = relativeAge(date, options);
|
||||
|
||||
if (format === 'tiny' && relativeAgeTinyShowsYear(relAge)) {
|
||||
append += " with-year";
|
||||
}
|
||||
|
||||
if (options.title) {
|
||||
append += "' title='" + longDate(date);
|
||||
}
|
||||
|
||||
return "<span class='relative-date" + append + "' data-time='" + date.getTime() + "' data-format='" + format + "'>" + relativeAge(date, options) + "</span>";
|
||||
return "<span class='relative-date" + append + "' data-time='" + date.getTime() + "' data-format='" + format + "'>" + relAge + "</span>";
|
||||
};
|
||||
|
||||
|
||||
@ -196,6 +202,14 @@ Discourse.Formatter = (function(){
|
||||
return formatted;
|
||||
};
|
||||
|
||||
/*
|
||||
* Returns true if the given tiny date string includes the year.
|
||||
* Useful for checking if the string isn't so tiny.
|
||||
*/
|
||||
relativeAgeTinyShowsYear = function(relativeAgeString) {
|
||||
return relativeAgeString.match(/'[\d]{2}$/);
|
||||
};
|
||||
|
||||
relativeAgeMediumSpan = function(distance, leaveAgo) {
|
||||
var formatted, distanceInMinutes;
|
||||
|
||||
|
@ -219,11 +219,15 @@
|
||||
width: 65px;
|
||||
}
|
||||
.activity {
|
||||
width: 50px;
|
||||
width: 60px;
|
||||
}
|
||||
.age {
|
||||
width: 60px;
|
||||
}
|
||||
.with-year {
|
||||
font-size: 85%;
|
||||
white-space: nowrap;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -157,6 +157,12 @@
|
||||
color: inherit;
|
||||
}
|
||||
}
|
||||
.age {
|
||||
white-space: nowrap;
|
||||
.with-year {
|
||||
font-size: 85%;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Category list
|
||||
|
Loading…
Reference in New Issue
Block a user