Skip to content

Commit

Permalink
Merge pull request #3826 from mzazrivec/display_local_time_in_retirem…
Browse files Browse the repository at this point in the history
…ent_form

Display browser local time in retirement form
(cherry picked from commit b71ae58)

https://bugzilla.redhat.com/show_bug.cgi?id=1625376
  • Loading branch information
Martin Povolny authored and simaishi committed Sep 13, 2018
1 parent 897f6d6 commit 669724e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Expand Up @@ -31,7 +31,7 @@ ManageIQ.angular.app.controller('retirementFormController', ['$http', 'objectIds
var data = response.data;

if (data.retirement_date != null) {
vm.retirementInfo.retirementDate = moment.utc(data.retirement_date).toDate();
vm.retirementInfo.retirementDate = new Date(data.retirement_date);
}
vm.retirementInfo.retirementWarning = data.retirement_warning || '';
vm.modelCopy = _.extend({}, vm.retirementInfo);
Expand Down
4 changes: 2 additions & 2 deletions app/assets/javascripts/directives/datetimepicker.js
Expand Up @@ -49,14 +49,14 @@ ManageIQ.angular.app.directive('datetimepicker', function() {
// formatter
ctrl.$formatters.push(function(value) {
if (value) {
return moment(value).utc().format(attr.datetimeFormat);
return moment(value).format(attr.datetimeFormat);
}
});

// parser
ctrl.$parsers.push(function(value) {
if (value) {
return moment.utc(value, attr.datetimeFormat).toDate();
return moment(value, attr.datetimeFormat).toDate();
}

return null;
Expand Down

0 comments on commit 669724e

Please sign in to comment.