Custom Value Calculation for ListView Item

Hi all,

I want to to display some data in a ListView. In my case the data is bound to the grid by using the CActiveDataProvider. Now the issue is, that I retreive the Birthday but want to display the Age of the User in the ListViewItem.

What is the best way to calculate this data and show it in every ListView entry? Possible solution is, doing the calculation within the view but this is not very nice…

any code suggestions?




What about making a function called "GetAge" to the model that has "Birthday" attribute?

Or, you may want to make an attribute called "Age".