My favorites | Sign in
Project Home Issues
New issue   Search
for
  Advanced search   Search tips   Subscriptions
Issue 65: Add an event
4 people starred this issue and may be notified of changes. Back to list
Status:  Done
Owner:  ----
Closed:  Jul 2009


Sign in to add a comment
 
Reported by zineb.me...@gmail.com, Jul 24, 2009
Hi.

Can you exaplin to me why when i add an event it's deleted after??
Look at my code

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Strict//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<style type='text/css'>

    body {
        margin-top: 40px;
        text-align: center;
        font-size: 14px;
        font-family: "Lucida Grande",Helvetica,Arial,Verdana,sans-serif;
        }

    #calendar {
        width: 900px;
        margin: 0 auto;
        }

</style>
<link rel='stylesheet' type='text/css'
href='../fullcalendar/fullcalendar.css' />
<script type='text/javascript' src='../jquery/jquery.js'></script>
<script type='text/javascript' src='../jquery/ui.core.js'></script>
<script type='text/javascript' src='../jquery/ui.draggable.js'></script>
<script type='text/javascript' src='../fullcalendar/fullcalendar.js'></script>
<script type='text/javascript'>

    $(document).ready(function() {
                 
        var d = new Date();
        var y = d.getFullYear();
        var m = d.getMonth();
        $('#calendar').fullCalendar({
            draggable: true,
            events: [
                {
                    id: 1,
                    title: "Long Event",
                    start: new Date(y, m, 6, 14, 0),
                    end: new Date(y, m, 11)
                },
                {
                    id: 2,
                    title: "Repeating Event",
                    start: new Date(y, m, 2)
                },
                {
                    id: 2,
                    title: "Repeating Event",
                    start: new Date(y, m, 9)
                },
                {
                    id: 3,
                    title: "Meeting",
                    start: new Date(y, m, 20, 9, 0)
                },
                {
                    id: 4,
                    title: "Click for Facebook",
                    start: new Date(y, m, 27, 16),
                    end: new Date(y, m, 29),
                    url: "http://facebook.com/"
                }
                        

            ],
                                 
            });
    });
function addTestEvents() {

        var d = new Date();
        var y = d.getFullYear();
        var m = d.getMonth()+1;
        if (m<10) m = '0' + m;
       
        $('#calendar').fullCalendar('addEvent', {
                id: 99,
                title: 'Some event',
                start: y+'-'+m+'-02'
        });
       
        $('#calendar').fullCalendar('addEvent', {
                id: 99,
                title: 'Some event',
                start: y+'-'+m+'-09'
        });
       
        $('#calendar').fullCalendar('addEvent', {
                id: 5,
                title: 'Birthday',
                start: y+'-'+m+'-20'
        });
       
}
</script>
</head>
<body>
<input type='button' value='add test events' onclick='addTestEvents()' /><br />
<INPUT type="checkbox" name="cal_aff" value="Service"
onclick='addTestEvents()' > Service
<INPUT type="checkbox" name="cal_aff" value="Prestation"> prestation
<p>Resultats</p>
<input type="text" name="test" id="test" value=""/>
<div id='calendar'></div>

</body>
</html>



So when i click on the input ...The events are added on the current month
but when i go to other months and return to the current month my event are
disapear!!!
Jul 26, 2009
#1 thgre...@gmail.com
Hey, since the change-month operation makes the calendar to reload (and refetch all
events from its source) you lose all the newly added events (because they are not in
the fetching source).
In my case, I send the data to a server. So when the calendar refetches the events
from its source (the server in my case) it gets the added events as well.
Try setting up a server.
Hope I helped.
Jul 26, 2009
#2 zineb.me...@gmail.com
Can you give me an example please thgreasi..

Thank you...
Jul 26, 2009
#3 zineb.me...@gmail.com
Hi.

Now  i can add events and when i change month other events doesn't dissapear..But the
problem are when i refresh the page my events disapear...
Look at this.
<html>
<head>
<style type='text/css'>

    body {
        margin-top: 40px;
        text-align: center;
        font-size: 14px;
        font-family: "Lucida Grande",Helvetica,Arial,Verdana,sans-serif;
        }

    #calendar {
        width: 900px;
        margin: 0 auto;
        }

</style>
<link rel='stylesheet' type='text/css' href='../fullcalendar/fullcalendar.css' />
<script type='text/javascript' src='../jquery/jquery.js'></script>
<script type='text/javascript' src='../jquery/ui.core.js'></script>
<script type='text/javascript' src='../jquery/ui.draggable.js'></script>
<script type='text/javascript' src='../fullcalendar/gcal.js'></script>

<script type='text/javascript' src='../fullcalendar/fullcalendar.js'></script>
<script type='text/javascript'>

    $(document).ready(function() {
                 
        var d = new Date();
        var y = d.getFullYear();
        var m = d.getMonth();
		
        var static_events =[
                {
                    id: 1,
                    title: "Long Event",
                    start: new Date(y, m, 6, 14, 0),
                    end: new Date(y, m, 11)
                },
                {
                    id: 2,
                    title: "Repeating Event",
                    start: new Date(y, m, 2)
                },
                {
                    id: 2,
                    title: "Repeating Event",
                    start: new Date(y, m, 9)
                },
                {
                    id: 3,
                    title: "Meeting",
                    start: new Date(y, m, 20, 9, 0)
                },
                {
                    id: 4,
                    title: "Click for Facebook",
                    start: new Date(y, m, 27, 16),
                    end: new Date(y, m, 29),
                    url: "http://facebook.com/"
                }
                        

            ];
			var myevents =[
                {
                    id: 30,
                    title: "Oh NANNANNANa",
                    start: new Date(y, m, 6, 14, 0),
                    end: new Date(y, m, 11)
                },
                {
                    id: 31,
                    title: "Parapararaa",
                    start: new Date(y, m, 6, 14, 0),
                    end: new Date(y, m, 11)
                },
                        

            ];
        $('#calendar').fullCalendar({
            draggable: true,
            eventSources:[static_events]
                                 
            });
			window.addStaticSource = function() {
                $('#calendar').fullCalendar('addEventSource', myevents);
        };
    });

       

</script>
</head>
<body>
<input type='button' value='add static event source' onclick='addStaticSource()' /><br />
<INPUT type="checkbox" name="cal_aff" value="Service"  > Service
<INPUT type="checkbox" name="cal_aff" value="Prestation"> prestation
<p>Resultats</p>
<input type="text" name="test" id="test" value=""/>
<div id='calendar'></div>

</body>
</html>


So here when i click on add event source ,2 events are added on my calendar,i change
the month and i return to the current one i find my 2 events .But when i refresh the
page i find all the events exept the 2 events...
Jul 28, 2009
#4 thgre...@gmail.com
An example can be found here:
https://code.google.com/p/fullcalendar/source/browse/#svn/tags/1.2/examples
It`s in the download package and it uses php on server.
You can obviously use any language for the server side (as java servlets or python or
perl or ...)
I personaly i`m using django (a python framework) but it should be as easy on any
language.

What you want to do (what i think) is not possible throw static web pages.
Even if you use cookies to save the events, it will be personal only and will be lost
if the cookies are deleted.
(I do not even know how to do the just above.)
Jul 31, 2009
Project Member #5 adamrs...@gmail.com
zineb, youll have to do what thgreasi says, use a server-side script + a database. some 
helper php scripts will be included in a future release.
Status: Done
Nov 6, 2009
#6 bbalasat...@gmail.com
Can I have an example of how to add the events to the calendar when we click on the
date we want to add the event. Also I need to add the custom fields to accept the
data. Also when the event is dragged, I need to update that in to the database. how
can I get the changed parameters and where I need to catch the parameters and update
to the database. Please advice.
Apr 26, 2010
#7 eshward...@gmail.com
I would like to write a click event for month such that when ever we click an event it goes to day view of that 
particular event. Is it possible ? can any body help me .
Apr 26, 2010
#8 eshward...@gmail.com
I would like to display more fields in day view. Right now it is displaying only title. I want to display
title, description, start date, location, end date. Can you help me?
Jul 6, 2010
#9 phanleminhthao
Hi all,

I have some problem when use fullcalendar with json.html .
When I change "'start' => "$year-$month-10"," to "'start' => "$year-$month-7"," in ensured json_events.php file, it didn't display in calendar. I don't know why it is.

Please help me for solving. Thank all so much.

Feb 22, 2011
#10 jorgec...@gmail.com
Hello,
hi i am adding an event noticing this code, my code is as follows:

var myEvents =
                 {
                     title: $ ("# input_Titulo. ") val (),
                     start: $ ("# input_date. ") val ()
                 };
              $ ('# calendar'). fullCalendar ('renderEvent' myEvents, true);

the event is added correctly in the Month view, but does not appear at the hearing in the week or day view, as I can do to make the event appear in all views?

Thanks and regards.
Apr 8, 2012
#11 paul.wol...@gmail.com
jorgec, every event needs to have an id
Sign in to add a comment

Powered by Google Project Hosting