[CLOSED] ext:CalendarPanel: The problems about Month View set StartDay Property

  1. #1

    [CLOSED] ext:CalendarPanel: The problems about Month View set StartDay Property

    Hi,
    I set StartDay be 6 in MonthView tag, as follow this :
               <ext:CalendarPanel ID="CalendarPanel1" runat="server" Region="Center">
                    <CalendarStore ID="CalendarPanel1_CalendarStore" runat="server" IDMode="Static" />
                    <EventStore runat="server" ID="CalendarPanel1_EventStore" IDMode="Static" />
                    <MonthView ID="MonthView1" runat="server" ShowHeader="true" ShowWeekLinks="true"
                        ShowWeekNumbers="true" StartDay="6">
                    </MonthView>
                    <WeekView ID="WeekView1" runat="server">
                    </WeekView>
                    <Listeners>
                        <ViewChange Fn="CAP.viewChange" Scope="CAP" />
                        <RangeSelect Fn="CAP.rangeSelect" Scope="CAP" /> 
                    </Listeners>
                    <DirectEvents>
                        <EventClick OnEvent="CalendarPanel_EventClick">
                            <ExtraParams>
                                <ext:Parameter Name="Record" Mode="Raw" Value="Ext.encode(record.data)">
                                </ext:Parameter>
                            </ExtraParams>
                        </EventClick>
                        <DayClick OnEvent="CalendarPanel_DayClick">
                            <ExtraParams>
                                <ext:Parameter Name="StartDate" Mode="Raw" Value="dt">
                                </ext:Parameter>
                            </ExtraParams>
                        </DayClick>
                        <EventMove OnEvent="CalendarPanel_EventMove">
                            <ExtraParams>
                                <ext:Parameter Name="Record" Mode="Raw" Value="Ext.encode(record.data)">
                                </ext:Parameter>
                            </ExtraParams>
                        </EventMove>
                        <EventResize OnEvent="CalendarPanel_EventResize">
                            <ExtraParams>
                                <ext:Parameter Name="Record" Mode="Raw" Value="Ext.encode(record.data)">
                                </ext:Parameter>
                            </ExtraParams>
                        </EventResize>
                        <RangeSelect OnEvent="CalendarPanel_RangeSelect">
                            <EventMask ShowMask="true" />
                            <ExtraParams>
                                <ext:Parameter Name="StartDate" Mode="Raw" Value="dates.StartDate">
                                </ext:Parameter>
                                <ext:Parameter Name="EndDate" Mode="Raw" Value="dates.EndDate">
                                </ext:Parameter>
                            </ExtraParams>
                        </RangeSelect>
                    </DirectEvents>
                </ext:CalendarPanel>
    All events in last line(next month ) won't be displayed.
    Click image for larger version. 

Name:	carendar01.jpg 
Views:	34 
Size:	104.7 KB 
ID:	5905

    those events are also invisible in next month. (I am sure there are event data in database)
    Click image for larger version. 

Name:	carendar02.jpg 
Views:	31 
Size:	109.4 KB 
ID:	5906


    Any advice? TIA
    Last edited by Daniil; Mar 28, 2013 at 9:04 AM. Reason: [CLOSED]
  2. #2
    Hi @capbarbell,

    Thank you for the report.

    The fix has been committed to the SVN trunk. Please update and retest.
  3. #3

    SVN

    Quote Originally Posted by Daniil View Post
    Hi @capbarbell,

    Thank you for the report.

    The fix has been committed to the SVN trunk. Please update and retest.
    Hi Daniil,

    Where can I access SVN trunk?

    Regards,
  4. #4
    It is located here.
    http://svn.ext.net/premium/trunk/
  5. #5
    Quote Originally Posted by Daniil View Post
    Hi, Daniil

    I can't access the url via my forum account/password

    Please be advised

    Regards,
  6. #6
    The forum and SVN credentials are different.

    The SVN login/password should be emailed to you when you bought a Premium Support Subscription. Please check the inbox (and spam) folder.

    If you can't find, please send a request with your forum name to support@object.net.

    Anyway, here is a fix for now.

    Fix
    Ext.calendar.view.AbstractCalendar.override({
        setViewBounds: function (startDate) {
            var me = this,
                start = startDate || me.startDate,
                offset = start.getDay() - me.startDay,
                Dt = Ext.calendar.util.Date;
    
            if (offset < 0) {
                // if the offset is negative then some days will be in the previous week so add a week to the offset
                offset += 7;
            }
    
            switch (this.weekCount) {
                case 0:
                case 1:
                    me.viewStart = me.dayCount < 7 && !me.startDayIsStatic ?
                        start : Dt.add(start, {
                        days: -offset,
                        clearTime: true
                    });
                    me.viewEnd = Dt.add(me.viewStart, {
                        days: me.dayCount || 7,
                        seconds: -1
                    });
                    return;
    
                case -1:
                    // auto by month
                    start = Ext.Date.getFirstDateOfMonth(start);
                    offset = start.getDay() - me.startDay;
                    if (offset < 0) {
                        // if the offset is negative then some days will be in the previous week so add a week to the offset
                        offset += 7;
                    }
                    me.viewStart = Dt.add(start, {
                        days: -offset,
                        clearTime: true
                    });
    
                    // start from current month start, not view start:
                    var end = Dt.add(start, {
                        months: 1,
                        seconds: -1
                    });
    
                    // fill out to the end of the week:
                    offset = me.startDay;
                    if (offset > end.getDay()) {
                        // if the offset is larger than the end day index then the last row will be empty so skip it
                        offset -= 7;
                    }
    
                    me.viewEnd = Dt.add(end, {
                        days: 6 - end.getDay() + offset
                    });
                    return;
    
                default:
                    me.viewStart = Dt.add(start, {
                        days: -offset,
                        clearTime: true
                    });
                    me.viewEnd = Dt.add(me.viewStart, {
                        days: me.weekCount * 7,
                        seconds: -1
                    });
            }
        }
    });
  7. #7
    Hi Daniil,

    I found SVN account/password in my inbox. TIA

    BTW, I tried the code you posted and it worked fine. Thanks

    Regards,

Similar Threads

  1. Replies: 5
    Last Post: Jul 12, 2016, 2:28 AM
  2. Replies: 1
    Last Post: Jul 07, 2011, 8:34 PM
  3. [CLOSED] calendar month view
    By farisqadadeh in forum 1.x Legacy Premium Help
    Replies: 10
    Last Post: May 02, 2011, 3:42 PM
  4. Replies: 1
    Last Post: Dec 01, 2010, 1:20 PM
  5. Replies: 1
    Last Post: Dec 01, 2010, 1:18 PM

Tags for this Thread

Posting Permissions