Gathering detailed insights and metrics for material-ui-datetime-range-picker
Gathering detailed insights and metrics for material-ui-datetime-range-picker
Gathering detailed insights and metrics for material-ui-datetime-range-picker
Gathering detailed insights and metrics for material-ui-datetime-range-picker
A datetime range picker built off of material-ui
npm install material-ui-datetime-range-picker
Typescript
Module System
Node Version
NPM Version
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
17 Stars
40 Commits
11 Forks
2 Watchers
26 Branches
3 Contributors
Updated on May 06, 2025
Latest Version
1.0.0
Package Id
material-ui-datetime-range-picker@1.0.0
Unpacked Size
536.23 kB
Size
150.00 kB
File Count
30
NPM Version
6.9.0
Node Version
12.1.0
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
18
Material-UI Datetime Range Picker is a datetime range picker built off of Material-UI components.
Check out their documentation site for live examples.
Material-UI Datetime Range Picker is available as an npm package.
1npm install material-ui-datetime-range-picker
This is still a work in progress so use it at your own risk. I've added some basic documentation. There are many attributes that need to be abstracted into a param and other work that needs to be done. Please note that this uses Material UI version 0.2 and requires some additional imports. Feel free to contribute!
import { DateRangePicker } from 'material-ui-datetime-range-picker';
<MuiThemeProvider muiTheme={getMuiTheme(theme)}>
<DateRangePicker
autoOk={true}
autoOpenField={true}
onChange={onChange}
onDismiss={onDismiss}
showCalendarStatus={true}
className="my-date-picker"
firstDayOfWeek={0}
dayButtonSize="6.25vw"
calendarDateWidth="80vw"
calendarTimeWidth="40vw"
local='en-US'
mode='portrait'
startLabel='Beginning'
endLabel='Ending'
</MuiThemeProvider>
/>
autoOk:
Description: Boolean - If true, this closes the calendar automatically when a date/time is selected. Default: false
autoOpenField:
Description: Boolean - If true, immediately jumps to the next input field. For example, if you just selected the start date, the start time field would open immediately. Default: false
blockedDateTimeRanges:
Description: Array of Objects with start and end attributes - Allows you to block specific datetime ranges so that datetimes in those ranges are not selectable. Default: [] Example:
1 let blockedDateTimeRanges = [ 2 { 3 start: new Date('2018-11-06 08:00:00'), 4 end: new Date('2018-11-06 20:00:00') 5 }, 6 { 7 start: new Date('2020-11-03 08:00:00'), 8 end: new Date('2020-11-03 20:00:00') 9 } 10 ]
calendarDateWidth:
Description: String - Allows you to adjust the width of the **day** picker. It is a string because it allows you to use different units from px to vw. Default: '310px'
calendarTimeWidth:
Description: String - Allows you to adjust the width of the **time** picker. It is a string because it allows you to use different units from px to vw. Default: '125px'
className:
Description: String - If provided, it will allow the class styling to overwrite some basic styling of the root element. Default: null
container:
Description: String - Determines if the calendar/time picker should appear as a modal or inline when active. Default: 'dialog' Options: 'dialog' or 'inline'
dayButtonSize:
Description: String - Allows you to adjust the size of the **day button**. It is a string because it allows you to use different units from px to vw. Default: '34px'
display(start, end, onFocus): Description: Function - Enables an absolute customization of the date/time fields. Please note that all variables below are required if you do this! Variables: start { dateRef - References the start date node, onClickDate - Function for handling the onClick event for the start date, formattedDate - Formatted start date, timeRef - References the start time node, onClickTime - Function for handling the onClick event for the start time, formattedTime - Formatted start time, } end { dateRef - References the end date node, onClickDate - Function for handling the onClick event for the end date, formattedDate - Formatted end date, timeRef - References the end time node, onClickTime - Function for handling the onClick event for the end time, formattedTime - Formatted end time, } onFocus - Function for handling focus event Example:
1 display={(start, end, onFocus) => { 2 return ( 3 <div className='date-range-picker-text-field'> 4 <div className='container'> 5 <div 6 className='date' 7 ref={start.dateRef} 8 onFocus={onFocus} 9 onClick={start.onClickDate} 10 > 11 <span>{start.formattedDate}</span> 12 {start.formattedDate !== 'Pick up' && 13 <span>,</span> 14 } 15 </div> 16 <div 17 className={classNames('time', {disabled: start.formattedDate === 'Pick up'})} 18 ref={start.timeRef} 19 onFocus={onFocus} 20 onClick={start.onClickTime} 21 > 22 <span>{start.formattedTime}</span> 23 </div> 24 </div> 25 <span className='separator'>-</span> 26 <div className='container'> 27 <div 28 className={classNames('date', {disabled: start.formattedDate === 'Pick up'})} 29 ref={end.dateRef} 30 onFocus={onFocus} 31 onClick={end.onClickDate} 32 > 33 <span>{end.formattedDate}</span> 34 {end.formattedDate !== 'Drop off' && 35 <span>,</span> 36 } 37 </div> 38 <div 39 className={classNames('time', {disabled: end.formattedDate === 'Drop off'})} 40 ref={end.timeRef} 41 onFocus={onFocus} 42 onClick={end.onClickTime} 43 > 44 <span>{end.formattedTime}</span> 45 </div> 46 </div> 47 </div> 48 ); 49 }}
endLabel:
Description: String - The text used to indicate the ending date/time selection fields. Default: 'End'
firstDayOfWeek:
Description: Integer - Used to change the first day of week. It varies from Saturday to Monday between different locales. The allowed range is 0 (Sunday) to 6 (Saturday). The default is `1`, Monday, as per ISO 8601. Default: 1
locale:
Description: String - The locale for calculating the datetime. Default: 'en-US'
mode:
Description: String - Determines the rotation of the calendar. Default: 'portrait' Options: 'portrait' or 'landscape'
onChange(e, selection):
Description: Function - Called when the datetimes have been selected for start and end. Default: null Example: The selection will be an object with start and end attributes that will either be a datetime value or falsey (undefined/null).
1 { 2 start: Wed Jun 13 2018 12:00:00 GMT-0600 (MDT), 3 end: undefined 4 }
Note that if a date is not given it will be either undefined or null (falsey value).
onDismiss(e, selection):
Description: Function - Called when the picker has been closed/dismissed. Default: null Example: The `selection` will be an object with start and end attributes that will either be a datetime value or falsey (undefined/null).
1 { 2 start: null, 3 end: null 4 }
Note that if a date is not given it will be either undefined or null (falsey value).
showCalendarStatus:
Description: Boolean - If true, this will show a header with the current field being selected. Default: false Example: If true, the user would see a header displaying "Start Date", "End Time", etc... or the custom labels provided.
startLabel:
Description: String - The text used to indicate the beginning date/time selection fields. Default: 'Start'
value:
Description: Object - The default value for the date/time range picker Example:
1 { 2 start: Wed Jun 13 2018 12:00:00 GMT-0600 (MDT), 3 end: Wed Jun 14 2018 12:00:00 GMT-0600 (MDT) 4 }
I don't have a lot of time to maintain this repo currently. If you see any bugs, feel free to open an issue and if you have time, code contributions are always welcome.
This project is licensed under the terms of the MIT license
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 1/16 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
116 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More