<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
    <title>Ext  Example </title>
    <meta http-equiv="content-type" content="text/html; charset=GB2312">
<link rel="stylesheet" type="text/css"  href="/example/extjs/resources/css/ext-all.css"/>
    <script type="text/javascript" src="/example/extjs/adapter/ext/ext-base-debug.js"></script>    
<script type="text/javascript" src="ext-all-debug.js"></script>
    <script type="text/javascript">
    Ext.onReady(function(){
        new Ext.FormPanel({ 
            url: 'movie-form-submit.php',
            renderTo: document.body,
            frame: true,
            title: 'Movie Information Form',
            width: 450,
            items: [{
                xtype: 'textfield',
                fieldLabel: 'Title',
                name: 'title'
            },{
                xtype: 'textfield',
                fieldLabel: 'Director',
                name: 'director'
            },{
                xtype: 'datefield',
                fieldLabel: 'Released',
                name: 'released'
            }]
        });
    });
   </script>
</head>
<body>    
    <div id='my_id' style='width:100%;height:100%;overflow:hidden;text-align:center;'></div>
</body>
</html>这个日期是格式是月/日/年,我想要的年/月/日,要在哪设置

解决方案 »

  1.   

    配置 format:'Y/m/d',<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    <html lang="en">
    <head>
        <title>Ext  Example </title>
        <meta http-equiv="content-type" content="text/html; charset=GB2312">
        <link rel="stylesheet" type="text/css"  href="/example/extjs/resources/css/ext-all.css"/>
        <script type="text/javascript" src="/example/extjs/adapter/ext/ext-base-debug.js"></script>    
        <script type="text/javascript" src="ext-all-debug.js"></script>
           <script type="text/javascript">
           Ext.onReady(function(){
            new Ext.FormPanel({ 
                url: 'movie-form-submit.php',
                renderTo: document.body,
                frame: true,
                title: 'Movie Information Form',
                width: 450,
                items: [{
                    xtype: 'textfield',
                    fieldLabel: 'Title',
                    name: 'title'
                },{
                    xtype: 'textfield',
                    fieldLabel: 'Director',
                    name: 'director'
                },{
                    xtype: 'datefield',
                    format:'Y/m/d',
                    fieldLabel: 'Released',
                    name: 'released'
                }]
            });
        });
       </script>
    </head>
    <body>    
        <div id='my_id' style='width:100%;height:100%;overflow:hidden;text-align:center;'></div>
    </body>
    </html>
      

  2.   

    楼主别看我头像是这个,就觉得很强。
    楼上这个方法是可以实现的,输出格式是 2009-10-16
    应该在后台也可以处理吧……我java刚开始学,也不是很懂,直接前台处理好了,后台接受
      

  3.   

    ext-lang-zh_CN.js 把这个导进去,内容如下:Ext.UpdateManager.defaults.indicatorText = '<div class="loading-indicator">加载中...</div>';if(Ext.View){
       Ext.View.prototype.emptyText = "";
    }if(Ext.grid.GridPanel){
       Ext.grid.GridPanel.prototype.ddText = "{0} 选择行";
    }if(Ext.TabPanelItem){
       Ext.TabPanelItem.prototype.closeText = "关闭";
    }if(Ext.form.Field){
       Ext.form.Field.prototype.invalidText = "输入值非法";
    }Date.monthNames = [
       "一月",
       "二月",
       "三月",
       "四月",
       "五月",
       "六月",
       "七月",
       "八月",
       "九月",
       "十月",
       "十一月",
       "十二月"
    ];Date.dayNames = [
       "日",
       "一",
       "二",
       "三",
       "四",
       "五",
       "六"
    ];if(Ext.MessageBox){
       Ext.MessageBox.buttonText = {
          ok     : "确定",
          cancel : "取消",
          yes    : "是",
          no     : "否"
       };
    }if(Ext.util.Format){
       Ext.util.Format.date = function(v, format){
          if(!v) return "";
          if(!(v instanceof Date)) v = new Date(Date.parse(v));
          return v.dateFormat(format || "y年m月d日");
       };
    }if(Ext.DatePicker){
       Ext.apply(Ext.DatePicker.prototype, {
          todayText         : "今天",
          minText           : "日期在最小日期之前",
          maxText           : "日期在最大日期之后",
          disabledDaysText  : "",
          disabledDatesText : "",
          monthNames        : Date.monthNames,
          dayNames          : Date.dayNames,
          nextText          : '下月 (Control+Right)',
          prevText          : '上月 (Control+Left)',
          monthYearText     : '选择一个月 (Control+Up/Down 来改变年)',
          todayTip          : "{0} (空格键选择)",
          format            : "y年m月d日",
          okText            : "确定",
          cancelText        : "取消"
       });
    }if(Ext.PagingToolbar){
       Ext.apply(Ext.PagingToolbar.prototype, {
          beforePageText : "页",
          afterPageText  : "页共 {0} 页",
          firstText      : "第一页",
          prevText       : "前一页",
          nextText       : "下一页",
          lastText       : "最后页",
          refreshText    : "刷新",
          displayMsg     : "显示 {0} - {1},共 {2} 条",
          emptyMsg       : '没有数据需要显示'
       });
    }if(Ext.form.TextField){
       Ext.apply(Ext.form.TextField.prototype, {
          minLengthText : "该输入项的最小长度是 {0}",
          maxLengthText : "该输入项的最大长度是 {0}",
          blankText     : "该输入项为必输项",
          regexText     : "",
          emptyText     : null
       });
    }if(Ext.form.NumberField){
       Ext.apply(Ext.form.NumberField.prototype, {
          minText : "该输入项的最小值是 {0}",
          maxText : "该输入项的最大值是 {0}",
          nanText : "{0} 不是有效数值"
       });
    }if(Ext.form.DateField){
       Ext.apply(Ext.form.DateField.prototype, {
          disabledDaysText  : "禁用",
          disabledDatesText : "禁用",
          minText           : "该输入项的日期必须在 {0} 之后",
          maxText           : "该输入项的日期必须在 {0} 之前",
          invalidText       : "{0} 是无效的日期 - 必须符合格式: {1}",
          format            : "y年m月d日"
       });
    }if(Ext.form.ComboBox){
       Ext.apply(Ext.form.ComboBox.prototype, {
          loadingText       : "加载...",
          valueNotFoundText : undefined
       });
    }if(Ext.form.VTypes){
       Ext.apply(Ext.form.VTypes, {
          emailText    : '该输入项必须是电子邮件地址,格式如: "[email protected]"',
          urlText      : '该输入项必须是URL地址,格式如: "http:/'+'/www.domain.com"',
          alphaText    : '该输入项只能包含字符和_',
          alphanumText : '该输入项只能包含字符,数字和_'
       });
    }if(Ext.grid.GridView){
       Ext.apply(Ext.grid.GridView.prototype, {
          sortAscText  : "正序",
          sortDescText : "逆序",
          lockText     : "锁列",
          unlockText   : "解锁列",
          columnsText  : "列"
       });
    }if(Ext.grid.PropertyColumnModel){
       Ext.apply(Ext.grid.PropertyColumnModel.prototype, {
          nameText   : "名称",
          valueText  : "值",
          dateFormat : "y年m月d日"
       });
    }if(Ext.layout.BorderLayout && Ext.layout.BorderLayout.SplitRegion){
       Ext.apply(Ext.layout.BorderLayout.SplitRegion.prototype, {
          splitTip            : "拖动来改变尺寸.",
          collapsibleSplitTip : "拖动来改变尺寸. 双击隐藏."
       });
    }
      

  4.   


    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    <html lang="en">
    <head>
        <title>Ext  Example </title>
        <meta http-equiv="content-type" content="text/html; charset=GB2312">
    <link rel="stylesheet" type="text/css"  href="/example/extjs/resources/css/ext-all.css"/>
        <script type="text/javascript" src="/example/extjs/adapter/ext/ext-base-debug.js"></script>    
    <script type="text/javascript" src="ext-all-debug.js"></script>
        <script type="text/javascript">
    </script>
       <head>
        <title>Ext  Example </title>
        <meta http-equiv="content-type" content="text/html; charset=GB2312">
        <link rel="stylesheet" type="text/css"  href="/example/extjs/resources/css/ext-all.css"/>
        
    <script type="text/javascript" src="/example/extjs/adapter/ext/ext-base-debug.js"></script>
    <script type="text/javascript" src="ext-lang-zh_CN.js"></script>
        <script type="text/javascript" src="ext-all-debug.js"></script>
           <script type="text/javascript">
           Ext.onReady(function(){
            new Ext.FormPanel({ 
                url: 'movie-form-submit.php',
                renderTo: document.body,
                frame: true,
                title: 'Movie Information Form',
                width: 450,
                items: [{
                    xtype: 'textfield',
                    fieldLabel: 'Title',
                    name: 'title'
                },{
                    xtype: 'textfield',
                    fieldLabel: 'Director',
                    name: 'director'
                },{
                    xtype: 'datefield',
                    fieldLabel: 'Released',
    format :'Y-m-d',
                    name: 'released'
                }]
            });
        });
       </script>
    </head>
    <body>    
        <div id='my_id' style='width:100%;height:100%;overflow:hidden;text-align:center;'></div>
    </body>
    </html>   </script>
    </head>
    <body>    
        <div id='my_id' style='width:100%;height:100%;overflow:hidden;text-align:center;'></div>
    </body>
    </html>
    还报Ext.UpdateManager is undefined
    ext-lang-zh_CN.js()ext-lang-zh_CN.js (第 2 行)
    [Break on this error] Ext.UpdateManager.defaults.indicatorText...s="loading-indicator">加载中... </div>'; \r\n
    ext-lang-zh_CN.js 是6楼兄弟的代码
    为什么还报这个错