From 8003c63fa6a1b1e2abc417613e2eaffb9d40132c Mon Sep 17 00:00:00 2001 From: Kuba Brecka Date: Wed, 13 Mar 2013 13:04:10 +0100 Subject: [PATCH] fixing admin dashboard english date parsing in other locales --- .../javascripts/admin/routes/admin_dashboard_route.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/admin/routes/admin_dashboard_route.js b/app/assets/javascripts/admin/routes/admin_dashboard_route.js index 56a6d8bb8cb..18ac53f0f52 100644 --- a/app/assets/javascripts/admin/routes/admin_dashboard_route.js +++ b/app/assets/javascripts/admin/routes/admin_dashboard_route.js @@ -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()); }