2

I have a problem with setting the date and view it on the web page here is my code:

.ts

public lastActivitateDate = new Date('10.10.2016');

.html

{{lastActivitateDate | date : 'dd.mm.yyyy'}}

and I get on the web page: 10.00.2016

so how do I fix this problem?

Cœur
  • 37,241
  • 25
  • 195
  • 267
s66168
  • 31
  • 4

1 Answers1

3

just change to MM instead of mm

mm provides minutes

MM provides months

.ts

public lastActivitateDate = new Date('10.10.2016');

.html

{{lastActivitateDate | date : 'dd.MM.yyyy'}}

you will get proper answer on your screen. If you need some more diffrent date time format go through momentjs.

momentjs provides nice and diffrent format to use date and time. Here, below is the link.

momentjs