import * as React from 'react'; import JqxButton from 'jqwidgets-scripts/jqwidgets-react-tsx/jqxbuttons'; import JqxNotification from 'jqwidgets-scripts/jqwidgets-react-tsx/jqxnotification'; class App extends React.PureComponent<{}> { private msgNotification = React.createRef(); private timeNotification = React.createRef(); constructor(props: {}) { super(props); this.onClickOpenMessageNotification = this.onClickOpenMessageNotification.bind(this); this.onClickOpenTimeNotification = this.onClickOpenTimeNotification.bind(this); } public render() { return (
Welcome to our website.
Current time: .
Open a message notification

Open a current time notification
); } private onClickOpenMessageNotification(): void { this.msgNotification.current!.open(); } private onClickOpenTimeNotification(): void { const date = new Date(); const minutes = date.getMinutes(); let minutesString: string = ''; if (minutes < 10) { minutesString = "0" + minutes; } else { minutesString = "" + minutes; } const seconds = date.getSeconds(); let secondsString: string = ''; if (seconds < 10) { secondsString = "0" + seconds; } else { secondsString = "" + seconds; } const timeSpan = document.getElementById('currentTime'); timeSpan!.innerText = date.getHours() + ":" + minutesString + ":" + secondsString; this.timeNotification.current!.open(); } } export default App;