fixing admin dashboard english date parsing in other locales

This commit is contained in:
Kuba Brecka 2013-03-13 13:04:10 +01:00
parent a663251bd4
commit 8003c63fa6
1 changed files with 3 additions and 3 deletions

View File

@ -18,7 +18,7 @@ Discourse.AdminDashboardRoute = Discourse.Route.extend({
},
checkVersion: function(c) {
if( Discourse.SiteSettings.version_checks && (!c.get('versionCheckedAt') || Date.create('12 hours ago') > c.get('versionCheckedAt')) ) {
if( Discourse.SiteSettings.version_checks && (!c.get('versionCheckedAt') || Date.create('12 hours ago', 'en') > c.get('versionCheckedAt')) ) {
c.set('versionCheckedAt', new Date());
Discourse.VersionCheck.find().then(function(vc) {
c.set('versionCheck', vc);
@ -28,7 +28,7 @@ Discourse.AdminDashboardRoute = Discourse.Route.extend({
},
fetchReports: function(c) {
if( !c.get('reportsCheckedAt') || Date.create('1 hour ago') > c.get('reportsCheckedAt') ) {
if( !c.get('reportsCheckedAt') || Date.create('1 hour ago', 'en') > c.get('reportsCheckedAt') ) {
// TODO: use one request to get all reports, or maybe one request for all dashboard data including version check.
c.set('reportsCheckedAt', new Date());
['visits', 'signups', 'topics', 'posts', 'total_users', 'flags'].each(function(reportType){
@ -38,7 +38,7 @@ Discourse.AdminDashboardRoute = Discourse.Route.extend({
},
fetchGithubCommits: function(c) {
if( !c.get('commitsCheckedAt') || Date.create('1 hour ago') > c.get('commitsCheckedAt') ) {
if( !c.get('commitsCheckedAt') || Date.create('1 hour ago', 'en') > c.get('commitsCheckedAt') ) {
c.set('commitsCheckedAt', new Date());
c.set('githubCommits', Discourse.GithubCommit.findAll());
}