Skip to content

Commit

Permalink
Handle datetime formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
mikmart committed Jan 25, 2024
1 parent d56aa1a commit 02753af
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion inst/htmlwidgets/datatables.js
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,7 @@ HTMLWidgets.widget({
if (colDef && typeof colDef.render === 'function') {
var restore = function(v) {
v = scaleBack(v, scale);
return type !== 'date' ? v : new Date(+v);
return inArray(type, ['date', 'time']) ? new Date(+v) : v;
}
$span1.text(colDef.render(restore(v1), 'display'));
$span2.text(colDef.render(restore(v2), 'display'));
Expand Down

0 comments on commit 02753af

Please sign in to comment.