ext:CalendarPanel DayView formating Time in portuguese

  1. #1

    ext:CalendarPanel DayView formating Time in portuguese

    I need format the Times in ext:CalendarPanel in DayView mode to portuguese format.

    I would also like to set the interval between the times (15 minutes, 1 hour), etc.

    If possible, I would also set the start time and end time of dayview mode.

    Suggestions?
  2. #2
    Hi,

    Quote Originally Posted by gefferson.librelato View Post
    I need format the Times in ext:CalendarPanel in DayView mode to portuguese format.
    You could set up the Locale="pt-PT" for an <ext:ResourceManager>.

    Exmaple
    <ext:ResourceManager runat="server" Locale="pt-PT" />

    Quote Originally Posted by gefferson.librelato View Post
    I would also like to set the interval between the times (15 minutes, 1 hour), etc.

    If possible, I would also set the start time and end time of dayview mode.
    Please keep one issue per one thread.
  3. #3
    Hi Daniil...

    I insert the code bellow, but keeps showing times in american format ... brazilian portuguese we use the notation military time ...

    <ext:ResourceManager ID="ResourceManager1" runat="server" Locale="pt-BR" />
    Click image for larger version. 

Name:	Ext Calendar Panel Times in american format.png 
Views:	162 
Size:	1.7 KB 
ID:	3682

    Is there any way to change this format for the times?

    Thanks for your attention, Daniil..
  4. #4
    Now the requirement is clear, thanks.

    There is no such built-in functionality to change a format, but it's possible to override it.

    See the comment in the JavaScript code.

    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.DayBodyTemplate.override({
                applyTemplate : function (o) {
                    this.today = new Date().clearTime();
                    this.dayCount = this.dayCount || 1;
            
                    var i, 
                        days = [],
                        dt = o.viewStart.clone(),
                        times;
                
                    for(i = 0; i < this.dayCount; i++) {
                        days[i] = dt.add(Date.DAY, i);
                    }
    
                    times = [];
                    dt = new Date().clearTime();
                    for(i = 0; i < 24; i++) {
                        times.push(dt.format('G')); //the default value is 'ga'.
                                                    //Change to a respective format, see the link below.
                        dt = dt.add(Date.HOUR, 1);
                    }
            
                    return Ext.calendar.DayBodyTemplate.superclass.applyTemplate.call(this, {
                        days     : days,
                        dayCount : days.length,
                        times    : times
                    });
                }
            });
        </script>
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
            <ext:Viewport runat="server" Layout="fit">
                <Items>
                    <ext:CalendarPanel ID="CalendarPanel1" runat="server">
                        <EventStore runat="server" />
                    </ext:CalendarPanel>
                </Items>
            </ext:Viewport>
        </form>
    </body>
    </html>
    See also
    http://docs.sencha.com/ext-js/3-4/#!/api/Date
  5. #5
    Daniil... thanks a lot...

    Working very wel. is exactly what I wanted.

    I need closed this Thread? How do I do this?
  6. #6
    Quote Originally Posted by gefferson.librelato View Post
    I need closed this Thread? How do I do this?
    I'm sure you've already saw the post below, but to clarify:
    http://forums.ext.net/showthread.php...ll=1#post72190
    Last edited by Daniil; Feb 09, 2012 at 8:32 AM.
  7. #7
    Here is the solution for Ext.NET v2:
    http://forums.ext.net/showthread.php...ll=1#post77977
  8. #8
    Please i want to convert my calendar to hijri.

    i wrote :
      CultureInfo arCul = new CultureInfo("ar-SA", false) { DateTimeFormat = { ShortDatePattern = "dd/MM/yyyy" } };
      HijriCalendar h = new System.Globalization.HijriCalendar();
      arCul.DateTimeFormat.Calendar = h;
      Thread.CurrentThread.CurrentCulture = arCul;
    but the calendar still in english (gregorian).

    Plus,

    I set locale="ar-SA" but the arabic is not supported .

    Any help!!!
    Last edited by bit9bug; Jan 25, 2013 at 1:48 PM.

Similar Threads

  1. Replies: 2
    Last Post: Mar 28, 2012, 1:39 PM
  2. Replies: 2
    Last Post: Mar 28, 2012, 1:32 PM
  3. Replies: 2
    Last Post: Jan 12, 2012, 11:30 AM
  4. [CLOSED] CalendarPanel: DayView Event Issue
    By csssi_coolite in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Jun 18, 2011, 2:03 AM
  5. Replies: 0
    Last Post: Oct 07, 2008, 9:56 AM

Tags for this Thread

Posting Permissions