<?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: Formatter: Date Problem </title>
	<link>http://www.trirand.com/blog/?page_id=393/help/formatter-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/help/formatter-date-problem/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>tucano on Formatter: Date Problem </title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/formatter-date-problem#p20514</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/formatter-date-problem#p20514</guid>
        	        	<description><![CDATA[<p>Ol&#225;,</p>
<p>estou tendo problemas referente ao formatter tamb&#233;m,</p>
<p>embora minha lista &#233; datatype:"local", estou passando pela mesma quest&#227;o.</p>
</p>
<p>eu tenho a inten&#231;&#227;o de formatar um campo do tipo data em d/m/Y com uma entrada Y-m-d, mas obtenho resultados absurdos</p>
<p><input type='button' class='sfcodeselect' name='sfselectit7177' value='Select Code' data-codeid='sfcode7177' /></p>
<div class='sfcode' id='sfcode7177'>{name:&#39;TESTANDO_DATA&#39;,index:&#39;TESTANDO_DATA&#39;, width:100, formatter:&#39;date&#39;, formatoptions:{srcformat:&#34;Y-m-d&#34;,newformat:&#34;d/m/Y&#34;}}</div>
<p>exemplo 1:<br />entrada: 2010-10-13<br />sa&#237;da formatada obtida: 02/04/2019</p>
<p>exemplo 2:<br />entrada: 2010-09-10<br />sa&#237;da formatada obtida: 02/03/2016</p>
<p>com finalidade de teste modifiquei a formata&#231;&#227;o desejada na sa&#237;da com inten&#231;&#227;o de apenas visualizar o m&#234;s e o ano (m/y), mas obtive resultados mais estranhos ainda</p>
<p><input type='button' class='sfcodeselect' name='sfselectit8439' value='Select Code' data-codeid='sfcode8439' /></p>
<div class='sfcode' id='sfcode8439'>{name:&#39;TESTANDO_DATA&#39;,index:&#39;TESTANDO_DATA&#39;, width:100, formatter:&#39;date&#39;,&#160;formatter:&#39;date&#39;, formatoptions:{srcformat:&#34;Y-m-d&#34;,newformat:&#34;m/Y&#34;}},</div>
<p>exemplo 1:<br />entrada: 2010-10-13<br />sa&#237;da formatada obtida: 06/2177</p>
<p>exemplo 2:<br />entrada: 2010-09-10<br />sa&#237;da formatada obtida: 06/2176</p>
<p>contudo, concluindo os testes percebi que deve ter algum bug neste processo, pois se eu n&#227;o tentar intervir na ordem de dia, m&#234;s e ano da referente data, o processo de formata&#231;&#227;o funciona devidamente correto (claro, para meu problema inicial n&#227;o resolve).</p>
<p><input type='button' class='sfcodeselect' name='sfselectit5352' value='Select Code' data-codeid='sfcode5352' /></p>
<div class='sfcode' id='sfcode5352'>{name:&#39;TESTANDO_DATA&#39;,index:&#39;TESTANDO_DATA&#39;, width:100, formatter:&#39;date&#39;,formatoptions:{srcformat:&#34;Y-m-d&#34;,newformat:&#34;Y/m/d&#34;}}</div>
<p>exemplo 1:<br />entrada: 2010-10-13<br />sa&#237;da formatada obtida: 2010/10/13</p>
<p>exemplo 2:<br />entrada: 2010-09-10<br />sa&#237;da formatada obtida:&#160;2010/09/10</p>
</p>
<p>Caso &#160;algu&#233;m tiver a solu&#231;&#227;o para essa quest&#227;o, desde j&#225; agrade&#231;o.</p>
<p>Fico tamb&#233;m a disposi&#231;&#227;o para qualquer eventual teste referente a esta quest&#227;o.</p>
</p>
<p>At&#233; mais!</p>
</p>
<p>atenciosamente,</p>
<p>Tucano</p>
</p>
<p>------------------------------------------------------------------------------------------</p>
<p>Mensagem traduzida do Portugu&#234;s-Brasil para o Ingl&#234;s pelo google translate</p>
<p>Message translated from Portuguese-Brazil to the English translation by google</p>
<p>------------------------------------------------------------------------------------------</p>
<p>Hello,<br />I&#39;m having trouble referring to the formatter also<br />although my list is datatype: "local", I am experiencing the same issue.</p>
<p>I intend to format a field of type date d / m / Y with an entry Ymd, but get absurd results</p>
<p><input type='button' class='sfcodeselect' name='sfselectit9681' value='Select Code' data-codeid='sfcode9681' /></p>
<div class='sfcode' id='sfcode9681'>{name:&#39;TESTANDO_DATA&#39;,index:&#39;TESTANDO_DATA&#39;, width:100, formatter:&#39;date&#39;, formatoptions:{srcformat:&#34;Y-m-d&#34;,newformat:&#34;d/m/Y&#34;}}</div>
<p>Example 1:<br />Login: 2010-10-13<br />formatted output achieved: 02/04/2019<br />Example 2:<br />Login: 2010-09-10<br />formatted output achieved: 02/03/2016</p>
<p>with the purpose of testing the modified desired output format with the intention of just display month and year (m / y), but getting even weirder results</p>
<p><input type='button' class='sfcodeselect' name='sfselectit3346' value='Select Code' data-codeid='sfcode3346' /></p>
<div class='sfcode' id='sfcode3346'>{name:&#39;TESTANDO_DATA&#39;,index:&#39;TESTANDO_DATA&#39;, width:100, formatter:&#39;date&#39;,&#160;formatoptions:{srcformat:&#34;Y-m-d&#34;,newformat:&#34;m/Y&#34;}}</div>
<p>Example 1:<br />Login: 2010-10-13<br />formatted output obtained: 06/2177<br />Example 2:<br />Login: 09/10/2010<br />formatted output obtained: 06/2176</p>
<p>however, ending the testing should have realized that a bug in this process, because if I did not try to intervene in the order of days, months and years regarding the date, the process of properly formatting works correctly (of course, for my initial problem does not solve).</p>
<p><input type='button' class='sfcodeselect' name='sfselectit1819' value='Select Code' data-codeid='sfcode1819' /></p>
<div class='sfcode' id='sfcode1819'>{name:&#39;TESTANDO_DATA&#39;,index:&#39;TESTANDO_DATA&#39;, width:100, formatter:&#39;date&#39;,formatoptions:{srcformat:&#34;Y-m-d&#34;,newformat:&#34;Y/m/d&#34;}}</div>
<p>Example 1:<br />Login: 2010-10-13<br />formatted output achieved: 2010/10/13<br />Example 2:<br />Login: 09/10/2010<br />formatted output achieved: 2010/09/10</p>
<p>If anyone has a solution to this question, I thank you.<br />I am also available for any possible test for this question.</p>
</p>
<p>Goodbye!</p>
<p>Sincerely,<br />Tucano&#160;</p></p>
]]></description>
        	        	<pubDate>Wed, 27 Oct 2010 16:00:55 +0300</pubDate>
        </item>
        <item>
        	<title>miked on Formatter: Date Problem </title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/formatter-date-problem#p20370</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/formatter-date-problem#p20370</guid>
        	        	<description><![CDATA[<p>FYI....I ended up using your suggestion to pass only numbers.&#160; I am formatting the date on the server side and passing a "m d Y" formated date.&#160; I had issues when trying to pass characters like "/" or "-" too.&#160; Just numbers and spaces works.</p>
<p>Thanks!</p>
]]></description>
        	        	<pubDate>Wed, 20 Oct 2010 00:37:33 +0300</pubDate>
        </item>
        <item>
        	<title>OlegK on Formatter: Date Problem </title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/formatter-date-problem#p19620</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/formatter-date-problem#p19620</guid>
        	        	<description><![CDATA[<p>Hi!</p>
<p>Could you post a code example with the test JSON data which could be used to reproduce your problem?</p>
<p>Regards<br />Oleg&#160;</p>
]]></description>
        	        	<pubDate>Thu, 09 Sep 2010 02:49:23 +0300</pubDate>
        </item>
        <item>
        	<title>miked on Formatter: Date Problem </title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/formatter-date-problem#p19616</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/formatter-date-problem#p19616</guid>
        	        	<description><![CDATA[<p>Thanks for the input Oleg, but the problem still exists.&#160; If I make the correction you note above and change the line to:</p>
</p>
<p>F: dateFormat.i18n.monthNames[n - 1],</p>
</p>
<p>It displays "Jan" instead of "January".&#160; But my problem is that the date is always displayed as Jan or January instead of the actual month.&#160; So all dates submitted, whether they are March or May or September or any date all get displayed as January.&#160; If I submit the date 04/22/2010, it will be displayed in the grid as (d-M-Y formatted) 22-Jan-2010.</p>
</p>
<p>The day and year are read correctly, but the month is always January (or Jan, or 1).&#160; It&#39;s like the month is not being read and it defaults to the first item on the list (Jan).</p></p>
]]></description>
        	        	<pubDate>Thu, 09 Sep 2010 01:17:53 +0300</pubDate>
        </item>
        <item>
        	<title>OlegK on Formatter: Date Problem </title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/formatter-date-problem#p19529</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/formatter-date-problem#p19529</guid>
        	        	<description><![CDATA[<p>I recommend you use only numbers as a month if you send data back from the server. You will transfer less data from the server and the data will be language independent.</p>
<p>Because of your main problem. It seems to me that in the line 170 of jquery.fmatter.js (I use 3.8 beta so line number could be a little other in another version of jqGrid) there are a bug. Currently the line is</p>
<p>&#160;&#160;&#160; F: dateFormat.i18n.monthNames[n - 1 <strong>+ 12</strong>],</p>
<p>It seems to me the correct line should be</p>
<p>&#160;&#160;&#160; F: dateFormat.i18n.monthNames[n - 1],</p>
<p>Format for "M" is correct, so if you use minimized version of jqGrid you can try with <strong>newformat:"d-M-Y H:i:s"</strong>.</p>
<p>Best regards</p>
<p>Oleg</p>
<p>P.S. I hope Tony will fix the bug.</p>
]]></description>
        	        	<pubDate>Sat, 04 Sep 2010 14:19:59 +0300</pubDate>
        </item>
        <item>
        	<title>miked on Formatter: Date Problem </title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/formatter-date-problem#p19526</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/formatter-date-problem#p19526</guid>
        	        	<description><![CDATA[<p>Hi,</p>
<p>I have a grid that uses json to get data from ColdFusion.&#160; I am having trouble formatting a date field.&#160; Here is my ColModel string:</p>
</p>
<p>{name:&#39;DISPLAYSTOP&#39;,index:&#39;displayStop&#39;, width:150, formatter:&#39;date&#39;, formatoptions:{srcformat:"F, d Y H:i:s",newformat:"d-F-Y H:i:s"}},</p>
</p>
<p>I can see (in Firebug) that the date field passed to the grid is this:&#160;<strong> March, 26 2010 23:59:00</strong></p>
<p>However, the display is this:&#160; <strong>26-January-2010 23:59:00</strong></p>
<p>In fact, all the months get displayed as January.&#160; The day, year, hour, minute, and seconds get read and displayed correctly, but the month is displayed as January for all records.&#160; I have tried all the PHP date codes (F,M,m,n) for months and tried without the comma, but nothing works.&#160;</p>
<p>If I use M instead of F in the newformat (newformat:&#39;d-M-Y H:i:s), all the months return as Jan.</p>
<p>If I remove&#160; <strong>formatter:&#39;date&#39;</strong> from the ColModel, it displays the same as the input: <strong>March, 26 2010 23:59:00</strong></p>
<p>Any ideas?</p>
<p>Thanks!</p>
]]></description>
        	        	<pubDate>Sat, 04 Sep 2010 02:21:38 +0300</pubDate>
        </item>
</channel>
</rss>