I have a question regarding my drop-down select functionality. Currently, it shows months by numbers but I would like to change it to display the full month names instead.
Below is the original code snippet:
<select ng-model="month" ng-options="month as month for month in months" ng-change="updateMonth()">
<option value="">Choose Month</option>
</select>
After some experimentation, I tried adding a filter to convert the numbers into month names. However, it ended up displaying all options as 'December' instead of different month names:
<select ng-model="month" ng-options="month as month | date: 'MMMM' for month in months" ng-change="updateMonth()">
<option value="">Choose Month</option>
</select>
The 'months' variable in the JavaScript contains an array from 0 to 11 representing the month numbers.
To clarify,
Initially, the dropdown displays months as follows:
0 1 2 3 4 5 6 7 8 9 10 11
With the added filter, the display changes to:
December December December December December December December December December December December