Fullcalendar v4 and web2py

84 views
Skip to first unread message

Andrea Fae'

unread,
Mar 15, 2020, 1:46:17 PM3/15/20
to web2py-users
Anyone have any eocumentation with a examples about using Fullcalendar.io v4 javascript calendar with web2py?
thank you 

António Ramos

unread,
Mar 16, 2020, 5:14:16 AM3/16/20
to web...@googlegroups.com

{{response.files.append(URL(r=request,c='static/js',f='fullcalendar.min.js'))}}
{{response.files.append(URL(r=request,c='static/css',f='fullcalendar.min.css'))}}
{{extend 'layout.html'}}

<style>
.myclass{
    background-color: white;

}
#calendar .fc-agenda-axis, #calendar .fc-widget-header {
  background-color: #C2E6FF;
  border-color: #AED0EA;
  font-weight: normal;
  font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
  
  border-radius: 3px ;
}
#calendar .fc-event {
  box-shadow: 2px 2px 2px #706868;

}
.fc-today {
   background-color: #C2E6FF;
}
.fc-day-number {
    font-size: 14px;
}
.fc-content{
    text-align:right ;
    cursor:pointer;
}
.fc h2 {
   font-size: 20px;
}
.fc-scroller {
   overflow-y: hidden !important;
}
</style>
<script type='text/javascript'>

    $(document).ready(function() {
        
        var date = new Date();
        var d = date.getDate();
        var m = date.getMonth();
        var y = date.getFullYear();

        $('#calendar').fullCalendar({
firstDay:1,
displayEventTime:true,
            monthNames: ["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro" ],
            monthNamesShort: ['Jan','Fev','Mar','Abr','Mai','Jun','Jul','Ago','Set','Out','Nov','Dez'],
   dayNames: [ 'Domingo', 'Segunda', 'Terça', 'Quarta', 'Quinta', 'Sexta', 'Sábado'],
   dayNamesShort: ['Dom','Seg','Ter','Qua','Qui','Sex','Sáb'],
   buttonText: {
    today: 'hoje',
    month: 'mês',
    week: 'semana',
    day: 'dia'
   },
                        header:{
                  left: 'prev,next today',
                center: 'title',
                right: 'month,basicWeek,basicDay',

              
            },
            eventClick: function(info) {
    alert('Event: ' + info.event.title);
    alert('Coordinates: ' + info.jsEvent.pageX + ',' + info.jsEvent.pageY);
    alert('View: ' + info.view.type);

    // change the border color just for fun
    info.el.style.borderColor = 'red';
  },
  dayClick: function(datejsEventview) {
    $("#inicio").val(date.format()+"T09:00");
    $("#fim").val(date.format()+"T18:00");

},
            editable: false,
            defaultView:'month',
            displayEventTime: true,
            displayEventEnd:true,
                          eventClick: function(event) {
                            console.log(event);
                    if (event.url) {
                        window.open(event.url, "_blank");
                        return false;
                    }
                },
                height: "auto",
            events: [
            {{for task in ret:}}
              
               {{color='#f00'}}

                {
                    {{temp=db.auth_user(id=task["person"])}}
                    title: '{{=temp["nick"]}}\n   </b><br>{{=task["description"]}}',
                 
                 
                    color  : '{{=color}}',
                    textColor:"#FFF",
                    start:'{{=task["eventstart"]}}',
                    end: '{{=task["eventend"]}}',    




                },
            {{pass}}            
            ],
            eventRender: function( eventelementview ) {
        var title = element.find('.fc-title, .fc-list-item-title');          
        title.html(title.text());
},
        });
        
    });
</script>
<br>

<div> {{=form}}</div>
<div id='calendar' class="myclass"></div>



Em dom., 15 de mar. de 2020 às 17:46, Andrea Fae' <and...@gmail.com> escreveu:
Anyone have any eocumentation with a examples about using Fullcalendar.io v4 javascript calendar with web2py?
thank you 

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/113d00b6-37b0-4bcc-8185-4863be823ae4%40googlegroups.com.

Andrea Fae'

unread,
Mar 22, 2020, 12:46:51 PM3/22/20
to web2py-users
thank you. Do you have any guide? Or there is only web site documentation? I need to upgrade from version 3...
To unsubscribe from this group and stop receiving emails from it, send an email to web...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages