I am trying to create a function on my page that converts a table column in milliseconds
If the value of the cell is 85324 it will show on the front page 1:25.324
The función in Javascript is as follows
function msToTime(s) {
var ms = s % 1000;
s = (s - ms) / 1000;
var secs = s % 60;
s = (s - secs) / 60;
var mins = s % 60;
var hrs = (s - mins) / 60;
return hrs + ':' + mins + ':' + secs + '.' + ms;
}
How can I integrate this in one of the columns of the table?
Unfortunately, wpDataTables doesn't have a time format that would include seconds and milliseconds, so what you're trying to achieve is not possible with the plugin's built-in features and we do not provide support for custom work I'm afraid.
If the data is stored in the database, you could pull it with a custom MySQL query, but it would be pulled as a string, which means that you wouldn't be able to calculate anything from that column.
Unfortunately this cannot be achieved using the plugin's builtin features.
I'll kindly ask you to add it as a feature suggestion on this page.
Features are pushed up on our "to-do" list when there are a lot of customers requesting those features, so having your vote as a customer can be beneficial to this feature being developed sooner.
It probably can be done with some custom work, but our developers are very busy at the moment, working on some priority tasks and fixing bugs and issues with our plugins, so they won't be having the time for custom work in near future.
But we can recommend these services for customization:
Hello
I am trying to create a function on my page that converts a table column in milliseconds
If the value of the cell is 85324 it will show on the front page 1:25.324
The función in Javascript is as follows
How can I integrate this in one of the columns of the table?
Thanks
Hi Ramiro
Thank you for reaching out to us.
Unfortunately, wpDataTables doesn't have a time format that would include seconds and milliseconds, so what you're trying to achieve is not possible with the plugin's built-in features and we do not provide support for custom work I'm afraid.
If the data is stored in the database, you could pull it with a custom MySQL query, but it would be pulled as a string, which means that you wouldn't be able to calculate anything from that column.
Unfortunately this cannot be achieved using the plugin's builtin features.
I'll kindly ask you to add it as a feature suggestion on this page.
Features are pushed up on our "to-do" list when there are a lot of customers requesting those features, so having your vote as a customer can be beneficial to this feature being developed sooner.
It probably can be done with some custom work, but our developers are very busy at the moment, working on some priority tasks and fixing bugs and issues with our plugins, so they won't be having the time for custom work in near future.
But we can recommend these services for customization:
https://codeable.io/?ref=l1TW1
https://wpkraken.io/?tms-plugins
They do develop such solutions, so can you please send your inquiry to them?