mirror of
https://github.com/discourse/discourse.git
synced 2025-06-05 14:07:30 +08:00
goodbye NaNy
This commit is contained in:
@ -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)
|
||||||
|
Reference in New Issue
Block a user