Try to search your question here, if you can't find : Ask Any Question Now ?

Angular DateTime Format

HomeCategory: stackoverflowAngular DateTime Format
Avatarjulie asked 3 months ago

I have this json array with datetime strings. and I am populating this data in the table.

[{"id":8,"startdate":"2018-02-01T00:00:00","enddate":"2018-02-28T23:59:59.9999999","created":"2018-02-15T12:58:43.3417189","filename":"data022018"},{"id":9,"startdate":"2019-03-01T00:00:00","enddate":"2019-03-31T23:59:59.9999999","created":"2019-03-15T12:59:45.1079351","filename":"data032019"},{"id":10,"startdate":"2019-04-01T00:00:00","enddate":"2019-04-30T23:59:59.9999999","created":"2019-04-08T12:58:43.3417189","filename":"data042019"}]

this is html code in my table

<td>{{ archive.startdate | date: 'short' }} - {{ archive.enddate | date: 'dd/MM/yyyy' }}</td>

the result is

2/1/18, 12:00 AM - 01/03/2018 (just want to show i format with different methods)
1/4/2018 - 1/5/2018

what i really want to achieve is the last date to be on the last day of the month instead of starting from first day of following month.

1/02/2018 - 28/02/2018

What did i do wrong? I want to take enddate day,month and year.

1 Answers
Best Answer
Avatarnaveen answered 3 months ago
Your Answer

18 + 19 =

Popular Tags

WP Facebook Auto Publish Powered By : XYZScripts.com