FIX #1831: Dates were unbound on the profile page.

This commit is contained in:
Robin Ward 2014-01-17 16:24:45 -05:00
parent 6131829df0
commit f47e8e12dd
2 changed files with 6 additions and 3 deletions

View File

@ -327,7 +327,10 @@ Handlebars.registerHelper('unboundDate', function(property, options) {
var date = new Date(val);
return new Handlebars.SafeString(Discourse.Formatter.autoUpdatingRelativeAge(date, {format: 'medium', title: true, leaveAgo: leaveAgo}));
}
});
Ember.Handlebars.registerBoundHelper('date', function(dt) {
return new Handlebars.SafeString(Discourse.Formatter.autoUpdatingRelativeAge(new Date(dt), {format: 'medium', title: true }));
});
/**

View File

@ -58,13 +58,13 @@
<dt>{{i18n user.website}}</dt><dd><a {{bindAttr href="website"}} target="_blank">{{websiteName}}</a></dd>
{{/if}}
{{#if created_at}}
<dt>{{i18n user.created}}</dt><dd>{{unboundDate created_at}}</dd>
<dt>{{i18n user.created}}</dt><dd>{{date created_at}}</dd>
{{/if}}
{{#if last_posted_at}}
<dt>{{i18n user.last_posted}}</dt><dd>{{unboundDate last_posted_at}}</dd>
<dt>{{i18n user.last_posted}}</dt><dd>{{date last_posted_at}}</dd>
{{/if}}
{{#if last_seen_at}}
<dt>{{i18n user.last_seen}}</dt><dd>{{unboundDate last_seen_at}}</dd>
<dt>{{i18n user.last_seen}}</dt><dd>{{date last_seen_at}}</dd>
{{/if}}
{{#if invited_by}}
<dt>{{i18n user.invited_by}}</dt><dd>{{#link-to 'userActivity' invited_by}}{{invited_by.username}}{{/link-to}}</dd>