<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:controls="com.iwobanas.controls.*" 
    xmlns:dataGridClasses="com.iwobanas.controls.dataGridClasses.*" layout="vertical"  viewSourceURL="srcview/index.html">
    <mx:Script>
        <![CDATA[
            import mx.controls.dataGridClasses.DataGridColumn;
            
            public function dateLabelFunction(item:Object, column:DataGridColumn):String
            {
                return dateFormatter.format(item[column.dataField]);
            }
        ]]>
    </mx:Script>
    
    <mx:Style source="defaults.css" />
    
    <mx:DateFormatter id="dateFormatter" />
    
    <mx:ArrayCollection id="dp">
        <mx:Object name="John Potter" birth_date="{new Date(1984,11,04)}" />
        <mx:Object name="Emmily Richardson" birth_date="{new Date(1985,3,20)}" />
        <mx:Object name="Michael Berg" birth_date="{new Date(1985,3,4)}" />
        <mx:Object name="Denis Henderson" birth_date="{new Date(1985,5,13)}" />
        <mx:Object name="Sandra Russel" birth_date="{new Date(1985,11,17)}" />
    </mx:ArrayCollection>
    
    <mx:Panel title="MDateGrid date filter example" width="100%" height="100%" >
    
        <controls:MDataGrid dataProvider="{dp}" width="100%" height="100%">
            <controls:columns>
                <dataGridClasses:MDataGridColumn dataField="name" headerText="Name" />
                <dataGridClasses:MDataGridColumn dataField="birth_date" headerText="Birth Date"
                    labelFunction="dateLabelFunction"
                    filterEditor="com.iwobanas.controls.dataGridClasses.filterEditors.DateFieldFilterEditor" />
            </controls:columns>
        </controls:MDataGrid>
    
    </mx:Panel>
</mx:Application>