Tutorial: Time


Edit this page

To use the Time cell type, set the type: 'time' option in the columns array or the cells function.
The Time cell uses Moment.js as the time formatter, so be sure to add an additional file in your <head> :

  • /dist/moment/moment.js

All data entered to the time-typed cells are eventually validated against the default time format (h:mm:ss a, which translates to, for example, 9:30:00 am) unless another format is provided as the timeFormat.
If you enable the correctFormat config item, the values will be automatically formatted to match the desired time format.

By default, the values entered to the time-typed column are not validated, so if you want them to display in the proper format, remember to call hot.validateCells() after the table initialization.