mirror of
https://github.com/discourse/discourse.git
synced 2025-02-07 20:08:26 +00:00
FEATURE: Add "Now" as an option (default hidden) to the future date input selector (#10047)
Sometimes you need to schedule things from now onward. "Now" in this case is now + 1 minute. this option is hidden by default.
This commit is contained in:
parent
0ff86b00cb
commit
35a157619a
@ -11,6 +11,7 @@
|
|||||||
includeWeekend=includeWeekend
|
includeWeekend=includeWeekend
|
||||||
includeFarFuture=includeFarFuture
|
includeFarFuture=includeFarFuture
|
||||||
includeMidFuture=includeMidFuture
|
includeMidFuture=includeMidFuture
|
||||||
|
includeNow=includeNow
|
||||||
clearable=clearable
|
clearable=clearable
|
||||||
none="topic.auto_update_input.none"
|
none="topic.auto_update_input.none"
|
||||||
onChangeInput=onChangeInput
|
onChangeInput=onChangeInput
|
||||||
|
@ -18,6 +18,13 @@ function buildTimeframe(opts) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const TIMEFRAMES = [
|
export const TIMEFRAMES = [
|
||||||
|
buildTimeframe({
|
||||||
|
id: "now",
|
||||||
|
format: "h:mm a",
|
||||||
|
enabled: opts => opts.canScheduleNow,
|
||||||
|
when: time => time.add(1, "minute"),
|
||||||
|
icon: "magic"
|
||||||
|
}),
|
||||||
buildTimeframe({
|
buildTimeframe({
|
||||||
id: "later_today",
|
id: "later_today",
|
||||||
format: "h a",
|
format: "h a",
|
||||||
@ -214,6 +221,7 @@ export default ComboBoxComponent.extend(DatetimeMixin, {
|
|||||||
includeFarFuture: this.includeFarFuture,
|
includeFarFuture: this.includeFarFuture,
|
||||||
includeDateTime: this.includeDateTime,
|
includeDateTime: this.includeDateTime,
|
||||||
includeBasedOnLastPost: this.statusType === CLOSE_STATUS_TYPE,
|
includeBasedOnLastPost: this.statusType === CLOSE_STATUS_TYPE,
|
||||||
|
canScheduleNow: this.includeNow || false,
|
||||||
canScheduleToday: 24 - now.hour() > 6
|
canScheduleToday: 24 - now.hour() > 6
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -2225,6 +2225,7 @@ en:
|
|||||||
time_frame_required: Please select a time frame
|
time_frame_required: Please select a time frame
|
||||||
auto_update_input:
|
auto_update_input:
|
||||||
none: "Select a timeframe"
|
none: "Select a timeframe"
|
||||||
|
now: "Now"
|
||||||
later_today: "Later today"
|
later_today: "Later today"
|
||||||
tomorrow: "Tomorrow"
|
tomorrow: "Tomorrow"
|
||||||
later_this_week: "Later this week"
|
later_this_week: "Later this week"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user