-
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
-
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
- Overview
-
Action Sheet
-
Button
- Floating Action Button
- Drop Down Button
-
Context Menu
-
List
-
Lookup
-
Maps
- Overview
-
Map
-
Vector Map
-
Dialogs and Notifications
-
Localization
JavaScript/jQuery Date Range Box - Overview
The JavaScript 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.
$(() => {
const msInDay = 1000 * 60 * 60 * 24;
const now = new Date();
const initialValue = [
new Date(now.getTime() - msInDay * 3),
new Date(now.getTime() + msInDay * 3),
];
$('#range-selection').dxDateRangeBox({
value: initialValue,
onValueChanged: showSelectedDays,
});
$('#custom-format').dxDateRangeBox({
value: initialValue,
displayFormat: 'EEEE, MMM dd',
});
$('#apply-value').dxDateRangeBox({
applyValueMode: 'useButtons',
});
$('#single-view').dxDateRangeBox({
multiView: false,
});
$('#icon-click-only').dxDateRangeBox({
openOnFieldClick: false,
});
$('#current-month-only').dxDateRangeBox({
...getCurrentMonthRange(),
});
$('#clear').dxDateRangeBox({
showClearButton: true,
value: initialValue,
});
$('#disable-out-of-range-selection').dxDateRangeBox({
disableOutOfRangeSelection: true,
});
function getCurrentMonthRange() {
const lastDay = new Date(now.getFullYear(), now.getMonth() + 1, 0).getDate();
const min = new Date(now.setDate(1));
const max = new Date(now.setDate(lastDay));
return { min, max };
}
function showSelectedDays({ value: [startDate, endDate] }) {
let daysCount = 0;
if (startDate && endDate) {
daysCount = (endDate - startDate) / msInDay + 1;
}
$('#days-selected').text(daysCount);
}
showSelectedDays({ value: initialValue });
});
xxxxxxxxxx
xxxxxxxxxx
This demo illustrates how to apply the following JavaScript DateRangeBox settings:
-
value An array where you can specify the selected range (start/end dates). The JavaScript 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 JavaScript DateRangeBox responds to user interaction. -
showClearButton Displays a button that clears JavaScript 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 JavaScript DateRangeBox component, refer to the Getting Started with JavaScript DateRangeBox tutorial.