Skip to content

Commit 3a855b6

Browse files
committed
feat(DatePicker/hideMinutes): on showtime mode allows user to show only hours
1 parent 147a6a5 commit 3a855b6

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

packages/primevue/scripts/components/datepicker.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ const DatePickerProps = [
2323
default: 'false',
2424
description: 'When enabled, displays the calendar as inline instead of an overlay.'
2525
},
26+
{
27+
name: 'hideMinutes',
28+
type: 'boolean',
29+
default: 'false',
30+
description: 'When enabled, hides the minutes input in the time picker.'
31+
},
2632
{
2733
name: 'showOtherMonths',
2834
type: 'boolean',

packages/primevue/src/datepicker/BaseDatePicker.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ export default {
2222
type: Boolean,
2323
default: false
2424
},
25+
hideMinutes: {
26+
type: Boolean,
27+
default: false
28+
},
2529
showOtherMonths: {
2630
type: Boolean,
2731
default: true

packages/primevue/src/datepicker/DatePicker.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@
377377
<div v-bind="ptm('separatorContainer')" data-pc-group-section="timepickerContainer">
378378
<span v-bind="ptm('separator')" data-pc-group-section="timepickerlabel">{{ timeSeparator }}</span>
379379
</div>
380-
<div :class="cx('minutePicker')" v-bind="ptm('minutePicker')" data-pc-group-section="timepickerContainer">
380+
<div v-if="!hideMinutes" :class="cx('minutePicker')" v-bind="ptm('minutePicker')" data-pc-group-section="timepickerContainer">
381381
<slot name="minuteincrementbutton" :callbacks="minuteIncrementCallbacks">
382382
<Button
383383
:class="cx('pcIncrementButton')"

0 commit comments

Comments
 (0)