Skip to content

Commit

Permalink
chore: default property for KDateTimeRange.vue set to null
Browse files Browse the repository at this point in the history
  • Loading branch information
fcrovetti committed Jan 29, 2025
1 parent ed30a59 commit 2e0db06
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions core/client/components/time/KDateTimeRange.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
>
<q-range
v-model="rangeModel"
v-bind="props.slider.range"
v-bind="props.slider"
@update:model-value="setDateTimeRangeFromSliderPosition()"
@change="emitRangeChange()"
style="min-width: 200px; padding-top: 4px;"
Expand Down Expand Up @@ -102,9 +102,7 @@ const props = defineProps({
},
slider: {
type: Object,
default: () => {
return {show:false}
}
default: () => null
}
})
Expand Down Expand Up @@ -148,7 +146,7 @@ const separator = computed(() => {
return _.get(props.options, 'separator', '/')
})
const displaySlider = computed(() => {
return !!(props.slider.show && props.min && props.max)
return !!(props.slider)
})
const rangeMin = computed(() => {
return props.dateOnly ? getDateWithoutTime(props.min, 'start').toISOString() : moment(props.min).utc().toISOString()
Expand Down Expand Up @@ -218,11 +216,11 @@ if (props.modelValue) {
startDateTime.value = moment(props.modelValue.start).utc()
endDateTime.value = moment(props.modelValue.end).utc()
if (displaySlider.value) {
if(props.slider.range && props.slider.range.min) {
rangeModel.value.min = props.slider.range.min
if(props.slider.min) {
rangeModel.value.min = props.slider.min
}
if(props.slider.range && props.slider.range.max) {
rangeModel.value.max = props.slider.range.max
if(props.slider.max) {
rangeModel.value.max = props.slider.max
}
if (props.dateOnly) {
startDateTime.value = getDateWithoutTime(props.modelValue.start, 'start')
Expand Down

0 comments on commit 2e0db06

Please sign in to comment.