mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 22:26:26 +08:00
Merge pull request #446 from kubabrecka/dashboard_js_date_fix
fixing admin dashboard english date parsing in other locales
This commit is contained in:
commit
fd6967f703
|
@ -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());
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user