Remove (child) from CGCalendar month view

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
baldguy
Forum Members
Forum Members
Posts: 34
Joined: Mon Jan 28, 2008 4:04 am

Remove (child) from CGCalendar month view

Post by baldguy »

CMSMS 2.2.10, CGCalendar 2.6, CGExtensions 1.62.3, CGSimpleSmarty 2.2.1

Using the "CGCalendar FullCalendar View Sample" layout to display a month grid-style calendar. For recurring events, the parent event is listed as:

My Event (repeats)

and the children of that event all display as:

My Event (Child)

Is there a way to remove the '(repeats)' and '(Child)' part of the event name?
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: Remove (child) from CGCalendar month view

Post by calguy1000 »

No, appending that text is hardcoded at this time.
you would have to use javascript to hide it. Perhaps the fullCalender eventRender method would do it.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
baldguy
Forum Members
Forum Members
Posts: 34
Joined: Mon Jan 28, 2008 4:04 am

Re: Remove (child) from CGCalendar month view

Post by baldguy »

Thanks, Calguy. I'll play around with it and see what I can figure out.
User avatar
AccentAvondschool
Forum Members
Forum Members
Posts: 28
Joined: Sun May 08, 2016 5:36 am
Location: Rotterdam NL

Re: Remove (child) from CGCalendar month view

Post by AccentAvondschool »

@baldguy

I'm still reviewing all new functions and while setting up the new calendar overview I've encountered the same problem.
The following works for us ...

Code: Select all

eventAfterRender: function(event, element, view) {
    var txt = $(element, 'fc-event-title').text().replace('(Child)', '').replace('(repeats)', '');
    //console.log(txt);
    $(element, 'fc-event-title').text(txt);
},
It does depend on which view you are in.
Regards,

Accent Avondonderwijs
René
User avatar
AccentAvondschool
Forum Members
Forum Members
Posts: 28
Joined: Sun May 08, 2016 5:36 am
Location: Rotterdam NL

Re: Remove (child) from CGCalendar month view

Post by AccentAvondschool »

The eventAfterRender was not really necessary but I could no longer edit the previous post. The following works for us in two views (table and list form):

Code: Select all

eventRender: function(event, element, view) {
    if (view.name == 'month') {
        var txt = $(element, 'fc-event-title').text().replace('(Child)', '').replace('(repeats)', '');
        $(element, 'fc-event-title').text(txt);
    }
    if (view.name == 'listMonth') {
        var txt = $(element, 'fc-event-title').html().replace('(Child)', '').replace('(repeats)', '');
        $(element, 'fc-event-title').html(txt);
    }
},
Regards,

Accent Avondonderwijs
René
Post Reply

Return to “Modules/Add-Ons”