Hi ,
I am using knockuout js ,
I have one list item by oing foreach I am displaying month number ,
now from that month number i want to show month name short name.
<div data-bind="dxList: { dataSource: userDatasource_plan, autoPagingEnabled: true,onItemClick:onPlanUserSelectionClick, height : '80%' }">
<div data-options="dxTemplate : { name: 'item' } ">
<div data-bind="text: UserID, visible:false"></div>
<div class="enqueryListCustomerName" data-bind="text: FullName"></div>
<div class="enqueryListCustomerType" data-bind="text: Division"></div>
<div class="enqueryListCustomerLocation" data-bind="text: Month"></div>
</div>
</div>
Now insted of Month i want to use i want to call javascript function which will bring month prefix name ..
What I have tried:
var viewModel = {
title: ko.observable(Common.Localize('Plan')),
MonthName: ko.observable(function (param) {
var month = new Array();
month[0] = "January";
month[1] = "February";
month[2] = "March";
month[3] = "April";
month[4] = "May";
month[5] = "June";
month[6] = "July";
month[7] = "August";
month[8] = "September";
month[9] = "October";
month[10] = "November";
month[11] = "December";
var n = month[param];
}),
but not sure how to call this function and how to pass paramter