Please Use moment js. For more advance level you can make filter for dateformat and use code as below.
(function () {
'use strict';
angular.module('app.filter')
.filter('utcDate', utcDate);
function utcDate() {
return function (value, format) {
moment.locale("en");
switch (format) {
case 'shortTime':
format = 'LT';
break;
case 'shortDate':
format = 'L';
break;
case 'communityDate':
format = 'LT L';
break;
case 'orderDate':
format = 'LT ll';
break;
case 'orderLongTime':
format = 'HH:mm';
break;
case 'activityDate':
format = 'L LT';
break;
case 'chatComivo':
format = 'MMM D';
break;
case 'broadcastReplyTime':
format = 'HH:mm a';
break;
case 'broadcastReplyDate':
format = 'MM/DD/YYYY';
break;
case 'promotionDate':
format = 'MM/DD/YYYY';
break;
case 'converstionDate':
format = 'MMMM DD YYYY, h:mm:ss a';
break;
case 'lastRead':
format = 'lll';
break;
case 'test':
format = 'HH:mm:ss dd-MM-yyyy';
}
//var localDate = moment.utc(value).local(); this is for to convert date into utc date
//return localDate.format(format);return moment().format(format);
return moment().format(format) } }})();
And use following html
this date <p>{{date | utcDate:'test'}}</p>
you can update it as per your requirement.
vm.NapIncident.RecordDate? String? Date object? Can you create working snippet (icon[<>]in editor) to demonstrate your issue? Are you using angular (like in title) or angularjs (like in tag)?vm.NapIncident.RecordDateis a string. How can I do this if that is a string? Filtering doesn't work