T
T
thatside2015-08-17 10:57:59
Angular
thatside, 2015-08-17 10:57:59

How to set date format in AngularJS?

There is a project under development with a frontend on Angular. As a datepicker, a bootstrap one (seemingly) with a connected directive is used. Everywhere in the format, the date format is the usual dd.mm.YYYY, but as a result, I receive a date like Thu Aug 13 2015 00:00:00 GMT+0300 (Finland (summer)) on the server.
How to switch date formatting mode? I ask you not to throw stones, I am a complete layman in Angular.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
_
_ _, 2015-08-17
@AMar4enko

If a properly written directive is used, then the data in the scope will be in the form of a JavaScript Date.
When sending it to the server, it makes sense to serialize it using toISOString (), then it will come to you in the form 2011-10-05T14:48:00.000Z

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question