[CLOSED] CalendarPanel Remove time from event view

  1. #1

    [CLOSED] CalendarPanel Remove time from event view

    how can I take off the time that is shown in the event viewer?

    Click image for larger version. 

Name:	eventTime.png 
Views:	162 
Size:	16.4 KB 
ID:	3962
    Last edited by Daniil; Mar 23, 2012 at 8:22 AM. Reason: [CLOSED]
  2. #2
    Hi,

    There is no built-in functionality to change the format.

    You should override a respective template. I suggest to look into the Calendar sources to determine what Template you should override.

    Here are some examples:
    http://forums.ext.net/showthread.php...ll=1#post72195
    http://forums.ext.net/showthread.php?17250

    Not exactly what you need, but should help you to start.
  3. #3
    Thanks Daniil,
    I'll study this and when I finish I post the solution here.
  4. #4
    Hi Daniil,

    I'm using the example at second link (http://forums.ext.net/showthread.php?17250
    )

    But I´m not able to change the text in the hour (12:00am).
    Where I can find more documentation about the Ext.calendar.BoxLayoutTemplate.override and the parameters I have to send or if you can help me. I´ll appreciate

    Thanks again.
  5. #5
    Quote Originally Posted by Marcelo View Post
    Where I can find more documentation about the Ext.calendar.BoxLayoutTemplate.override and the parameters I have to send or if you can help me. I´ll appreciate
    The Calendar docs
    http://ext.ensible.com/deploy/1.0.2/docs/
    and the Calendar sources at your service.
  6. #6
    You should override the getTemplateEventData of MonthView.

    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.MonthView.override({
                getTemplateEventData: function(evt) {
                    var M = Ext.calendar.EventMappings,
                    selector = this.getEventSelectorCls(evt[M.EventId.name]),
                    title = evt[M.Title.name];
    
                    return Ext.applyIf({
                        _selectorCls: selector,
                        _colorCls: 'ext-color-' + (evt[M.CalendarId.name] ?
                        evt[M.CalendarId.name] : 'default') + (evt._renderAsAllDay ? '-ad': ''),
                        _elId: selector + '-' + evt._weekIndex,
                        _isRecurring: evt.Recurrence && evt.Recurrence != '',
                        _isReminder: evt[M.Reminder.name] && evt[M.Reminder.name] != '',
                        //original: Title: (evt[M.IsAllDay.name] ? '': evt[M.StartDate.name].format('g:ia ')) + (!title || title.length == 0 ? '(No title)': title)
                        Title: (evt[M.IsAllDay.name] ? '': (!title || title.length == 0 ? '(No title)': title))
                    },
                    evt);
                }
            });
        </script>
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
            <ext:Viewport runat="server" Layout="FitLayout">
                <Items>
                    <ext:CalendarPanel ID="CalendarPanel1" runat="server">
                        <EventStore runat="server">
                            <Events>
                                <ext:Event 
                                    Title="My event" 
                                    StartDate="2012/3/15" 
                                    EndDate="2012/3/16" 
                                    CalendarId="1" />
                            </Events>
                        </EventStore>
                    </ext:CalendarPanel>
                </Items>
            </ext:Viewport>
        </form>
    </body>
    </html>
  7. #7
    Thanks again Dannil,

    For example and link.

    When I go to Russia, I'll pay for the beer :)
  8. #8
    You are welcome!:)
  9. #9
    I forgot. Please mark as solved :)
  10. #10
    Here is how to override it in Ext.NET v2:
    http://forums.ext.net/showthread.php?18093

Similar Threads

  1. Replies: 1
    Last Post: May 02, 2012, 2:40 PM
  2. [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
  3. Replies: 2
    Last Post: Mar 28, 2012, 1:39 PM
  4. [CLOSED] CalendarPanel: Is it possible to set the height for the time row?
    By csssi_coolite in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: May 28, 2011, 1:34 PM
  5. Replies: 4
    Last Post: Apr 25, 2011, 8:35 AM

Tags for this Thread

Posting Permissions