Created
February 27, 2019 18:43
-
-
Save saleebm/0f0eabfb88b2ddad2917f2de1ee37192 to your computer and use it in GitHub Desktop.
react-datetime custom appearance demo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var renderers = { | |
renderDay: function( props, currentDate, selectedDate ){ | |
return <td {...props}>{ '0' + currentDate.date() }</td>; | |
}, | |
renderMonth: function( props, month, year, selectedDate){ | |
return <td {...props}>{ month }</td>; | |
}, | |
renderYear: function( props, year, selectedDate ){ | |
return <td {...props}>{ year % 100 }</td>; | |
} | |
} | |
React.render( | |
<div> | |
<Datetime input={false} | |
renderDay={ renderers.renderDay } | |
renderMonth={ renderers.renderMonth } | |
renderYear={ renderers.renderYear } /> | |
</div>, | |
document.body | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="https://codepen.io/chriscoyier/pen/yIgqi.js"></script> | |
<script src="//cdnjs.cloudflare.com/ajax/libs/react/0.13.0/react.js"></script> | |
<script src="https://fb.me/JSXTransformer-0.13.3.js"></script> | |
<script src="https://rawgit.com/arqex/react-datetime/master/dist/react-datetime.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.16.0/moment.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<link href="https://rawgit.com/arqex/react-datetime/master/css/react-datetime.css" rel="stylesheet" /> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment