Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7401517
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T04:29:23+00:00 2026-05-29T04:29:23+00:00

Hello , I am using arshaw fullcalendar v1.5.2 (only month view ) for property

  • 0

Hello,
I am using arshaw fullcalendar v1.5.2 (only month view ) for property booking website , its a great plugin but I stuck in few problem, I have seen similar issues on google code , but there is nothing clear really. :(, Please help me to solve these problems

Here is working demo and JS Code

What I have done so far

  • Fetched events data from two different json files below

    • json_events.php : this holds booking detail which is booked from front end by user; admin can not change any details of these type of events.

    • new_charges.php : this holds special charges events detail ,admin add/update delete the new charges for any future date(s) .

  • admin can view the details of any event when he click on an event

  • admin can add/edit and delete new events on calendar for future dates or range of dates, that will stored on new_charges.php

here is my issues

a) I want that only one event is allowed for a date(s).

b) Currently if user click on a day on which any booking event or special charges event is there, then it alerts that day is booked,
but after that it will show a prompt box to enter event title,

this is occured because I have used both dayClick and select methods

How do i stops further propagation if a day already have an event ?

c) suppose a day 15 january (wrapped by fc-day17 div) is booked ( I have applied a class booked for events ) and now when I go to next month and click on fc-day17 div, it also alert that day is booked whereas there is no booking
by examining the code i found that it still have the class booked for another months for the same divs

I think there is something missing during eventRender methods?

does `eventRender()`  method is called only once when initialize the calendar 
or each time when we go `prev` or `next` month?

d) I have changed background-color for special charges events during rendering events via json file, but when I delte that events, it does not change back the normal background and still say that day is booked.

how do I make default background of a date if I delete the events of that day??

e) how to hide all events related to previous months?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T04:29:29+00:00Added an answer on May 29, 2026 at 4:29 am
    // a) and b)
    // We dont need dayClick event, only select
    // I think you created calender something like this 
    // var calendar = $('#calendar').fullCalendar({ ... })
    
    select: function(start, end, allDay) {
        //debugger;
        var events = calendar.fullCalendar( 'clientEvents' );
        for (var i = 0; events.length > i ; i++){
            //If we have 1 day event
            if((events[i].end == null && (events[i].start.getTime() >= start.getTime() && events[i].start.getTime() <= end.getTime())) ||
            // If we have many days event 
            (events[i].end != null && ((events[i].start.getTime() >= start.getTime() && events[i].start.getTime() <= end.getTime()) || 
                (events[i].end.getTime() >= start.getTime() && events[i].start.getTime() <= end.getTime()) || 
                (events[i].start.getTime() <= start.getTime() && events[i].end.getTime() >= end.getTime())) 
            )){
                alert("Realy busy!!!");
                return;
            }
        }
        // If this time is not busy, for example, we promt to enter Event Title
        var title = prompt('Event Title:');
        if (title) {
           //............Adding event into calendar
        }
        calendar.fullCalendar('unselect');
    },
    // c) and d)
    // This is invoked when we navigate throw the month callender 
    eventAfterRender: function(event, element, view ){
        $(".booked").removeClass(".booked"); // Remove all booked class from element
        var elements = $(".fc-widget-content:not(.fc-other-month)").filter(function(){
            //We try to find day number witch corresponds to the event date
            return (event.end == null && $(this).find(".fc-day-number").text() == event.start.getDate()) //If we have 1 day event
                || (event.end != null && $(this).find(".fc-day-number").text() >= event.start.getDate() // If we have many day event
                &&  $(this).find(".fc-day-number").text() <= event.end.getDate())
        });
        elements.addClass("booked");
    
        // e)
        // Hide all events related to previous and next months
        // If we event ends in previous month or starts in next we dont show it!
        if(
            (event.end == null && (view.start.getMonth() != event.start.getMonth())) //If we have 1 day event
            || (event.end != null && (view.start.getMonth() > event.end.getMonth() // If we have many day event
            || view.start.getMonth() < event.start.getMonth())) 
    
        ){
            $(element).hide();
        }
    }
    

    EDIT This construction

    var elements = $(".fc-widget-content:not(.fc-other-month)").filter(function(){
        //We try to find day number witch corresponds to the event date
        return (event.end == null && $(this).find(".fc-day-number").text() == event.start.getDate()) //If we have 1 day event
            || (event.end != null && $(this).find(".fc-day-number").text() >= event.start.getDate() // If we have many day event
            &&  $(this).find(".fc-day-number").text() <= event.end.getDate())
    });
    

    meansthat we select days of current month (:not(.fc-other-month)) which satisfy the filter conditions (return true) : The days of month equal the days of events

    About your code as I said you must remove dayClick event, and your select event is:

    select: function (startDate, endDate, allDay, jsEvent) {
        // This is my addition //
            var events = calendar.fullCalendar( 'clientEvents' );
            for (var i = 0; events.length > i ; i++){
                //If we have 1 day event
                if((events[i].endDate == null && (events[i].start.getTime() >= startDate.getTime() && events[i].start.getTime() <= endDate.getTime())) ||
                // If we have many days event 
                (events[i].endDate != null && ((events[i].start.getTime() >= startDate.getTime() && events[i].start.getTime() <= endDate.getTime()) || 
                    (events[i].end.getTime() >= startDate.getTime() && events[i].start.getTime() <= endDate.getTime()) || 
                    (events[i].start.getTime() <= startDate.getTime() && events[i].end.getTime() >= endDate.getTime())) 
                )){
                    alert('Sorry this date is already taken');
                    return;
                }
            }
    
            // /This is my addition //      
        console.dir(jsEvent);
        if (liveDate > startDate) {
            alert('This date has been passed');
            return false;
        } else {
            var title = prompt('New Charges:');
            if (title) {
                calendar.fullCalendar('renderEvent', {
                            title: title,
                            start: startDate,
                            end: endDate,
                            allDay: allDay
                        }, false // make the event "unstick"
                        );
                        var startDateString = $.fullCalendar.formatDate(startDate, 'yyyy-MM-dd');
                        var endDateString = $.fullCalendar.formatDate(endDate, 'yyyy-MM-dd');
                        $.ajax({
                            type: 'POST',
                            url: './new_event.php?action=add',
                            data: {
                                startDate: startDateString,
                                endDate: endDateString,
                                eventTitle: title,
                                propID: propID
                            },
                            dateType: 'json',
                            success: function (resp) {
                                calendar.fullCalendar('refetchEvents');
                            }
                        });
                    } // end of inner if
                } // end of else
                calendar.fullCalendar('unselect');
    },
    

    About viewDisplay.
    Its is fired every time when we go to previous or next month, and it fired after eventAfterRender. If we use eventAfterRender and go to month without events we have no effect. The free cells stay booked.
    I offer analyse events of current month inviewDisplay:

    function viewCalDisplay(view) {
    
    //...................
    // Your code
    
                $(".booked").removeClass("booked"); // Remove all booked class from element
                var events = view.calendar.clientEvents(function(event){  
                    //we need only events of current month
                    return event.start.getMonth() == view.start.getMonth(); 
    
                } );
    
                for(i = 0; events.length > i; i++){
                    var event = events[i];
                    // We need only days of current month. We select <td> of calender table (by class .ui-widget-content)
                    var elements = $(".ui-widget-content:not(.fc-other-month)").filter(function(){
                        //We try to find day number witch corresponds to the event date
                        return (event.end == null && $(this).find(".fc-day-number").text() == event.start.getDate()) //If we have 1 day event
                            || (event.end != null && $(this).find(".fc-day-number").text() >= event.start.getDate() // If we have many day event
                            &&  $(this).find(".fc-day-number").text() <= event.end.getDate())
                    });
    
                    elements.addClass("booked"); //Only for this <td> 
                }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hello I'm using the fullcalendar jQuery plugin to create a calendar app. When I
I have a class: class MyClass(object): @property def myproperty(self): return 'hello' Using mox and
Hello i am using the latest version of artoolkit, and succesfully compiled simplevrml, but
hello i'm using this example http://lexandera.com/2009/01/extracting-html-from-a-webview/ to get the HTML from a webview. But
Hello I am using facebook graph api..and trying to display comments of each post..But
Hello iam using wordpress and i need to set permission for a plugin folder
Hello I am using maven2-xdoclet2-plugin to generate the hibernate mappings The config of xdoclet
Hello I am using jQuery cycle lite plugin (image rotator plugin) , and I
Hello I am using a tab bar application. I want to reload a view
Hello im using page nation which is amazing but now im trying to print

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.