Remove Date hack, which was used for timeago
This commit is contained in:
parent
754e6af17c
commit
8d9b36c0a6
|
@ -73,7 +73,7 @@ require 'config/emoij'
|
|||
string
|
||||
|
||||
_nowUtc: ->
|
||||
@_toUtc new Date()
|
||||
@_toUtc Travis.currentDate()
|
||||
|
||||
_toUtc: (date) ->
|
||||
Date.UTC date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds()
|
||||
|
|
|
@ -10,10 +10,10 @@ minispade.require 'app'
|
|||
url = "/#{url}" unless url.match /^\//
|
||||
Travis.__container__.lookup('router:main').handleURL(url)
|
||||
|
||||
_Date = Date
|
||||
@Date = (date) ->
|
||||
new _Date(date || '2012-07-02T00:03:00Z')
|
||||
@Date.UTC = _Date.UTC
|
||||
|
||||
now = -> new Date('2012-07-02T00:03:00Z')
|
||||
$.timeago.settings.nowFunction = -> now().getTime()
|
||||
Travis.currentDate = now
|
||||
|
||||
# hacks for missing features in webkit
|
||||
unless Function::bind
|
||||
|
|
|
@ -77,6 +77,9 @@ window.Travis = Em.Application.extend(Ember.Evented,
|
|||
location.href = location.href.replace('#!/', '') if location.hash.slice(0, 2) == '#!'
|
||||
I18n.fallbacks = true
|
||||
@setLocale 'locale', @get('defaultLocale')
|
||||
|
||||
currentDate: ->
|
||||
new Date()
|
||||
).create()
|
||||
|
||||
Travis.deferReadiness()
|
||||
|
|
5
assets/scripts/vendor/jquery.timeago.js
vendored
5
assets/scripts/vendor/jquery.timeago.js
vendored
|
@ -41,7 +41,8 @@
|
|||
months: '%d months',
|
||||
year: 'about a year',
|
||||
years: '%d years',
|
||||
numbers: []
|
||||
numbers: [],
|
||||
nowFunction: function() { return new Date().getTime(); }
|
||||
}
|
||||
},
|
||||
distanceInWords: function(date) {
|
||||
|
@ -95,7 +96,7 @@
|
|||
return (this.now() - date.getTime());
|
||||
},
|
||||
now: function() {
|
||||
return new Date().getTime();
|
||||
return this.settings.nowFunction.call(this);
|
||||
},
|
||||
parse: function(iso8601) {
|
||||
var s = $.trim(iso8601);
|
||||
|
|
Loading…
Reference in New Issue
Block a user