<?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>Code</title><link>https://www.infopathdev.com:443/forums/45.aspx</link><description /><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Adding dates in infopath 2003</title><link>https://www.infopathdev.com:443/forums/thread/60078.aspx</link><pubDate>Fri, 08 Oct 2010 02:59:26 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:60078</guid><dc:creator>Jimmy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/60078.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=60078</wfw:commentRss><description>&lt;p&gt;&lt;a href="http://www.google.co.jp/search?q=javascript+substring&amp;amp;rls=com.microsoft:en-us&amp;amp;ie=UTF-8&amp;amp;oe=UTF-8&amp;amp;startIndex=&amp;amp;startPage=1&amp;amp;redir_esc=&amp;amp;ei=yoiuTNi6DY_0swO-g_GXDA"&gt;http://www.google.co.jp/search?q=javascript+substring&amp;amp;rls=com.microsoft:en-us&amp;amp;ie=UTF-8&amp;amp;oe=UTF-8&amp;amp;startIndex=&amp;amp;startPage=1&amp;amp;redir_esc=&amp;amp;ei=yoiuTNi6DY_0swO-g_GXDA&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;InfoPath&amp;#39;s dates are always in the format yyyy-mm-dd, so extracting out the three parts should be pretty straightforward.&lt;/p&gt;</description></item><item><title>Re: Adding dates in infopath 2003</title><link>https://www.infopathdev.com:443/forums/thread/60074.aspx</link><pubDate>Thu, 07 Oct 2010 19:07:05 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:60074</guid><dc:creator>codediva</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/60074.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=60074</wfw:commentRss><description>&lt;p&gt;Jimmy, &lt;/p&gt;
&lt;p&gt;I guess my question is how do I take that date value entered in the form and &amp;quot;parse out the individual parts&amp;quot;?&lt;/p&gt;</description></item><item><title>Re: Adding dates in infopath 2003</title><link>https://www.infopathdev.com:443/forums/thread/60064.aspx</link><pubDate>Thu, 07 Oct 2010 16:31:34 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:60064</guid><dc:creator>Jimmy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/60064.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=60064</wfw:commentRss><description>&lt;p&gt;Please disregard my earlier post if you&amp;#39;ve already read it. I didn&amp;#39;t notice you&amp;#39;re using IP 2003.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;To the best of my recollection, the JScript Date() constructor does not accept dates in ISO (yyyy-mm-dd) format.&amp;nbsp; You need to parse out the individual parts and call the Date constructor that takes three arguments:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Date(year, month, day)&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Once you have your date object and have added 7 days to it, you need to call getYear(), getMonth(), and getDay() to put the date back together as an ISO date string before you try to compare it to your other date value.&lt;/p&gt;</description></item><item><title>Re: Adding dates in infopath 2003</title><link>https://www.infopathdev.com:443/forums/thread/60063.aspx</link><pubDate>Thu, 07 Oct 2010 16:26:38 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:60063</guid><dc:creator>codediva</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/60063.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=60063</wfw:commentRss><description>&lt;p&gt;Thanks Patrick, &lt;/p&gt;
&lt;p&gt;&amp;nbsp;I took a look at the 2003 Meeting Agenda template and it looks like it uses comparison of dates, if date 1 &amp;lt; date 2.&amp;nbsp; But I need to add 7 days to my date 1 and then compare the new date value to date 2.&amp;nbsp; &lt;/p&gt;</description></item><item><title>Re: Adding dates in infopath 2003</title><link>https://www.infopathdev.com:443/forums/thread/59980.aspx</link><pubDate>Wed, 06 Oct 2010 06:57:25 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:59980</guid><dc:creator>Patrick Halstead</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/59980.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=59980</wfw:commentRss><description>&lt;p&gt;You can do this without code. Take a look at the Meeting Agenda (Detailed) form template available for free from Microsoft&amp;#39;s web site (Google: InfoPath form template Meeting Agenda). There should be a 2003 form available. This form also shipped as one of the 2003 out-of-box solutions - I know because my team built those for the launch of 2003. Anyway, Meeting Agenda has a special rule that checks preceding-sibling and verified that the agenda items don&amp;#39;t occur at overlapping times. You can use the same kind of logic to ensure a 7 day span. Using an xpath to add days to&amp;nbsp;your field and compare the dates against that is&amp;nbsp;relatively easy to do. No&amp;nbsp;coding required.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Adding dates in infopath 2003</title><link>https://www.infopathdev.com:443/forums/thread/59496.aspx</link><pubDate>Thu, 30 Sep 2010 21:19:48 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:59496</guid><dc:creator>codediva</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/59496.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=59496</wfw:commentRss><description>&lt;p&gt;I have a check out date and return date on my form.&amp;nbsp; When the user selects the check out date, the form validates that the checkout date entered is no more than 7 days from the current&amp;nbsp; date.&amp;nbsp; Got that piece working fine.&amp;nbsp; When the user selects the return date, I am trying to make the form validate that the return date is no more than 7 days from the selected check out date.&amp;nbsp; Here is what I thought would work: &lt;/p&gt;
&lt;p&gt;&amp;nbsp;function msoxd_my_returnDate::OnValidate(eventObj) &lt;/p&gt;
&lt;p&gt;{ &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var formOutDate = XDocument.DOM.selectSingleNode(&amp;quot;//my:outDate&amp;quot;); &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var formReturnDate = XDocument.DOM.selectSingleNode(&amp;quot;//my:returnDate&amp;quot;); &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (eventObj.Site.nodeTypedValue != &amp;quot;&amp;quot;) &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var myDate = new Date(formOutDate.text); &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; myDate.setDate(myDate.getDate()+7); &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if (myDate &amp;lt; formReturnDate.text) &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; XDocument.UI.Alert(&amp;quot;Return date can not be more than 7 days from the checkout date.&amp;quot;); &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item></channel></rss>