Datatables.net date display format -


i'm using datatables.net jquery plugin , populating data through asp.net mvc4.

one of columns date format. i'm interested in changing format of how displayed not changing type of column date string.

i'm using default initialization:

$('#data-table').datatable(); 

my 4th column date "created date" , displayed "7/07/2013 9:38:11 p.m." displayed either "7/07/2013" or "7 jul 2013".

i thought relatively easy task haven't been able find answer i'm after.

i'd avoid additional plugins if possible. there simple way i'm missing?

here came with. using how renders can manipulate way date displayed anyway want.

$('#data-table').datatable({     "aocolumndefs": [         {              "atargets": [0],              "bsearchable": false,              "stype": 'date',             "fnrender": function ( oobj ) {                 var javascriptdate = new date(oobj.adata[0]);                 javascriptdate = javascriptdate.getdate()+"/"+(javascriptdate.getmonth()+1)+"/"+javascriptdate.getfullyear();                 return "<div class='date'>"+javascriptdate+"<div>";             }         }     ] });  

i hope useful others...


Comments

Popular posts from this blog

Load Balancing in Bluemix using custom domain and DNS SRV records -

oracle - pls-00402 alias required in select list of cursor to avoid duplicate column names -

python - Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>] error -