<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.infopathdev.com:443/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Controls</title><link>https://www.infopathdev.com:443/forums/43.aspx</link><description> </description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: limit date choice in Date Picker</title><link>https://www.infopathdev.com:443/forums/thread/19320.aspx</link><pubDate>Tue, 24 Apr 2007 12:01:48 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:19320</guid><dc:creator>nukkumatti</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/19320.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=43&amp;PostID=19320</wfw:commentRss><description>Somehow the copy paste messed up my post so read each line only once :)</description></item><item><title>Re: limit date choice in Date Picker</title><link>https://www.infopathdev.com:443/forums/thread/19319.aspx</link><pubDate>Tue, 24 Apr 2007 11:55:53 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:19319</guid><dc:creator>nukkumatti</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/19319.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=43&amp;PostID=19319</wfw:commentRss><description>&lt;p&gt;This is a bit tricky but doable.&lt;/p&gt;&lt;p&gt;The easiest would be to set the fromat of the datepicker to this representation of the date (e.g. Wednesday, March 14, 2007). Then you could check if there is &amp;quot;Saturday&amp;quot; or &amp;quot;Sunday&amp;quot; within the text of the xml node and then handle the wrong selection of the user. However this is not possible as the internal representation of a date is always 3/14/2007 for the above mentioned&amp;nbsp;date.&lt;/p&gt;&lt;p&gt;But there is a little workaround. I guess you have a Submit button on your form so double click it and select &amp;quot;Edit code&amp;quot;. Now you can use the following code to check if some wrong day was selected (code is in C#):&lt;/p&gt;&lt;font color="#008000" size="2"&gt;&lt;p&gt;//store the selected date into a temp variable&lt;/p&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;p&gt;&lt;font color="#0000ff" size="2"&gt;string&lt;/font&gt;&lt;font size="2"&gt; tmp = thisXDocument.DOM.selectSingleNode(&amp;quot;my:myFields/my:datepicker&amp;quot;).text;&lt;p&gt;&lt;font color="#008000" size="2"&gt;//convert the date string stored in your temp variable to the date format you need to do the check&lt;/font&gt;&lt;/p&gt;&lt;/font&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;string&lt;/font&gt;&lt;font size="2"&gt; tmp = thisXDocument.DOM.selectSingleNode(&amp;quot;my:myFields/my:datepicker&amp;quot;).text;&lt;p&gt;&lt;font color="#008000" size="2"&gt;//convert the date string stored in your temp variable to the date format you need to do the check&lt;/font&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;//convert the date string stored in your temp variable to the date format you need to do the check&lt;/font&gt;&lt;font size="2"&gt;&lt;p&gt;&lt;font color="#0000ff" size="2"&gt;string&lt;/font&gt;&lt;font size="2"&gt; convertedTime = Convert.ToDateTime(tmp).ToString(&amp;quot;dddd, MMMM dd yyyy&amp;quot;);&lt;p&gt;&lt;font color="#008000" size="2"&gt;//get only the day fromt the complete date (Wedenesday, March 14, 2007)&lt;/font&gt;&lt;/p&gt;&lt;/font&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;string&lt;/font&gt;&lt;font size="2"&gt; convertedTime = Convert.ToDateTime(tmp).ToString(&amp;quot;dddd, MMMM dd yyyy&amp;quot;);&lt;p&gt;&lt;font color="#008000" size="2"&gt;//get only the day fromt the complete date (Wedenesday, March 14, 2007)&lt;/font&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;//get only the day fromt the complete date (Wedenesday, March 14, 2007)&lt;/font&gt;&lt;font size="2"&gt;&lt;p&gt;&lt;font color="#0000ff" size="2"&gt;string&lt;/font&gt;&lt;font size="2"&gt; day = convertedTime.Substring(0, convertedTime.IndexOf(&amp;quot;,&amp;quot;));&lt;p&gt;&lt;font color="#008000" size="2"&gt;//check if the selected day is either a Saturday or Sunday&lt;/font&gt;&lt;/p&gt;&lt;/font&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;string&lt;/font&gt;&lt;font size="2"&gt; day = convertedTime.Substring(0, convertedTime.IndexOf(&amp;quot;,&amp;quot;));&lt;p&gt;&lt;font color="#008000" size="2"&gt;//check if the selected day is either a Saturday or Sunday&lt;/font&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;//check if the selected day is either a Saturday or Sunday&lt;/font&gt;&lt;font size="2"&gt;&lt;p&gt;&lt;font color="#0000ff" size="2"&gt;if&lt;/font&gt;&lt;font size="2"&gt;(day == &amp;quot;Saturday&amp;quot; || day == &amp;quot;Sunday&amp;quot;)&lt;p&gt;{&lt;/p&gt;&lt;p&gt;&lt;font color="#008000" size="2"&gt;//empty the datepicker control again&lt;/font&gt;&lt;/p&gt;&lt;/font&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;if&lt;/font&gt;&lt;font size="2"&gt;(day == &amp;quot;Saturday&amp;quot; || day == &amp;quot;Sunday&amp;quot;)&lt;p&gt;{&lt;/p&gt;&lt;p&gt;&lt;font color="#008000" size="2"&gt;//empty the datepicker control again&lt;/font&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;//empty the datepicker control again&lt;/font&gt;&lt;font size="2"&gt;&lt;p&gt;thisXDocument.DOM.selectSingleNode(&amp;quot;my:myFields/my:field3&amp;quot;).text = &amp;quot;&amp;quot;;&lt;/p&gt;&lt;p&gt;&lt;font color="#008000" size="2"&gt;//show message to the user that he/she did a wrong selection&lt;/font&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;//show message to the user that he/she did a wrong selection&lt;/font&gt;&lt;font size="2"&gt;&lt;p&gt;thisXDocument.UI.Alert(&amp;quot;You are not allowed to select a Saturday or Sunday ! Please make a new selection.&amp;quot;);&lt;/p&gt;&lt;p&gt;}&lt;/p&gt;&lt;p&gt;Let me know if this helps you !?!&lt;/p&gt;&lt;/font&gt;</description></item><item><title>limit date choice in Date Picker</title><link>https://www.infopathdev.com:443/forums/thread/19315.aspx</link><pubDate>Tue, 24 Apr 2007 10:18:31 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:19315</guid><dc:creator>alex.1</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/19315.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=43&amp;PostID=19315</wfw:commentRss><description>&lt;p&gt;Hallo,&lt;/p&gt;&lt;p&gt;&amp;nbsp;I would like to disable choice of weekend-days in Date Picker.&lt;/p&gt;&lt;p&gt;Alex&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item></channel></rss>