[CLOSED] ext:CalendarPanel: Time slots should be formated in Portuguese (military time format).

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    [CLOSED] ext:CalendarPanel: Time slots should be formated in Portuguese (military time format).

    Hi

    In CalendarPanel, Time slots should be formated in Portuguese (military time format).

    I set the 'Locale' property in ResourceManager as follow:
    <ext:ResourceManager ID="ResourceManager1" runat="server" Locale="pt-BR" />
    See highlighted 3 in picture bellow:

    Attachment 4020
    Last edited by Daniil; Mar 28, 2012 at 1:44 PM. Reason: [CLOSED]
  2. #2
    Hi,

    Again, needs to override the scripts. The Calendar is not the best in the localization aspect.

    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>
     
        <ext:ResourcePlaceHolder runat="server" Mode="ScriptFiles" />
    
        <script type="text/javascript">
            Ext.calendar.template.DayBody.override({
                applyTemplate : function(o){
                    this.today = Ext.calendar.util.Date.today();
                    this.dayCount = this.dayCount || 1;
            
                    var i = 0,
                        days = [],
                        dt = Ext.Date.clone(o.viewStart),
                        times = [];
                
                    for(; i<this.dayCount; i++){
                        days[i] = Ext.calendar.util.Date.add(dt, {days: i});
                    }
    
                    // use a fixed DST-safe date so times don't get skipped on DST boundaries
                    dt = Ext.Date.clearTime(new Date('5/26/1972'));
            
                    for(i=0; i<24; i++){
                        //times.push(Ext.Date.format(dt, 'ga'));
                        times.push(Ext.Date.format(dt, 'H:i'));
                        dt = Ext.calendar.util.Date.add(dt, {hours: 1});
                    }
            
                    return this.applyOut({
                        days: days,
                        dayCount: days.length,
                        times: times
                    }, []).join('');
                }
            });
        </script>
    </head>
    <body>
        <ext:ResourceManager runat="server" />
        <ext:Viewport runat="server" Layout="fit">
            <Items>
                <ext:CalendarPanel runat="server">
                    <EventStore runat="server" />
                </ext:CalendarPanel>
            </Items>
        </ext:Viewport>
    </body>
    </html>
  3. #3
    Hi Daniil....

    Works very fine... it was perfect...

    Thanks a lot.

Similar Threads

  1. ext:CalendarPanel DayView formating Time in portuguese
    By gefferson.librelato in forum 1.x Help
    Replies: 7
    Last Post: Jan 25, 2013, 12:04 PM
  2. [CLOSED] CalendarPanel: background color of time slots
    By supera in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Jun 18, 2012, 4:40 PM
  3. [CLOSED] ext:CalendarPanel: Event time is in English format
    By supera in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Mar 28, 2012, 7:28 PM
  4. Replies: 4
    Last Post: Apr 25, 2011, 8:35 AM
  5. Time Field Time Format Setting
    By Dinesh.T in forum 1.x Help
    Replies: 0
    Last Post: Aug 18, 2009, 3:21 AM

Posting Permissions