mirror of
https://github.com/discourse/discourse.git
synced 2025-03-31 18:25:59 +08:00
correct coldmaps
This commit is contained in:
parent
f5379cee89
commit
ad46a490cc
app/assets/javascripts/discourse
@ -12,8 +12,14 @@ function coldAgeClass(property, options) {
|
|||||||
|
|
||||||
if (!dt) { return className; }
|
if (!dt) { return className; }
|
||||||
|
|
||||||
|
var startDate = (options && options.hash && options.hash.startDate) || new Date();
|
||||||
|
|
||||||
|
if (typeof startDate === "string") {
|
||||||
|
startDate = Em.Handlebars.get(this, startDate, options);
|
||||||
|
}
|
||||||
|
|
||||||
// Show heat on age
|
// Show heat on age
|
||||||
var nowDays = daysSinceEpoch(new Date()),
|
var nowDays = daysSinceEpoch(startDate),
|
||||||
epochDays = daysSinceEpoch(new Date(dt));
|
epochDays = daysSinceEpoch(new Date(dt));
|
||||||
|
|
||||||
if (nowDays - epochDays > Discourse.SiteSettings.cold_age_days_high) return className + ' coldmap-high';
|
if (nowDays - epochDays > Discourse.SiteSettings.cold_age_days_high) return className + ' coldmap-high';
|
||||||
|
@ -1 +1 @@
|
|||||||
<{{this.tagName}} class="{{cold-age-class "topic.bumpedAt" class=this.class}} activity" title="{{get "topic.bumpedAtTitle"}}"><a href="{{get "topic.lastPostUrl"}}">{{format-date "topic.bumpedAt" format="tiny" noTitle=true}}</a></{{this.tagName}}>
|
<{{this.tagName}} class="{{cold-age-class "topic.createdAt" startDate="topic.bumpedAt" class=this.class}} activity" title="{{get "topic.bumpedAtTitle"}}"><a href="{{get "topic.lastPostUrl"}}">{{format-date "topic.bumpedAt" format="tiny" noTitle=true}}</a></{{this.tagName}}>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user