4242 </template >
4343 </NcActionInput >
4444 </template >
45+ <template v-else-if =" answerType .pickerType === ' time' " #actions >
46+ <NcActionCheckbox v-model =" timeRange" >
47+ {{ t('forms', 'Use time range') }}
48+ </NcActionCheckbox >
49+ <NcActionInput
50+ v-model =" timeMin"
51+ type =" time"
52+ :label =" t('forms', 'Earliest time')"
53+ hide-label
54+ :formatter =" formatter"
55+ is-native-picker
56+ :max =" timeMax" >
57+ <template #icon >
58+ <NcIconSvgWrapper
59+ :svg =" svgClockArrowUpIcon"
60+ :name =" t('forms', 'Earliest time')" />
61+ </template >
62+ </NcActionInput >
63+ <NcActionInput
64+ v-model =" timeMax"
65+ type =" time"
66+ :label =" t('forms', 'Latest time')"
67+ hide-label
68+ :formatter =" formatter"
69+ is-native-picker
70+ :min =" timeMin" >
71+ <template #icon >
72+ <NcIconSvgWrapper
73+ :svg =" svgClockArrowDownIcon"
74+ :name =" t('forms', 'Latest time')" />
75+ </template >
76+ </NcActionInput >
77+ </template >
4578 <div class =" question__content" >
4679 <NcDateTimePicker
4780 :value =" time"
6093</template >
6194
6295<script >
96+ import svgClockArrowDownIcon from ' ../../../img/clock_arrow_down.svg?raw'
97+ import svgClockArrowUpIcon from ' ../../../img/clock_arrow_up.svg?raw'
6398import svgEventIcon from ' ../../../img/event.svg?raw'
6499import svgTodayIcon from ' ../../../img/today.svg?raw'
65100
@@ -92,6 +127,8 @@ export default {
92127 stringify: this .stringifyDate ,
93128 parse: this .parseTimestampToDate ,
94129 },
130+ svgClockArrowDownIcon,
131+ svgClockArrowUpIcon,
95132 svgEventIcon,
96133 svgTodayIcon,
97134 }
@@ -100,11 +137,11 @@ export default {
100137 computed: {
101138 datetimePickerPlaceholder () {
102139 if (this .readOnly ) {
103- return this .extraSettings ? .dateRange
140+ return this .extraSettings ? .dateRange || this . extraSettings ? . timeRange
104141 ? this .answerType .submitPlaceholderRange
105142 : this .answerType .submitPlaceholder
106143 }
107- return this .extraSettings ? .dateRange
144+ return this .extraSettings ? .dateRange || this . extraSettings ? . timeRange
108145 ? this .answerType .createPlaceholderRange
109146 : this .answerType .createPlaceholder
110147 },
@@ -122,7 +159,7 @@ export default {
122159 },
123160
124161 time () {
125- if (this .extraSettings ? .dateRange ) {
162+ if (this .extraSettings ? .dateRange || this . extraSettings ? . timeRange ) {
126163 return this .values
127164 ? [this .parse (this .values [0 ]), this .parse (this .values [1 ])]
128165 : null
@@ -170,6 +207,47 @@ export default {
170207 this .onExtraSettingsChange ({ dateRange: value === true ?? null })
171208 },
172209 },
210+
211+ /**
212+ * The maximum allowable time for the time input field
213+ */
214+ timeMax: {
215+ get () {
216+ return this .extraSettings ? .timeMax
217+ ? this .parse (this .extraSettings .timeMax )
218+ : null
219+ },
220+ set (value ) {
221+ this .onExtraSettingsChange ({
222+ timeMax: this .stringify (value),
223+ })
224+ },
225+ },
226+
227+ /**
228+ * The minimum allowable time for the time input field
229+ */
230+ timeMin: {
231+ get () {
232+ return this .extraSettings ? .timeMin
233+ ? this .parse (this .extraSettings .timeMax )
234+ : null
235+ },
236+ set (value ) {
237+ this .onExtraSettingsChange ({
238+ timeMin: this .stringify (value),
239+ })
240+ },
241+ },
242+
243+ timeRange: {
244+ get () {
245+ return this .extraSettings ? .timeRange ?? false
246+ },
247+ set (value ) {
248+ this .onExtraSettingsChange ({ timeRange: value === true ?? null })
249+ },
250+ },
173251 },
174252
175253 methods: {
0 commit comments