0

I want to format the output of the Primeng Range Calender for both dates to be 'dd/MM/yyyy' like this, and I tried to use pipe to transform the these data. But is only only transforming the first date, and not the second. Html code is:

<div>{{rangeDates | date: 'dd/MM/yyyy'}}</div>

Ts file is:

  rangeDates: Date[];

I'm getting this error:

Error: InvalidPipeArgument: 'Unable to convert "Mon Dec 02 2019 00:00:00 GMT+0100 (Central European Standard Time),Tue Dec 10 2019 00:00:00 GMT+0100 (Central European Standard Time)" into a date' for pipe 'DatePipe'
Ivana
  • 842
  • 2
  • 15
  • 33

1 Answers1

2

Try this

<div *ngFor="let range of rangeDates"">
    {{range | date: 'dd/MM/yyyy'}}
</div>
A.khalifa
  • 2,366
  • 3
  • 27
  • 40