<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Flex Examples &#187; selectedDate</title>
	<atom:link href="http://blog.flexexamples.com/tag/selecteddate/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.flexexamples.com</link>
	<description>Just a bunch of Adobe Flex Examples</description>
	<lastBuildDate>Wed, 26 Jan 2011 18:09:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Filtering an MX DataGrid control by date range using Flex</title>
		<link>http://blog.flexexamples.com/2010/02/01/filtering-an-mx-datagrid-control-by-date-range-using-flex/</link>
		<comments>http://blog.flexexamples.com/2010/02/01/filtering-an-mx-datagrid-control-by-date-range-using-flex/#comments</comments>
		<pubDate>Tue, 02 Feb 2010 02:11:22 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[ArrayCollection]]></category>
		<category><![CDATA[DataGrid]]></category>
		<category><![CDATA[DateField]]></category>
		<category><![CDATA[filterFunction]]></category>
		<category><![CDATA[refresh()]]></category>
		<category><![CDATA[selectableRange]]></category>
		<category><![CDATA[selectedDate]]></category>
		<category><![CDATA[time]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/?p=2366</guid>
		<description><![CDATA[<p>The following example shows how you can filter an MX DataGrid control in Flex using two MX DateField control&#8217;s and filtering the ArrayCollection data provider.</p> <p></p> &#60;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&#62; &#60;!-- http://blog.flexexamples.com/2010/02/01/filtering-an-mx-datagrid-control-by-date-range-using-flex/ --&#62; &#60;mx:Application name=&#34;MX_DataGrid_filter_DateField_test&#34; xmlns:mx=&#34;http://www.adobe.com/2006/mxml&#34; layout=&#34;vertical&#34; verticalAlign=&#34;middle&#34; backgroundColor=&#34;white&#34; initialize=&#34;init();&#34;&#62; &#160; &#60;mx:Script&#62; &#60;![CDATA[ protected const MIN_DATE:Date = new Date(2010, 0, 1); protected const MAX_DATE:Date = new [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can filter an MX DataGrid control in Flex using two MX DateField control&#8217;s and filtering the ArrayCollection data provider.</p>
<p><span id="more-2366"></span></p>

<div class="wp_syntax"><div class="code"><pre class="mxml" style="font-family:monospace;"><span style="color: #000000;">&lt;?xml version=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?<span style="color: #7400FF;">&gt;</span></span>
<span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- http://blog.flexexamples.com/2010/02/01/filtering-an-mx-datagrid-control-by-date-range-using-flex/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Application</span> name=<span style="color: #ff0000;">&quot;MX_DataGrid_filter_DateField_test&quot;</span></span>
<span style="color: #000000;">        xmlns:mx=<span style="color: #ff0000;">&quot;http://www.adobe.com/2006/mxml&quot;</span></span>
<span style="color: #000000;">        layout=<span style="color: #ff0000;">&quot;vertical&quot;</span></span>
<span style="color: #000000;">        verticalAlign=<span style="color: #ff0000;">&quot;middle&quot;</span></span>
<span style="color: #000000;">        backgroundColor=<span style="color: #ff0000;">&quot;white&quot;</span></span>
<span style="color: #000000;">        initialize=<span style="color: #ff0000;">&quot;init();&quot;</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #339933;">&lt;mx:Script&gt;</span>
<span style="color: #339933;">        &lt;![CDATA[</span>
<span style="color: #339933;">            protected const MIN_DATE:Date = new Date(2010, 0, 1);</span>
<span style="color: #339933;">            protected const MAX_DATE:Date = new Date(2010, 11, 31);</span>
&nbsp;
<span style="color: #339933;">            protected function date_labelFunc(item:Object, col:DataGridColumn):String {</span>
<span style="color: #339933;">                var time:Number = Date.parse(item[col.dataField]);</span>
<span style="color: #339933;">                return new Date(time).toDateString();</span>
<span style="color: #339933;">            }</span>
&nbsp;
<span style="color: #339933;">            protected function arrColl_filterFunc(item:Object):Boolean {</span>
<span style="color: #339933;">                var cDate:Number = Date.parse(item.holidayDate);</span>
&nbsp;
<span style="color: #339933;">                if (!sDate || !eDate) {</span>
<span style="color: #339933;">                    return true;</span>
<span style="color: #339933;">                }</span>
&nbsp;
<span style="color: #339933;">                if (sDate.selectedDate &amp;&amp; eDate.selectedDate) {</span>
<span style="color: #339933;">                    return (sDate.selectedDate.time &lt;= cDate) &amp;&amp; (eDate.selectedDate.time &gt;= cDate);</span>
<span style="color: #339933;">                } else if (sDate.selectedDate) {</span>
<span style="color: #339933;">                    return sDate.selectedDate.time &lt;= cDate;</span>
<span style="color: #339933;">                } else if (eDate.selectedDate) {</span>
<span style="color: #339933;">                    return eDate.selectedDate.time &gt;= cDate;</span>
<span style="color: #339933;">                } else {</span>
<span style="color: #339933;">                    return true;</span>
<span style="color: #339933;">                }</span>
<span style="color: #339933;">            }</span>
&nbsp;
<span style="color: #339933;">            protected function init():void {</span>
<span style="color: #339933;">                sDate.selectedDate = MIN_DATE;</span>
<span style="color: #339933;">                sDate.selectableRange = {rangeStart:MIN_DATE, rangeEnd:MAX_DATE};</span>
&nbsp;
<span style="color: #339933;">                eDate.selectedDate = MAX_DATE;</span>
<span style="color: #339933;">                eDate.selectableRange = sDate.selectableRange;</span>
<span style="color: #339933;">            }</span>
<span style="color: #339933;">        ]]&gt;</span>
<span style="color: #339933;">    &lt;/mx:Script&gt;</span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:ArrayCollection</span> id=<span style="color: #ff0000;">&quot;arrColl&quot;</span> filterFunction=<span style="color: #ff0000;">&quot;arrColl_filterFunc&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:source</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Array</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> holidayName=<span style="color: #ff0000;">&quot;New Years&quot;</span> holidayDate=<span style="color: #ff0000;">&quot;2010/1/1&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> holidayName=<span style="color: #ff0000;">&quot;Martin Luther King, Jr. Day&quot;</span> holidayDate=<span style="color: #ff0000;">&quot;2010/1/18&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
&nbsp;
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> holidayName=<span style="color: #ff0000;">&quot;Groundhog Day&quot;</span> holidayDate=<span style="color: #ff0000;">&quot;2010/2/2&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> holidayName=<span style="color: #ff0000;">&quot;Chinese New Year&quot;</span> holidayDate=<span style="color: #ff0000;">&quot;2010/2/14&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> holidayName=<span style="color: #ff0000;">&quot;Valentine's Day&quot;</span> holidayDate=<span style="color: #ff0000;">&quot;2010/2/14&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> holidayName=<span style="color: #ff0000;">&quot;President's Day&quot;</span> holidayDate=<span style="color: #ff0000;">&quot;2010/2/15&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> holidayName=<span style="color: #ff0000;">&quot;Ash Wednesday&quot;</span> holidayDate=<span style="color: #ff0000;">&quot;2010/2/17&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
&nbsp;
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> holidayName=<span style="color: #ff0000;">&quot;Daylight Saving Time starts&quot;</span> holidayDate=<span style="color: #ff0000;">&quot;2010/3/14&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> holidayName=<span style="color: #ff0000;">&quot;St. Patrick's Day&quot;</span> holidayDate=<span style="color: #ff0000;">&quot;2010/3/17&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> holidayName=<span style="color: #ff0000;">&quot;First Day of Spring&quot;</span> holidayDate=<span style="color: #ff0000;">&quot;2010/3/20&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
&nbsp;
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> holidayName=<span style="color: #ff0000;">&quot;April Fool's Day&quot;</span> holidayDate=<span style="color: #ff0000;">&quot;2010/4/1&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> holidayName=<span style="color: #ff0000;">&quot;Easter&quot;</span> holidayDate=<span style="color: #ff0000;">&quot;2010/4/4&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> holidayName=<span style="color: #ff0000;">&quot;Administrative Professional's Day&quot;</span> holidayDate=<span style="color: #ff0000;">&quot;2010/4/21&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> holidayName=<span style="color: #ff0000;">&quot;Earth Day&quot;</span> holidayDate=<span style="color: #ff0000;">&quot;2010/4/22&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
&nbsp;
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> holidayName=<span style="color: #ff0000;">&quot;Cinco De Mayo&quot;</span> holidayDate=<span style="color: #ff0000;">&quot;2010/5/5&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> holidayName=<span style="color: #ff0000;">&quot;Mothers Day&quot;</span> holidayDate=<span style="color: #ff0000;">&quot;2010/5/9&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> holidayName=<span style="color: #ff0000;">&quot;Armed Forces Day&quot;</span> holidayDate=<span style="color: #ff0000;">&quot;2010/5/15&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> holidayName=<span style="color: #ff0000;">&quot;Memorial Day&quot;</span> holidayDate=<span style="color: #ff0000;">&quot;2010/5/31&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
&nbsp;
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> holidayName=<span style="color: #ff0000;">&quot;Flag Day&quot;</span> holidayDate=<span style="color: #ff0000;">&quot;2010/6/14&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> holidayName=<span style="color: #ff0000;">&quot;Father's Day&quot;</span> holidayDate=<span style="color: #ff0000;">&quot;2010/6/20&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> holidayName=<span style="color: #ff0000;">&quot;Summer Begins&quot;</span> holidayDate=<span style="color: #ff0000;">&quot;2010/6/21&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
&nbsp;
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> holidayName=<span style="color: #ff0000;">&quot;Independence Day/July 4th&quot;</span> holidayDate=<span style="color: #ff0000;">&quot;2010/7/4&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
&nbsp;
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> holidayName=<span style="color: #ff0000;">&quot;Labor Day&quot;</span> holidayDate=<span style="color: #ff0000;">&quot;2010/9/6&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> holidayName=<span style="color: #ff0000;">&quot;Grandparents Day&quot;</span> holidayDate=<span style="color: #ff0000;">&quot;2010/9/12&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> holidayName=<span style="color: #ff0000;">&quot;First Day of Autumn&quot;</span> holidayDate=<span style="color: #ff0000;">&quot;2010/9/23&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
&nbsp;
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> holidayName=<span style="color: #ff0000;">&quot;Columbus Day&quot;</span> holidayDate=<span style="color: #ff0000;">&quot;2010/10/11&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> holidayName=<span style="color: #ff0000;">&quot;United Nations Day&quot;</span> holidayDate=<span style="color: #ff0000;">&quot;2010/10/24&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> holidayName=<span style="color: #ff0000;">&quot;Halloween&quot;</span> holidayDate=<span style="color: #ff0000;">&quot;2010/10/31&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
&nbsp;
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> holidayName=<span style="color: #ff0000;">&quot;All Saints' Day&quot;</span> holidayDate=<span style="color: #ff0000;">&quot;2010/11/1&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> holidayName=<span style="color: #ff0000;">&quot;Daylight Saving Time Ends&quot;</span> holidayDate=<span style="color: #ff0000;">&quot;2010/11/7&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> holidayName=<span style="color: #ff0000;">&quot;Veteran's Day&quot;</span> holidayDate=<span style="color: #ff0000;">&quot;2010/11/11&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> holidayName=<span style="color: #ff0000;">&quot;Thanksgiving&quot;</span> holidayDate=<span style="color: #ff0000;">&quot;2010/11/25&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
&nbsp;
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> holidayName=<span style="color: #ff0000;">&quot;Wright Brothers Day&quot;</span> holidayDate=<span style="color: #ff0000;">&quot;2010/12/17&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> holidayName=<span style="color: #ff0000;">&quot;First Day Winter&quot;</span> holidayDate=<span style="color: #ff0000;">&quot;2010/12/21&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> holidayName=<span style="color: #ff0000;">&quot;Christmas&quot;</span> holidayDate=<span style="color: #ff0000;">&quot;2010/12/25&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Object</span> holidayName=<span style="color: #ff0000;">&quot;New Years Eve&quot;</span> holidayDate=<span style="color: #ff0000;">&quot;2010/12/31&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Array</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:source</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:ArrayCollection</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:ApplicationControlBar</span> dock=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Form</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:FormItem</span> label=<span style="color: #ff0000;">&quot;Start date:&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:DateField</span> id=<span style="color: #ff0000;">&quot;sDate&quot;</span> change=<span style="color: #ff0000;">&quot;arrColl.refresh();&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:FormItem</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:FormItem</span> label=<span style="color: #ff0000;">&quot;End date:&quot;</span><span style="color: #7400FF;">&gt;</span></span>
                <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:DateField</span> id=<span style="color: #ff0000;">&quot;eDate&quot;</span> change=<span style="color: #ff0000;">&quot;arrColl.refresh();&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:FormItem</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Form</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:ApplicationControlBar</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:DataGrid</span> id=<span style="color: #ff0000;">&quot;dGrid&quot;</span> dataProvider=<span style="color: #ff0000;">&quot;{arrColl}&quot;</span> width=<span style="color: #ff0000;">&quot;400&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:columns</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:DataGridColumn</span> dataField=<span style="color: #ff0000;">&quot;holidayName&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:DataGridColumn</span> dataField=<span style="color: #ff0000;">&quot;holidayDate&quot;</span> labelFunction=<span style="color: #ff0000;">&quot;date_labelFunc&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:columns</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:DataGrid</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Application</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<div span="googleAdsLeaderboard">
<script type="text/javascript"><!--
google_ad_client = "pub-3325829455487492";
/* 728x90, created 7/15/09 */
google_ad_slot = "6403511741";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<br />
</div>
<p class="information"><a href="http://dl.dropbox.com/u/4509565/FlexExamples_com/MX_DataGrid_filter_DateField_test/srcview/index.html">View source</a> is enabled in the following example.</p>
<p><iframe src="http://dl.dropbox.com/u/4509565/FlexExamples_com/MX_DataGrid_filter_DateField_test/main.html" width="100%" height="300"></iframe></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Filtering an MX DataGrid control by date range using Flex on FlexExamples.com',url: 'http://blog.flexexamples.com/2010/02/01/filtering-an-mx-datagrid-control-by-date-range-using-flex/',contentID: 'post-2366',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'filterFunction,refresh(),selectableRange,selectedDate,time',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2010/02/01/filtering-an-mx-datagrid-control-by-date-range-using-flex/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
		<item>
		<title>Setting the selected date in a DateChooser control in Flex</title>
		<link>http://blog.flexexamples.com/2008/04/02/setting-the-selected-date-in-a-datechooser-control-in-flex/</link>
		<comments>http://blog.flexexamples.com/2008/04/02/setting-the-selected-date-in-a-datechooser-control-in-flex/#comments</comments>
		<pubDate>Thu, 03 Apr 2008 04:49:59 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[DateChooser]]></category>
		<category><![CDATA[selectedDate]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/04/02/setting-the-selected-date-in-a-datechooser-control-in-flex/</guid>
		<description><![CDATA[<p>The following example shows how you can set the selected date for a Flex DateChooser control by setting the selectedDate property to a Date object.</p> <p>Full code after the jump.</p> <p></p> <p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/DateChooser_selectedDate_test_2/bin/srcview/source/main.mxml.html">View MXML</a></p> &#60;?xml version="1.0" encoding="utf-8"?&#62; &#60;!-- http://blog.flexexamples.com/2008/04/02/setting-the-selected-date-in-a-datechooser-control-in-flex/ --&#62; &#60;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="horizontal" verticalAlign="middle" backgroundColor="white"&#62; &#60;mx:DateChooser id="dateChooser1" selectedDate="{new Date('2008/04/19')}" showToday="false" /&#62; &#60;mx:DateChooser id="dateChooser2" initialize="dateChooser2.selectedDate [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can set the selected date for a Flex DateChooser control by setting the <code>selectedDate</code> property to a Date object.</p>
<p>Full code after the jump.</p>
<p><span id="more-581"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/DateChooser_selectedDate_test_2/bin/srcview/source/main.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/04/02/setting-the-selected-date-in-a-datechooser-control-in-flex/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="horizontal"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:DateChooser id="dateChooser1"
            selectedDate="{new Date('2008/04/19')}"
            showToday="false" /&gt;

    &lt;mx:DateChooser id="dateChooser2"
            initialize="dateChooser2.selectedDate = new Date('2008/04/19');"
            showToday="false" /&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/DateChooser_selectedDate_test_2/bin/srcview/index.html">View source</a> is enabled in the following example.</p>
<p><iframe src="http://blog.flexexamples.com/wp-content/uploads/DateChooser_selectedDate_test_2/bin/main.html" width="100%" height="250"></iframe></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Setting the selected date in a DateChooser control in Flex on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/04/02/setting-the-selected-date-in-a-datechooser-control-in-flex/',contentID: 'post-581',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'selectedDate',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2008/04/02/setting-the-selected-date-in-a-datechooser-control-in-flex/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Preventing a user from deselecting dates in a DateChooser control</title>
		<link>http://blog.flexexamples.com/2007/08/15/preventing-a-user-from-deselecting-dates-in-a-datechooser-control/</link>
		<comments>http://blog.flexexamples.com/2007/08/15/preventing-a-user-from-deselecting-dates-in-a-datechooser-control/#comments</comments>
		<pubDate>Thu, 16 Aug 2007 06:35:26 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[DateChooser]]></category>
		<category><![CDATA[dayNames]]></category>
		<category><![CDATA[disabledDays]]></category>
		<category><![CDATA[selectedDate]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2007/08/15/preventing-a-user-from-deselecting-dates-in-a-datechooser-control/</guid>
		<description><![CDATA[<p>Here&#8217;s an example which prevents users from deselecting a date in the Flex DateChooser control by Ctrl-clicking on the date. By listening for the DateChooser control&#8217;s change event, and if the currently selected date is null, we set the selected date to the previously selected date. Also, for no good reason, I added a List [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s an example which prevents users from deselecting a date in the Flex DateChooser control by Ctrl-clicking on the date. By listening for the DateChooser control&#8217;s <code>change</code> event, and if the currently selected date is null, we set the selected date to the previously selected date. Also, for no good reason, I added a List control which lets you disable certain dates in the calendar.</p>
<p>Full code after the jump.</p>
<p><span id="more-92"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/DateChooser_selectedDate_test/main.mxml">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2007/08/15/preventing-a-user-from-deselecting-dates-in-a-datechooser-control/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            import mx.events.CalendarLayoutChangeEvent;

            private function dateChooser_change(evt:CalendarLayoutChangeEvent):void {
                /* Prevent deselecting of dates. */
                if (evt.currentTarget.selectedDate == null) {
                    evt.currentTarget.selectedDate = evt.newDate;
                }
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:Array id="weekDayNames"&gt;
        &lt;mx:String&gt;Sun&lt;/mx:String&gt;
        &lt;mx:String&gt;Mon&lt;/mx:String&gt;
        &lt;mx:String&gt;Tue&lt;/mx:String&gt;
        &lt;mx:String&gt;Wed&lt;/mx:String&gt;
        &lt;mx:String&gt;Thu&lt;/mx:String&gt;
        &lt;mx:String&gt;Fri&lt;/mx:String&gt;
        &lt;mx:String&gt;Sat&lt;/mx:String&gt;
    &lt;/mx:Array&gt;

    &lt;mx:String id="selDate"&gt;{dateChooser.selectedDate.toDateString()}&lt;/mx:String&gt;

    &lt;mx:HBox&gt;
        &lt;mx:VBox&gt;
            &lt;mx:DateChooser id="dateChooser"
                    disabledDays="{disabledDaysList.selectedIndices}"
                    selectedDate="{new Date()}"
                    dayNames="{weekDayNames}"
                    yearNavigationEnabled="true"
                    change="dateChooser_change(event)" /&gt;

            &lt;mx:Label text="Selected date: {selDate}" /&gt;
        &lt;/mx:VBox&gt;

        &lt;mx:VBox&gt;
            &lt;mx:Label text="Disabled days:"    /&gt;
            &lt;mx:List id="disabledDaysList"
                    width="100"
                    dataProvider="{weekDayNames}"
                    allowMultipleSelection="true" /&gt;
        &lt;/mx:VBox&gt;
    &lt;/mx:HBox&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/DateChooser_selectedDate_test/bin/srcview/index.html">View source</a> is enabled in the following example.</p>
<p><iframe src="http://blog.flexexamples.com/wp-content/uploads/DateChooser_selectedDate_test/bin/main.html" width="100%" height="260"></iframe></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Preventing a user from deselecting dates in a DateChooser control on FlexExamples.com',url: 'http://blog.flexexamples.com/2007/08/15/preventing-a-user-from-deselecting-dates-in-a-datechooser-control/',contentID: 'post-92',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'dayNames,disabledDays,selectedDate',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2007/08/15/preventing-a-user-from-deselecting-dates-in-a-datechooser-control/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

