mirror of
https://github.com/discourse/discourse.git
synced 2025-03-09 14:34:35 +00:00
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 LATER_THIS_WEEK = 'later_this_week';
|
||||||
const THIS_WEEKEND = 'this_weekend';
|
const THIS_WEEKEND = 'this_weekend';
|
||||||
const NEXT_WEEK = 'next_week';
|
const NEXT_WEEK = 'next_week';
|
||||||
|
const NEXT_MONTH = 'next_month';
|
||||||
export const PICK_DATE_AND_TIME = 'pick_date_and_time';
|
export const PICK_DATE_AND_TIME = 'pick_date_and_time';
|
||||||
export const SET_BASED_ON_LAST_POST = 'set_based_on_last_post';
|
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({
|
selections.push({
|
||||||
id: PICK_DATE_AND_TIME,
|
id: PICK_DATE_AND_TIME,
|
||||||
name: I18n.t('topic.auto_update_input.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 (time) {
|
||||||
if (state.id === LATER_TODAY) {
|
if (state.id === LATER_TODAY) {
|
||||||
time = time.format('h a');
|
time = time.format('h a');
|
||||||
|
} else if (state.id === NEXT_MONTH) {
|
||||||
|
time = time.format('MMM D, h a');
|
||||||
} else {
|
} else {
|
||||||
time = time.format('ddd, h a');
|
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);
|
time = time.add(1, 'week').day(1).hour(timeOfDay).minute(0);
|
||||||
icon = 'briefcase';
|
icon = 'briefcase';
|
||||||
break;
|
break;
|
||||||
|
case NEXT_MONTH:
|
||||||
|
time = time.add(1, 'month').startOf('month').hour(timeOfDay).minute(0);
|
||||||
|
icon = 'briefcase';
|
||||||
|
break;
|
||||||
case PICK_DATE_AND_TIME:
|
case PICK_DATE_AND_TIME:
|
||||||
time = null;
|
time = null;
|
||||||
icon = 'calendar-plus-o';
|
icon = 'calendar-plus-o';
|
||||||
|
@ -1511,6 +1511,7 @@ en:
|
|||||||
later_this_week: "Later this week"
|
later_this_week: "Later this week"
|
||||||
this_weekend: "This weekend"
|
this_weekend: "This weekend"
|
||||||
next_week: "Next week"
|
next_week: "Next week"
|
||||||
|
next_month: "Next month"
|
||||||
pick_date_and_time: "Pick date and time"
|
pick_date_and_time: "Pick date and time"
|
||||||
set_based_on_last_post: "Close based on last post"
|
set_based_on_last_post: "Close based on last post"
|
||||||
publish_to_category:
|
publish_to_category:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user