goodbye NaNy

This commit is contained in:
Sam 2013-06-12 16:38:02 +10:00
parent 2a43d70869
commit ae1f5b3de0
2 changed files with 2 additions and 1 deletions

View File

@ -20,7 +20,7 @@ Discourse.GithubCommit = Discourse.Model.extend({
}.property("sha"), }.property("sha"),
timeAgo: function() { timeAgo: function() {
return Discourse.Formatter.relativeAge(new Date(this.get('commit.committer.date'), {format: 'medium', leaveAgo: true})); return moment(this.get('commit.committer.date')).relativeAge({format: 'medium', leaveAgo: true})
}.property("commit.committer.date") }.property("commit.committer.date")
}); });

View File

@ -31,6 +31,7 @@ module JsLocaleHelper
result << moment_format_function('short_date_no_year') result << moment_format_function('short_date_no_year')
result << moment_format_function('short_date') result << moment_format_function('short_date')
result << moment_format_function('long_date') result << moment_format_function('long_date')
result << "moment.fn.relativeAge = function(opts){ return Discourse.Formatter.relativeAge(this.toDate(), opts)};\n"
end end
def self.moment_format_function(name) def self.moment_format_function(name)