Can we use regex on the column?
Can we use regex on the column?
phavanagi
Posts: 13Questions: 5Answers: 0
Hi,
I have a column named EffectiveDate.
The data is something like: "2017-07-07T00:00:00" I want to just display it as 07-07-2017 and not the time. Can we use regex to solve this?
I have columns as:
columns: [
{ "data": "EffectiveDate" },
{ "data": "Id" }
]
Can I use regex in {"data" : "EffectiveDate"."some relevant regex"} or is there any other way?
Thanks!
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
I have a better suggestion. Use moment.js to format the given date to what you want.
with:
I did the rendering in the columnDefs but you could do it in the columns
http://live.datatables.net/buzibuho/1/edit
http://momentjs.com/ is the site. Its a fairly popular library.
@bindrid , Yes, I did something similar using render and it works.. Thanks!