correct coldmaps
This commit is contained in:
parent
f5379cee89
commit
ad46a490cc
|
@ -12,8 +12,14 @@ function coldAgeClass(property, options) {
|
|||
|
||||
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
|
||||
var nowDays = daysSinceEpoch(new Date()),
|
||||
var nowDays = daysSinceEpoch(startDate),
|
||||
epochDays = daysSinceEpoch(new Date(dt));
|
||||
|
||||
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…
Reference in New Issue