<template>
	<view class="w-form-timePicker" hover-class="w-click-hover" v-if="!readonly">
		<uni-datetime-picker class="w-form-input" :border="false" type="datetimerange" :clear-icon="false" v-model="_value"/>
		<uni-icons type="right" :size="20" color="#999999"></uni-icons>
	</view>
	<text class="w-form-input-rv" v-else>{{_value[0]}} ~ {{_value[1]}}</text>
</template>

<script setup>
	import {computed} from 'vue'
	
	const props = defineProps({
		formProps: {
			type: Object,
			default: () => {
				return {}
			}
		},
		modelValue: {
			type: Array,
			default: () => {
				return []
			}
		},
		readonly: Boolean
	})
	
	const _value = computed({
		get() {
			return props.modelValue
		},
		set(val) {
			emits('update:modelValue', val)
		}
	})
	
	const emits = defineEmits(['update:modelValue'])
	
</script>
<style lang="less" scoped>
	.w-form-timePicker {
		display: flex;
		align-items: center;
	}
</style>