Merge pull request #4566 from Verabird/fixDateFormat

Fix date format for charts (#4558)
This commit is contained in:
Blade Barringer
2015-02-04 21:59:00 -06:00
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -111,7 +111,7 @@ habitrpg.controller("GroupsCtrl", ['$scope', '$rootScope', 'Shared', 'Groups', '
.controller("MemberModalCtrl", ['$scope', '$rootScope', 'Members', 'Shared', '$http', 'Notification', 'Groups',
function($scope, $rootScope, Members, Shared, $http, Notification, Groups) {
$scope.timestamp = function(timestamp){
return moment(timestamp).format('MM/DD/YYYY');
return moment(timestamp).format($rootScope.User.user.preferences.dateFormat.toUpperCase());
}
// We watch Members.selectedMember because it's asynchronously set, so would be a hassle to handle updates here
$scope.$watch( function() { return Members.selectedMember; }, function (member) {
+1 -1
View File
@@ -166,7 +166,7 @@ habitrpg.controller("RootCtrl", ['$scope', '$rootScope', '$location', 'User', '$
}
matrix = [[env.t('date'), env.t('score')]];
_.each(history, function(obj) {
matrix.push([moment(obj.date).format('MM/DD/YY'), obj.value]);
matrix.push([moment(obj.date).format(User.user.preferences.dateFormat.toUpperCase().replace('YYYY','YY') ), obj.value]);
});
data = google.visualization.arrayToDataTable(matrix);
options = {