mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 19:46:55 +08:00
DEV: remove the includeMidFuture option on future-date-input (#15818)
This option was always on. Essentially, we set it only in two places and always use `|| true` with it. Note that we're going to switch future-date-input-selector to another source of time shortcuts(https://github.com/discourse/discourse/blob/main/app/assets/javascripts/discourse/app/lib/time-shortcut.js) and also change its API to make it more customizable. Removing the includeMidFuture option is a part of that change.
This commit is contained in:
parent
783912d305
commit
62029ec4eb
|
@ -79,7 +79,6 @@ export default Component.extend({
|
|||
now,
|
||||
day: now.day(),
|
||||
includeWeekend: this.includeWeekend,
|
||||
includeMidFuture: this.includeMidFuture || true,
|
||||
includeFarFuture: this.includeFarFuture,
|
||||
includeDateTime: this.includeDateTime,
|
||||
canScheduleNow: this.includeNow || false,
|
||||
|
|
|
@ -68,7 +68,7 @@ const TIMEFRAMES = [
|
|||
buildTimeframe({
|
||||
id: "two_months",
|
||||
format: "MMM D",
|
||||
enabled: (opts) => opts.includeMidFuture,
|
||||
enabled: () => true,
|
||||
when: (time, timeOfDay) =>
|
||||
time.add(2, "month").startOf("month").hour(timeOfDay).minute(0),
|
||||
icon: "briefcase",
|
||||
|
@ -76,7 +76,7 @@ const TIMEFRAMES = [
|
|||
buildTimeframe({
|
||||
id: "three_months",
|
||||
format: "MMM D",
|
||||
enabled: (opts) => opts.includeMidFuture,
|
||||
enabled: () => true,
|
||||
when: (time, timeOfDay) =>
|
||||
time.add(3, "month").startOf("month").hour(timeOfDay).minute(0),
|
||||
icon: "briefcase",
|
||||
|
@ -84,7 +84,7 @@ const TIMEFRAMES = [
|
|||
buildTimeframe({
|
||||
id: "four_months",
|
||||
format: "MMM D",
|
||||
enabled: (opts) => opts.includeMidFuture,
|
||||
enabled: () => true,
|
||||
when: (time, timeOfDay) =>
|
||||
time.add(4, "month").startOf("month").hour(timeOfDay).minute(0),
|
||||
icon: "briefcase",
|
||||
|
@ -92,7 +92,7 @@ const TIMEFRAMES = [
|
|||
buildTimeframe({
|
||||
id: "six_months",
|
||||
format: "MMM D",
|
||||
enabled: (opts) => opts.includeMidFuture,
|
||||
enabled: () => true,
|
||||
when: (time, timeOfDay) =>
|
||||
time.add(6, "month").startOf("month").hour(timeOfDay).minute(0),
|
||||
icon: "briefcase",
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
includeDateTime=includeDateTime
|
||||
includeWeekend=includeWeekend
|
||||
includeFarFuture=includeFarFuture
|
||||
includeMidFuture=includeMidFuture
|
||||
includeNow=includeNow
|
||||
clearable=clearable
|
||||
onChangeInput=onChangeInput
|
||||
|
|
|
@ -35,7 +35,6 @@
|
|||
</label>
|
||||
{{future-date-input
|
||||
includeDateTime=true
|
||||
includeMidFuture=true
|
||||
clearable=true
|
||||
onChangeInput=(action (mut inviteExpiresAt))
|
||||
}}
|
||||
|
|
|
@ -124,7 +124,6 @@
|
|||
displayLabel=(i18n "user.invited.invite.expires_at")
|
||||
statusType="close"
|
||||
includeDateTime=true
|
||||
includeMidFuture=true
|
||||
clearable=true
|
||||
input=buffered.expires_at
|
||||
onChangeInput=(action (mut buffered.expires_at))
|
||||
|
|
|
@ -15,7 +15,6 @@
|
|||
input=(readonly ignoredUntil)
|
||||
includeWeekend=true
|
||||
includeDateTime=false
|
||||
includeMidFuture=true
|
||||
includeFarFuture=true
|
||||
onChangeInput=(action (mut ignoredUntil))
|
||||
}}
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
input=ignoredUntil
|
||||
includeWeekend=true
|
||||
includeDateTime=false
|
||||
includeMidFuture=true
|
||||
includeFarFuture=true
|
||||
onChangeInput=(action (mut ignoredUntil))
|
||||
}}
|
||||
|
|
|
@ -4,7 +4,6 @@ import buildTimeframes from "discourse/lib/timeframes-builder";
|
|||
|
||||
const DEFAULT_OPTIONS = {
|
||||
includeWeekend: null,
|
||||
includeMidFuture: true,
|
||||
includeFarFuture: null,
|
||||
includeDateTime: null,
|
||||
canScheduleNow: false,
|
||||
|
|
|
@ -29,7 +29,6 @@ export default ComboBoxComponent.extend(DatetimeMixin, {
|
|||
now,
|
||||
day: now.day(),
|
||||
includeWeekend: this.includeWeekend,
|
||||
includeMidFuture: this.includeMidFuture || true,
|
||||
includeFarFuture: this.includeFarFuture,
|
||||
includeDateTime: this.includeDateTime,
|
||||
canScheduleNow: this.includeNow || false,
|
||||
|
|
|
@ -22,7 +22,6 @@
|
|||
{{future-date-input
|
||||
displayLabelIcon="far-clock"
|
||||
includeDateTime=true
|
||||
includeMidFuture=true
|
||||
clearable=true
|
||||
}}
|
||||
{{/styleguide-example}}
|
||||
|
|
Loading…
Reference in New Issue
Block a user