Format ISO date (yyyy-MM-ddThh:mm:ss.sssZ) to be displayed in INPUT (dd/mm/yyyy hh:mm)

Asked

Viewed 302 times

0

The server gives me the date in ISO format (yyyy-MM-ddThh:mm:ss.sssZ). How do I have this date displayed in the input with dd/mm/yyyy hh:mm format?

<input type="date" class="form-control" ng-model="tarefa.createdAt" />

I am using Angularjs v1.6.

  • the solution I found was to instantiate a Date() object, passing as parameter my date in ISO format. Then my.createdAt task received that date.

1 answer

0

When I went through it I found the recommendation to use the angular-datetime

<input type="date" class="form-control" date='dd-MM-yyyy HH:mm' ng-model="tarefa.createdAt" />

https://github.com/eight04/angular-datetime

Browser other questions tagged

You are not signed in. Login or sign up in order to post.