Merge pull request #4483 from ulferts/fix/editing_duration_attributes

fix editing durations
pull/4497/head
Oliver Günther 9 years ago
commit e9a10dc59f
  1. 7
      frontend/app/services/timezone-service.js
  2. 2
      frontend/app/ui_components/duration-directive.js

@ -67,9 +67,12 @@ module.exports = function(ConfigurationService, I18n) {
d.format(TimezoneService.getTimeFormat()); d.format(TimezoneService.getTimeFormat());
}, },
toHours: function(durationString) {
return Number(moment.duration(durationString).asHours().toFixed(2));
},
formattedDuration: function(durationString) { formattedDuration: function(durationString) {
var hours = Number(moment.duration(durationString).asHours().toFixed(2)); return I18n.t('js.units.hour', { count: TimezoneService.toHours(durationString) });
return I18n.t('js.units.hour', { count: hours });
}, },
formattedISODate: function(date) { formattedISODate: function(date) {

@ -39,7 +39,7 @@ module.exports = function($filter, TimezoneService) {
}); });
ngModelController.$formatters.push(function(value) { ngModelController.$formatters.push(function(value) {
return TimezoneService.formattedDuration(value); return TimezoneService.toHours(value);
}); });
} }
}; };

Loading…
Cancel
Save