Jump to content

Adjust calendar?


sicoobcooplivre

Recommended Posts

  • 1 month later...
15 hours ago, sicoobcooplivre said:

Can you help me with the doubt of this post?
I need to show only the days of the current month, so the calendar gets bigger, fitting more events to display.

Hello,

Yes, sorry. I seem to have lost the code that worked to get the result. I do not promise to do it quickly, but I will try to analyze it again.

Link to comment
Share on other sites

 

Try this approach:

MainForm.Script ->

Ext.calendar.view.Weeks.prototype.recalculate = function() 
{

    function getFullWeeksStartAndEndInMonth(activeStart, start, end) {
        var ceil = Math.ceil(end.getDate() / 7);

        if (activeStart.getTime() !== start.getTime()) {
            let delta = (start.getTime() - activeStart.getTime()) / (1000 * 60 * 60 * 24);
            ceil = 1;
            delta = Math.ceil((end.getDate() - Math.abs(delta - 7)) / 7);
            ceil = ceil + delta;
        }
        return ceil
    };

    var dateInfo = this.doRecalculate();
    let activeStart = new Date(dateInfo.active.start);
    let start = new Date(dateInfo.month.start);
    let end = new Date(dateInfo.month.end);

    dateInfo.requiredWeeks = getFullWeeksStartAndEndInMonth(activeStart, start, end);
    this.dateInfo = dateInfo;
    this.setSourceRange(dateInfo.visible);
}

 

Link to comment
Share on other sites

  • 2 months later...
  • 2 months later...

@Sherzod

Good morning!
It worked with Allday-true, thanks!

In the meantime, please clear one more doubt:
it is possible to put the start and end time in the event description, for example using the attachment that I put above, the event of the 16th, display like this:

10:00 am - 11:00 am Meeting-4

My user would like to see the start and end time right there in the summary description, is it possible?
Thanks!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...