am able to get date from database at controller , but when i passing that to view am getting date like this ""/Date(1473273000000)/""
i tried by converting , but no result
controoler.cs
public JsonResult GetPendings(int? pendingID)
{
string eid = pendingID.ToString();
TestDemoEntities db = new TestDemoEntities();
var data = (from ap in db.Accounting_PendingBills
join apa in db.Accounting_PendingBillsAdjusted on ap.BillRef equals apa.TowardsBillRef
group apa by new { ap.BillDate, ap.Amount, ap.Party, apa.TowardsBillRef } into g
select new
{
// BillDate = g.Key.BillDate,
BillDate = Convert.ToDateTime(g.Key.BillDate),
Party = g.Key.Party,
AmountAdjusted = g.Sum(aa => aa.AmountAdjusted)
}).Where(ap => ap.Party == eid).ToList();
view
@*{{rm.BillDate|date}}*@
JS(angular)
var getPendingData = ReceiptsService.GetPendings(c);
getPendingData.then(function (d) {
$scope.ReceiptsViewModel = d.data;
}
1 Reply
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Midhun TpPosted Oct 13, 2016, 6:58 AM
Have you tried changing input type from date to text? Is that also showing same result?
You can try giving pattern if input type s date. Please check below thread too-
http://stackoverflow.com/questions/20131553/angularjs-convert-dates-in-controller