Package: cone.calendar
This package provides a calendar integration in to cone.app.
It utilizes jQuery Fullcalendar
(https://github.com/fullcalendar/fullcalendar).Currently, tag 3.1.0 is included. See
(https://github.com/fullcalendar/fullcalendar/releases).Calendar WidgetThe calendar widget integration is done viacone.calendar.browser.CalendarTilewhich is registered by namecalendar.The overall calendar configuration is done via model properties.fromcone.app.modelimportBaseNodefromcone.app.modelimportPropertiesclassMyCalendar(BaseNode):@propertydefproperties(self):props=Properties()props.default_content_tile='calendar'props.calendar_header={'left':'month,agendaWeek,agendaDay','center':'title','right':'today prev,next'}returnpropsFor a full list of available calendar options readcone.calendar.browser.CalendarTiledocumentation.Calendar EventsIn order to display events in the calendar, one or more event data sources
must be provided.Concrete event data implementation must derive fromcone.calendar.browser.CalendarEventsand provideeventsfunction.The default event data source is expected as JSON view registered by namecalendar_eventsfor a dedictaed model context.fromcone.calendar.browserimportCalendarEventsfromdatetimeimportdatetimefrompyramid.viewimportview_configimportuuid@view_config(name='calendar_events',context=MyCalendar,accept='application/json',renderer='json',permission='view')classMyEvents(CalendarEvents):defevents(self,start,end):events=[{'id':uuid.uuid4(),'title':'Title','start':datetime(2020,4,29,17,40),'end':datetime(2020,4,29,18,0),}]returneventsFor a full list of available event options readcone.calendar.browser.CalendarEventsdocumentation.Multiple event data sources are defined via model properties.classMyCalendar(BaseNode):@propertydefproperties(self):props=Properties()props.calendar_sources=[{'events':'event_data_1','color':'green'},{'events':'event_data_2','color':'red'}]returnpropsFor a full list of available event source options readcone.calendar.browser.CalendarTiledocumentation.LocalesThe calendar locale can be set viacalendar_localeon model properties.classMyCalendar(BaseNode):@propertydefproperties(self):props=Properties()props.calendar_locale='de'returnpropsDefault calendar locale isen. The desired locales must be delivered to
the browser in order to work correctly. Locales to deliver are defined in the
application ini config as comma separated list of locale names.cone.calendar.locales=de,frFor a complete list of available locales seebrowser/static/fullcalendar/localesfolder of this package.ContributorsRobert NiederreiterJohannes RaggamChanges0.3 (2022-10-06)Modernize JavaScript.
[rnix]0.2 (2020-07-09)Addshow_contextmenutoCalendarTile. Defaults toFalse.
[rnix]Also check for action length when handling actions dropdown in JS.
[rnix]0.1 (2020-05-30)Initial.
[rnix, thet]LicenseCopyright (c) 2017-2021, BlueDynamics Alliance, Austria
Copyright (c) 2021, Cone Contributors
All rights reserved.Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.