-
Data Grid
- Overview
-
Data Binding
-
Paging and Scrolling
-
Editing
-
Grouping
-
Filtering and Sorting
- Focused Row
-
Row Drag & Drop
-
Selection
-
Columns
- State Persistence
-
Appearance
-
Templates
-
Data Summaries
-
Master-Detail
-
Export to PDF
-
Export to Excel
-
Adaptability
- Keyboard Navigation
-
Pivot Grid
- Overview
-
Data Binding
-
Field Chooser
-
Features
-
Export to Excel
-
Tree List
- Overview
-
Data Binding
- Sorting
- Paging
-
Editing
- Node Drag & Drop
- Focused Row
-
Selection
-
Filtering
-
Column Customization
- State Persistence
- Adaptability
- Keyboard Navigation
-
Scheduler
- Overview
-
Data Binding
-
Views
-
Features
- Virtual Scrolling
-
Grouping
-
Customization
- Adaptability
-
Html Editor
-
Chat
-
Diagram
- Overview
-
Data Binding
-
Featured Shapes
-
Custom Shapes
-
Document Capabilities
-
User Interaction
- UI Customization
- Adaptability
-
Charts
- Overview
-
Data Binding
-
Area Charts
-
Bar Charts
- Bullet Charts
-
Doughnut Charts
-
Financial Charts
-
Line Charts
-
Pie Charts
-
Point Charts
-
Polar and Radar Charts
-
Range Charts
-
Sparkline Charts
-
Tree Map
-
Funnel and Pyramid Charts
- Sankey Chart
-
Combinations
-
More Features
-
Export
-
Selection
-
Tooltips
-
Zooming
-
-
Gantt
- Overview
-
Data
-
UI Customization
- Strip Lines
- Export to PDF
- Sorting
-
Filtering
-
Gauges
- Overview
-
Data Binding
-
Bar Gauge
-
Circular Gauge
-
Linear Gauge
-
Navigation
- Overview
- Accordion
-
Menu
- Multi View
-
Drawer
-
Tab Panel
-
Tabs
-
Toolbar
- Pagination
-
Tree View
- Right-to-Left Support
-
Layout
-
Tile View
- Splitter
-
Gallery
- Scroll View
- Resizable
-
-
Editors
- Overview
- Autocomplete
-
Calendar
- Check Box
- Color Box
- Date Box
-
Date Range Box
-
Drop Down Box
-
Number Box
-
Select Box
- Switch
-
Tag Box
- Text Area
- Text Box
- Validation
- Custom Text Editor Buttons
- Right-to-Left Support
- Editor Appearance Variants
-
Forms and Multi-Purpose
- Overview
- Button Group
- Field Set
-
Filter Builder
-
Form
- Radio Group
-
Range Selector
- Numeric Scale (Lightweight)
- Numeric Scale
- Date-Time Scale (Lightweight)
- Date-Time Scale
- Logarithmic Scale
- Discrete scale
- Custom Formatting
- Use Range Selection for Calculation
- Use Range Selection for Filtering
- Image on Background
- Chart on Background
- Customized Chart on Background
- Chart on Background with Series Template
- Range Slider
- Slider
-
Sortable
-
File Management
-
File Manager
- Overview
-
File System Types
-
Customization
-
File Uploader
-
-
Actions and Lists
-
Maps
- Overview
-
Map
-
Vector Map
-
Dialogs and Notifications
-
Localization
Date Range Box - Overview
The DateRangeBox component allows users to select a date range with ease. The component includes input boxes for start/end dates and a drop-down date picker.
If you have technical questions, please create a support ticket in the DevExpress Support Center.
<div class="dx-fieldset">
<div class="dx-field">
<div class="dx-field-label multiline-label">
<span>Default functionality</span>
<div class="selected-days-wrapper">
<span>Days selected: </span>
<span id="days-selected"></span>
</div>
</div>
<div class="dx-field-value">
@(Html.DevExtreme().DateRangeBox()
.Value(new JS("initialValue"))
.OnValueChanged("showSelectedDays")
)
</div>
</div>
<div class="dx-field">
<div class="dx-field-label">Custom format</div>
<div class="dx-field-value">
@(Html.DevExtreme().DateRangeBox()
.Value(new JS("initialValue"))
.DisplayFormat("EEEE, MMM dd")
)
</div>
</div>
<div class="dx-field">
<div class="dx-field-label">Use buttons to apply selection</div>
<div class="dx-field-value">
@(Html.DevExtreme().DateRangeBox()
.ApplyValueMode(EditorApplyValueMode.UseButtons)
)
</div>
</div>
<div class="dx-field">
<div class="dx-field-label">Single-calendar view</div>
<div class="dx-field-value">
@(Html.DevExtreme().DateRangeBox()
.MultiView(false)
)
</div>
</div>
<div class="dx-field">
<div class="dx-field-label">Calendar only appears on icon click</div>
<div class="dx-field-value">
@(Html.DevExtreme().DateRangeBox()
.OpenOnFieldClick(false)
)
</div>
</div>
<div class="dx-field">
<div class="dx-field-label">Limit available dates (this month)</div>
<div class="dx-field-value">
@(Html.DevExtreme().DateRangeBox()
.Min(new JS("minValue"))
.Max(new JS("maxValue"))
)
</div>
</div>
<div class="dx-field">
<div class="dx-field-label">Disable out of range selection</div>
<div class="dx-field-value">
@(Html.DevExtreme().DateRangeBox()
.DisableOutOfRangeSelection(true)
)
</div>
</div>
<div class="dx-field">
<div class="dx-field-label">Clear button</div>
<div class="dx-field-value">
@(Html.DevExtreme().DateRangeBox()
.ShowClearButton(true)
.Value(new JS("initialValue"))
)
</div>
</div>
</div>
<script>
var msInDay = 1000 * 60 * 60 * 24;
var now = new Date();
var initialValue = [
new Date(now.getTime() - msInDay * 3),
new Date(now.getTime() + msInDay * 3),
];
var lastDay = new Date(now.getFullYear(), now.getMonth() + 1, 0).getDate();
var minValue = new Date(now.setDate(1));
var maxValue = new Date(now.setDate(lastDay));
function showSelectedDays({ value: [startDate, endDate] }) {
let daysCount = 0;
if (startDate && endDate) {
daysCount = (endDate - startDate) / msInDay + 1;
}
$('#days-selected').text(daysCount);
}
$(function() {
showSelectedDays({ value: initialValue });
});
</script>
xxxxxxxxxx
xxxxxxxxxx
This demo illustrates how to apply the following DateRangeBox settings:
-
value An array where you can specify the selected range (start/end dates). The DateRangeBox also allows you to define start/end dates separately. For this purpose, use the startDate and endDate properties instead.
-
displayFormat Date display format. You can use one of our predefined formats or specify a custom format as needs dictate. This demo illustrates the latter.
-
disabled
Specifies whether the DateRangeBox responds to user interaction. -
showClearButton Displays a button that clears DateRangeBox values.
-
multiView Switches between our single-month and two-month dropdown calendar.
-
applyValueMode
Defines whether the selected value is applied instantly or after a user clicks the Apply button.
To get started with the DevExtreme DateRangeBox component, refer to the Getting Started with DateRangeBox tutorial.