Merge pull request #446 from kubabrecka/dashboard_js_date_fix

fixing admin dashboard english date parsing in other locales
This commit is contained in:
Robin Ward 2013-03-13 06:55:49 -07:00
commit fd6967f703
1 changed files with 3 additions and 3 deletions

View File

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