FEATURE: add quarterly period to Top page

This commit is contained in:
Neil Lalonde
2015-07-28 12:31:31 -04:00
parent dc8a68fd29
commit 7518918b8f
6 changed files with 78 additions and 36 deletions

View File

@@ -106,6 +106,7 @@ const controllerOpts = {
new: Discourse.computed.endWith('model.filter', 'new'),
top: Em.computed.notEmpty('period'),
yearly: Em.computed.equal('period', 'yearly'),
quarterly: Em.computed.equal('period', 'quarterly'),
monthly: Em.computed.equal('period', 'monthly'),
weekly: Em.computed.equal('period', 'weekly'),
daily: Em.computed.equal('period', 'daily'),

View File

@@ -1,6 +1,7 @@
const TITLE_SUBS = {
all: 'all_time',
yearly: 'this_year',
quarterly: 'this_quarter',
monthly: 'this_month',
daily: 'today',
};
@@ -13,6 +14,9 @@ export default Ember.Handlebars.makeBoundHelper(function (period, options) {
case 'yearly':
dateString = moment().subtract(1, 'year').format(I18n.t('dates.long_with_year_no_time')) + " - " + moment().format(I18n.t('dates.long_with_year_no_time'));
break;
case 'quarterly':
dateString = moment().subtract(3, 'month').format(I18n.t('dates.long_no_year_no_time')) + " - " + moment().format(I18n.t('dates.long_no_year_no_time'));
break;
case 'weekly':
dateString = moment().subtract(1, 'week').format(I18n.t('dates.long_no_year_no_time')) + " - " + moment().format(I18n.t('dates.long_no_year_no_time'));
break;