The timepicker of Searchbuilder Moment condition displays something strange instead of human readable time. How to fix it?
This question has accepted answers - jump to:
This example seems to work correctly. Can you post a link to your page or a test case replicating the issue so we can help debug?
Thanks for answering. The value in the input box doesn't seems correct. I was expecting "00:40", but it appears "40o403nt"
Understood. We will need to see the problem in order to help debug.
Here is the testcase, see the "start date" column. Thank you
As shown in the example I linked to you need to use $.fn.dataTable.moment( 'HH:mm' ); to define the datetime format being used. Also you need to include datetime-moment.js. I updated your test case to show this:
$.fn.dataTable.moment( 'HH:mm' );
I also removed the type: "moment. It is not recommended to use columns.type as Datatables performs data type detection. Without this and with $.fn.dataTable.moment( 'HH:mm' ); Datatables will correctly detect the data type as moment. The test case has a mix of different date formats in the same column causing type detection to return a string. I removed all the rows except the one you changed.
The other thing you will need to do is use Orthogonal data to display the N/A for empty dates. Otherwise the N/A will be used for type detection, etc and the data type for the column will be string. Updated example:
Wow, it works. Thank you!
It looks like you're new here. If you want to get involved, click one of these buttons!
DataTables designed and created by SpryMedia Ltd.
SpryMedia Ltd is registered in Scotland, company no. SC456502.