How add event in calendar?

Introduction

Hello, I am a french student in trainee at an association, and I must create and manage a Nextcloud server.

My client want to add event in calendar with a button and a date retrieve by a input type date. So we want add a event with PHP code.

Problem

I can’t find how we can make it, do you have link about this ?

there should be a ‘+ New Event’ button at the top left of your calendar screen.2020-06-15 17_29_37

With a PHP code is possible ?

CalDav? may not be but you are looking for but writing specific PHP scripts seems a bit ove the top (for me at least).

Over the top ? Not really, if you want this date is add when we enter a date of next contact with a people.

Do you have a link about CalDav with nextcoud ?

yup.
that’s for outlook but it works with various other things. DAVx in my case.

Hi,

Nextcloud currently offers two APIs for the calendar data: CalDAV and a PHP-based one. The latter is read-only at the moment, but we are working on providing a read-and-write PHP-API [1]. If you want to write calendar-data, you will have to use the CalDAV interface at the moment.

This is a very good guide that explains everything you need to know related to CalDAV: https://sabre.io/dav/building-a-caldav-client/

[1] https://github.com/nextcloud/server/pull/20178

2 Likes

I going to see all of that !

With sabre technic, you have an complete example for create a calendar object ?
I undestand how send a request but I don’t undestand this :

BEGIN:VCALENDAR
....
END:VCALENDAR

Please see https://tools.ietf.org/html/rfc5545

You have to send a valid calendar-document, as defined by RFC5545.

1 Like

Ok ! Thanks you !!!