We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28042 ☆ A M B ☆
    • 24,524 Posts
    This may be helpful to those creating CMPs with a grid that displays/edits a date field.

    This is a simple modification of the Doodles grid for handling a date field. It will display and save the date in standard ISO format of year-month-date. Note the "renderer" and "editor" fields.

    header: _('coupons.valid_from')
                ,dataIndex: 'valid_from'
                ,sortable: true
                ,width: 50
                ,renderer : Ext.util.Format.dateRenderer('Y-m-d')
                ,editor: new Ext.form.DateField({
                    format: 'Y-m-d'
                })
    [ed. note: sottwell last edited this post 14 years, 7 months ago.]
      Studying MODX in the desert - http://sottwell.com
      Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
      Join the Slack Community - http://modx.org
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Well, learn something new every day! It's even easier, just use "datefield" as the editor's xtype value:

                 header: _('coupons.valid_from')
                  ,dataIndex: 'valid_from'
                  ,sortable: true
                  ,width: 50
                  ,renderer : Ext.util.Format.dateRenderer('Y-m-d')
                  ,editor: { xtype: 'datefield' }
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org