[CLOSED] Quick Question: Is it Possible to change the Date Format of the Date Fields in the Edit Event Window?

  1. #1

    [CLOSED] Quick Question: Is it Possible to change the Date Format of the Date Fields in the Edit Event Window?

    Hello

    I wanted to know if it was possible to change the date format of the When and To datefields? I think the format is currently set to "MM/dd/yyyy", I am hoping I can change it to "dd/MM/yyyy".

    Thanks in advance
    Last edited by Daniil; Jun 30, 2011 at 3:48 PM. Reason: [CLOSED]
  2. #2
    Hi,

    Please see the Render listener of EventEditWindow.

    Example

    <%@ Page Language="C#" %>
      
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"     
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Ext.Net Example</title>
        <script type="text/javascript">
            var CompanyX = {
                getWindow : function () {
                    return CompanyX.EventEditWindow1;
                },
                dayClick : function (cal, dt, allDay, el) {
                    this.record.show.call(this, cal, { StartDate: dt, IsAllDay: allDay }, el);
                },
                record : {
                    show : function (cal, rec, el) {
                        CompanyX.getWindow().show(rec, el);
                    }
                }
            };     
        </script>
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" Namespace="CompanyX" />
            <ext:Viewport runat="server" Layout="fit">
                <Items>
                    <ext:CalendarPanel runat="server" Height="500">
                        <EventStore runat="server" />
                        <GroupStore ID="GroupStore1" runat="server">
                            <Groups>
                                <ext:Group CalendarId="1" Title="Home" />
                                <ext:Group CalendarId="2" Title="Work" />
                                <ext:Group CalendarId="3" Title="School" />
                                <ext:Group CalendarId="4" Title="Other" />
                            </Groups>
                        </GroupStore>
                        <Listeners>
                            <DayClick Fn="CompanyX.dayClick" Scope="CompanyX" />
                        </Listeners>
                    </ext:CalendarPanel>
                </Items>
            </ext:Viewport>
            <ext:EventEditWindow 
                ID="EventEditWindow1" 
                runat="server" 
                Hidden="true" 
                GroupStoreID="GroupStore1">
                <Listeners>
                    <Render Handler="this.get(0).get(1).on('render', function () {
                                        this.startDate.format = 'd/m/Y';
                                        this.endDate.format = 'd/m/Y';
                                     });" />
                </Listeners>
            </ext:EventEditWindow>
        </form>
    </body>
    </html>
    See also
    http://forums.ext.net/showthread.php...ll=1#post57507
  3. #3
    That's perfect, just what I needed.

    Another quick question, how do you change the date formats for the Edit Event Form? The form that appears when you click "Edit Details" on the Edit Event Window?
  4. #4
    Please set up this CalendarPanel's Render listener:
    <Render Handler="var form = this.get(this.id + '-edit');
                     form.dateRangeField.on('render', function () {
                         this.startDate.format = 'd/m/Y';
                         this.endDate.format = 'd/m/Y';
                     });" />
  5. #5
    Perfect. Thank you again Daniil.

Similar Threads

  1. Replies: 3
    Last Post: May 09, 2012, 4:28 PM
  2. Replies: 1
    Last Post: Apr 13, 2012, 1:52 PM
  3. Replies: 0
    Last Post: Feb 04, 2012, 8:05 PM
  4. date format for all date fields in grid?
    By marcmvc in forum 1.x Help
    Replies: 0
    Last Post: Dec 01, 2009, 3:41 PM
  5. Can't change date format in grid
    By dbassett74 in forum 1.x Help
    Replies: 2
    Last Post: Apr 20, 2009, 1:15 PM

Tags for this Thread

Posting Permissions