mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 01:47:22 +08: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
|
||||
includeFarFuture=includeFarFuture
|
||||
includeMidFuture=includeMidFuture
|
||||
includeNow=includeNow
|
||||
clearable=clearable
|
||||
none="topic.auto_update_input.none"
|
||||
onChangeInput=onChangeInput
|
||||
|
|
|
@ -18,6 +18,13 @@ function buildTimeframe(opts) {
|
|||
}
|
||||
|
||||
export const TIMEFRAMES = [
|
||||
buildTimeframe({
|
||||
id: "now",
|
||||
format: "h:mm a",
|
||||
enabled: opts => opts.canScheduleNow,
|
||||
when: time => time.add(1, "minute"),
|
||||
icon: "magic"
|
||||
}),
|
||||
buildTimeframe({
|
||||
id: "later_today",
|
||||
format: "h a",
|
||||
|
@ -214,6 +221,7 @@ export default ComboBoxComponent.extend(DatetimeMixin, {
|
|||
includeFarFuture: this.includeFarFuture,
|
||||
includeDateTime: this.includeDateTime,
|
||||
includeBasedOnLastPost: this.statusType === CLOSE_STATUS_TYPE,
|
||||
canScheduleNow: this.includeNow || false,
|
||||
canScheduleToday: 24 - now.hour() > 6
|
||||
};
|
||||
|
||||
|
|
|
@ -2225,6 +2225,7 @@ en:
|
|||
time_frame_required: Please select a time frame
|
||||
auto_update_input:
|
||||
none: "Select a timeframe"
|
||||
now: "Now"
|
||||
later_today: "Later today"
|
||||
tomorrow: "Tomorrow"
|
||||
later_this_week: "Later this week"
|
||||
|
|
Loading…
Reference in New Issue
Block a user