[CLOSED] {addtime:date('Y-m-d')} not correct

  1. #1

    [CLOSED] {addtime:date('Y-m-d')} not correct

    in database

    in model
    public partial class QizArticle{
    ...
    public System.DateTime addtime { get; set; }
    }
    in page
     <Model>
            <ext:Model ID="Model1" runat="server">
                   <Fields> 
    ...
                      <ext:ModelField Name="addtime"></ext:ModelField>
             </ext:Model>
    ...
     <Tpl ID="Tpl1" runat="server">
                                <Html>
                                    <tpl for=".">
                                <li><span class="hdsoso_col">【<a href="qiz_col.aspx?cid={colid}">{colname}</a>】</span><span class="data">{addtime:date('Y-m-d')}</span><a class="infolist" title="{title}" href="qiz_art.aspx?aid={id}" target="_blank">{title}</a></li> 
                            </tpl>
                                </Html>
       </Tpl>
    show on page :


    IS IT a bug?
    Attached Thumbnails Click image for larger version. 

Name:	QQ??20140701082405.png 
Views:	116 
Size:	801 Bytes 
ID:	13171   Click image for larger version. 

Name:	QQ??20140701083029.png 
Views:	115 
Size:	3.2 KB 
ID:	13181  
    Last edited by Daniil; Jul 08, 2014 at 5:23 AM. Reason: [CLOSED]
  2. #2
    Hi @hdsoso,

    The Tpl's Html is rendered to client without any modifications.

    So, 'Y-m-d' appears on client as it is. But it is a C# date format string.

    On client you should use an ExtJS date format string.
    http://docs.sencha.com/extjs/4.2.1/#!/api/Ext.Date

Similar Threads

  1. [2.3]GridPanel ColumnMove can not get correct index
    By kevinnet37 in forum 2.x Help
    Replies: 4
    Last Post: Nov 26, 2013, 12:39 AM
  2. Replies: 4
    Last Post: Nov 21, 2012, 8:09 PM
  3. [CLOSED] What is the correct syntax for this?
    By jmcantrell in forum 1.x Legacy Premium Help
    Replies: 21
    Last Post: Jul 10, 2012, 9:59 PM
  4. [CLOSED] GridPanel: correct way to get the row number
    By asztern in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Sep 09, 2010, 11:48 AM
  5. [CLOSED] [0.8.2] Date Range - correct month does not open
    By anup in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Apr 12, 2010, 11:17 AM

Posting Permissions