mirror of
https://github.com/discourse/discourse.git
synced 2024-11-26 19:00:32 -06:00
FIX: broken localization for auto close
This commit is contained in:
parent
a6ad762189
commit
2ffe62846b
@ -69,7 +69,9 @@ export default Ember.Controller.extend(ModalFunctionality, {
|
||||
|
||||
willCloseI18n: function() {
|
||||
if (this.get('model.details.auto_close_based_on_last_post')) {
|
||||
return I18n.t('topic.auto_close_immediate', {count: this.get('model.auto_close_time')});
|
||||
let closeDate = new Date(this.get('model.last_posted_at'));
|
||||
let diff = Math.round((new Date() - closeDate)/(1000*60*60));
|
||||
return I18n.t('topic.auto_close_immediate', {count: diff});
|
||||
}
|
||||
}.property('model.details.auto_close_based_on_last_post', 'model.auto_close_time')
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user