Add "Next month" to topic timer selection options.
This commit is contained in:
parent
8ab9f30bbd
commit
e93535e239
|
@ -7,6 +7,7 @@ const TOMORROW = 'tomorrow';
|
|||
const LATER_THIS_WEEK = 'later_this_week';
|
||||
const THIS_WEEKEND = 'this_weekend';
|
||||
const NEXT_WEEK = 'next_week';
|
||||
const NEXT_MONTH = 'next_month';
|
||||
export const PICK_DATE_AND_TIME = 'pick_date_and_time';
|
||||
export const SET_BASED_ON_LAST_POST = 'set_based_on_last_post';
|
||||
|
||||
|
@ -57,6 +58,13 @@ export default Combobox.extend({
|
|||
});
|
||||
}
|
||||
|
||||
if (moment().endOf('month').date() !== now.date()) {
|
||||
selections.push({
|
||||
id: NEXT_MONTH,
|
||||
name: I18n.t('topic.auto_update_input.next_month')
|
||||
});
|
||||
}
|
||||
|
||||
selections.push({
|
||||
id: PICK_DATE_AND_TIME,
|
||||
name: I18n.t('topic.auto_update_input.pick_date_and_time')
|
||||
|
@ -111,6 +119,8 @@ export default Combobox.extend({
|
|||
if (time) {
|
||||
if (state.id === LATER_TODAY) {
|
||||
time = time.format('h a');
|
||||
} else if (state.id === NEXT_MONTH) {
|
||||
time = time.format('MMM D, h a');
|
||||
} else {
|
||||
time = time.format('ddd, h a');
|
||||
}
|
||||
|
@ -157,6 +167,10 @@ export default Combobox.extend({
|
|||
time = time.add(1, 'week').day(1).hour(timeOfDay).minute(0);
|
||||
icon = 'briefcase';
|
||||
break;
|
||||
case NEXT_MONTH:
|
||||
time = time.add(1, 'month').startOf('month').hour(timeOfDay).minute(0);
|
||||
icon = 'briefcase';
|
||||
break;
|
||||
case PICK_DATE_AND_TIME:
|
||||
time = null;
|
||||
icon = 'calendar-plus-o';
|
||||
|
|
|
@ -1511,6 +1511,7 @@ en:
|
|||
later_this_week: "Later this week"
|
||||
this_weekend: "This weekend"
|
||||
next_week: "Next week"
|
||||
next_month: "Next month"
|
||||
pick_date_and_time: "Pick date and time"
|
||||
set_based_on_last_post: "Close based on last post"
|
||||
publish_to_category:
|
||||
|
|
Loading…
Reference in New Issue