Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Newline for Google Calendar Api?

I'm trying to insert the description of an event in google calendar from my web application and i cant get \n or <br /> to be interpreted as a line break. How does the google calendar interpret newlines? Help would be appreciated!

like image 516
Ben Avatar asked Oct 20 '11 02:10

Ben


People also ask

Is there a Google Calendar API?

Millions of people use Google Calendar to track their events. The Calendar API lets you integrate your app with Google Calendar, creating new ways for you to engage your users.

Is Google Calendar API a REST API?

The Google Calendar API is a RESTful API that can be accessed through explicit HTTP calls or via the Google Client Libraries. The API exposes most of the features available in the Google Calendar Web interface.


1 Answers

Are you using a specific client library? If using the protocol, simply putting newline in the content element should work:

<?xml version="1.0" encoding="UTF-8"?>
<entry xmlns="http://www.w3.org/2005/Atom"
       xmlns:gCal="http://schemas.google.com/gCal/2005"
       xmlns:gd="http://schemas.google.com/g/2005">
  <title type="text">Event with new line</title>
  <content type="text">This is an event with one
two
three
and and four lines.</content>
<gd:when endTime="2011-12-23T10:00:00.000-07:00" 
         startTime="2011-12-23T08:00:00.000-07:00"/>
</entry>

If using a client library, using '\n' should work as well.

like image 198
Alain Avatar answered Oct 13 '22 01:10

Alain