goodbye NaNy
This commit is contained in:
parent
2a43d70869
commit
ae1f5b3de0
|
@ -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")
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue