Last active
July 20, 2018 03:05
-
-
Save WeiB71/6889d3b0ccd0cde4ed191384b1af0142 to your computer and use it in GitHub Desktop.
handsontable to Format to MM/DD/YYYY
This file contains hidden or 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
| // sample render to used in handsontable | |
| //need moment.js | |
| function dateRenderer(instance, td, row, col, prop, value, cellProperties) { | |
| Handsontable.renderers.TextRenderer.apply(this, arguments); | |
| if (value != null) { | |
| if (value!=null) { | |
| var str = moment(value).format("MM/DD/YYYY h:hh A"); | |
| td.innerHTML = str; | |
| } | |
| } | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment