angularjs - Date formatting not working with cellFilter -
in response receive date '2016-09-07 20:00:23.234 ist' , trying format date '07/sep/2016 20:00:23.234' of ui-grid cellfilter.
like
{ "name": "creationtimestamp", "type": "date", "cellfilter": "date:'mm/dd/yyyy hh:mm:ss.sss'" }
but it's not working it. still getting result like'2016-09-07 20:00:23.234 ist'. can please me?
we can use custom filter, if want handle timezone { "name": "creationtimestamp", "type": "date", "cellfilter": "dateconversion" }
app.filter('dateconversion', function(){ return function(date,timezone){ return (timezone ? moment.tz(date) :moment.utc(date)).format('dd/mmm/yyyy hh:mm:ss.sss'); }; })
Comments
Post a Comment