DevExtreme v26.1 is now available.

Explore our newest features/capabilities and share your thoughts with us.

Your search did not match any results.

Vue Range Selector - Date-Time Scale (Lightweight)

This demo illustrates a date-time scale. Here, minimum and maximum ranges are set, so that a user cannot select a vacation period less than a week and more than a month. To select a particular month, click between the corresponding scale markers.

Backend API
<template> <DxRangeSelector id="range-selector" v-model:value="range" title="Select a Vacation Period" > <DxMargin :top="50"/> <DxScale :start-value="startValue" :end-value="endValue" > <DxMinorTick :visible="false"/> <DxMinorTickInterval :days="1"/> <DxTickInterval :weeks="1"/> <DxMinRange :weeks="1"/> <DxMaxRange :months="1"/> </DxScale> <DxSliderMarker format="monthAndDay"/> </DxRangeSelector> </template> <script setup lang="ts"> import { ref } from 'vue'; import { DxRangeSelector, DxMargin, DxScale, DxMinorTick, DxMinorTickInterval, DxTickInterval, DxMinRange, DxMaxRange, DxSliderMarker, } from 'devextreme-vue/range-selector'; const startValue = new Date(2011, 1, 1); const endValue = new Date(2011, 6, 1); const range = ref([new Date(2011, 1, 5), new Date(2011, 2, 5)]); </script> <style> #range-selector { height: 250px; } </style>
import { createApp } from 'vue'; import App from './App.vue'; createApp(App).mount('#app');
<!DOCTYPE html> <html lang="en"> <head> <title>DevExtreme Demo</title> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5.0" /> <link rel="stylesheet" type="text/css" href="https://cdn3.devexpress.com/jslib/26.1.5/css/dx.light.css" /> <link rel="stylesheet" type="text/css" href="./bundle.css" /> </head> <body class="dx-viewport"> <div class="demo-container"> <div id="app"> </div> </div> <script src="bundles/vendor/vue.vendor.js"></script> <script src="./bundle.js"></script> </body> </html>