import * as React from 'react'; import JqxButton from 'jqwidgets-scripts/jqwidgets-react-tsx/jqxbuttons'; import JqxRangeSelector, { IRangeSelectorProps } from 'jqwidgets-scripts/jqwidgets-react-tsx/jqxrangeselector'; class App extends React.PureComponent<{}, IRangeSelectorProps> { private rangeSelector = React.createRef(); private result = React.createRef(); constructor(props: {}) { super(props); this.onClickSubmit = this.onClickSubmit.bind(this); this.state = { max: new Date(2014, 9, 1), min: new Date(2014, 5, 1), range: { from: new Date(2014, 5, 1), to: new Date(2014, 6, 29), min: { days: 7 } } } } public render() { return (

Submit vacation
); } private onClickSubmit(): void { const months = [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ]; const range = this.rangeSelector.current!.getRange(); const from = new Date(range.from!.toString()); const to = new Date(range.to!.toString()); const fromDate = from.getDate(); const fromMonth = from.getMonth(); const toDate = to.getDate(); const toMonth = to.getMonth(); this.result.current!.innerHTML = "Vacation period selected: from " + months[fromMonth] + " " + fromDate + " to " + months[toMonth] + " " + toDate; } } export default App;