4

I am using JSON data to populate a dropdown list. Here i have multiple fields for start and end time. I am concatinating them at ng options and using a date filter to rearrange date time. But the filter seems not working with the second value inside ng option.

ng-options="(session.SessionStartTime|date:'MMM/dd hh:mm' +'- '+session.max|date:'MMM/dd hh:mm')

it is working fine if i doesnot concatinate two values

Can anyone help

Ranjith Jayaram
  • 300
  • 2
  • 13

1 Answers1

5

look into this fiddle for your problem solution

<select
        ng-model="datedemo"
        ng-options="(a.max|date:'MMM/dd hh:mm') +' - '+  (a.SessionStartTime|date:'MMM/dd hh:mm') for a in session"></select>

i have found this link where explanation is done. here is explanation

Community
  • 1
  • 1