<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
	<title>jQuery Grid Plugin - jqGrid - Topic: date problem</title>
	<link>http://www.trirand.com/blog/?page_id=393/bugs/date-problem</link>
	<description><![CDATA[Grid plugin]]></description>
	<generator>Simple:Press Version 5.7.5.3</generator>
	<atom:link href="http://www.trirand.com/blog/?page_id=393/bugs/date-problem/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>tony on date problem</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/date-problem#p30281</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/date-problem#p30281</guid>
        	        	<description><![CDATA[<p>Hello,</p>
</p>
<p>This is old question and sorry that it is not documented well.</p>
<p>Set&#160; reformatAfterEdit to true in the date field in colmodel like this:</p>
<p><input type='button' class='sfcodeselect' name='sfselectit1764' value='Select Code' data-codeid='sfcode1764' /></p>
<div class='sfcode' id='sfcode1764'>
<p>{</p>
<p>&#160;&#160; name:&#39;invdate&#39;,</p>
<p>...</p>
<p>&#160;&#160; formatter: &#39;date&#39;,</p>
<p>&#160;&#160; formatoptions: {</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160; srcformat:&#39;Y-m-d&#39;,</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160; newformat: &#39;d/m/Y&#39;,</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160; reformatAfterEdit : true</p>
<p>&#160;&#160; }</p>
<p>}</p>
</div>
<p>Regards</p>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow: hidden;">&#160;</div>
]]></description>
        	        	<pubDate>Mon, 24 Feb 2014 17:35:59 +0200</pubDate>
        </item>
        <item>
        	<title>kgeerts on date problem</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/date-problem#p30257</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/date-problem#p30257</guid>
        	        	<description><![CDATA[<p>Hi,</p>
</p>
<p>I think I found an error in the way jqGrid is handling dates.</p>
<p>I have normal grid set up with the demogrid grid and date &#160;like this</p>
<p>{name:&#39;invdate&#39;,index:&#39;invdate&#39;, width:80,editable:true,editoptions:{size:10}, formatter: &#39;date&#39;, formatoptions: { srcformat:&#39;Y-m-d&#39;, newformat: &#39;d/m/Y&#39;}}, &#160;The build of my invoice is ok . BTW ...the date is saved in database like 2014-02-18 but then showed as it should be 18/02/2014 . &#160;I then use the navGrid option to fill in a new date .</p>
<p>In the before Show form I default a date like this</p>
</p>
<p>function beforeShowForm(formId)</p>
<p>var today = new Date();</p>
<p>var dd=today.getDate();</p>
<p>var mm= totday.getMonth()+1;</p>
<p>var yyyy=today.getFullYear();</p>
<p>if (dd&#60;10){</p>
<p><span style="white-space: pre;"> </span>dd=&#39;0"+dd;}</p>
<p>if (mm&#60;10){</p>
<p><span style="white-space: pre;"> </span>mm=&#39;0&#39;+mm;}</p>
<p>today = dd+&#39;/&#39;+mm+&#39;/&#39;+yyyy;</p>
<p>$(#invdate",formId).val(today);</p>
</p>
<p>this gives me todays value into the input screen .</p>
<p>In the data send via json it goes in the form 18/02/2014 which is so far so good.</p>
<p>(naturally I convert it to the used format 2014-02-18 before entering in the database .</p>
<p>When I auto redraw the grid things go ok .</p>
<p>BUT&#160;</p>
<p>when I don&#39;t do anything with the postdata(and leave it to the default way) the entered data is wrong in the grid .</p>
<p>I have now (as a work arround ) altered the postdata back into the form 2004-02-18 (in the aftersubmit procedure) before leaving it up to the grid logic to display the new row . This goes ok but without &#39;aftersave&#39; conversion its wrong .</p>
</p>
<p>Thanks</p>
]]></description>
        	        	<pubDate>Tue, 18 Feb 2014 15:43:41 +0200</pubDate>
        </item>
</channel>
</rss>