You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@community.apache.org by rg...@apache.org on 2013/06/16 17:10:29 UTC

svn commit: r1493520 - /comdev/site/trunk/content/calendars/index.mdtext

Author: rgardler
Date: Sun Jun 16 15:10:29 2013
New Revision: 1493520

URL: http://svn.apache.org/r1493520
Log:
Replacing original calendar page (which has been "coming soon" for quite come time, with the more useful events calendar

Modified:
    comdev/site/trunk/content/calendars/index.mdtext

Modified: comdev/site/trunk/content/calendars/index.mdtext
URL: http://svn.apache.org/viewvc/comdev/site/trunk/content/calendars/index.mdtext?rev=1493520&r1=1493519&r2=1493520&view=diff
==============================================================================
--- comdev/site/trunk/content/calendars/index.mdtext (original)
+++ comdev/site/trunk/content/calendars/index.mdtext Sun Jun 16 15:10:29 2013
@@ -16,19 +16,87 @@ Notice:    Licensed to the Apache Softwa
            specific language governing permissions and limitations
            under the License.
 
-Within the Apache Software Foundation, a number of projects maintain their own calendars for events, talks and milestones. 
-To make it easier to track these things across the whole foundation, the Community Development project will soon provide 
-this central to aggregate these into one calendar.
-
-The Apache Conferences Committee (ConCom) also maintains their list of Apache and Apache related conferences 
-[here][1]
-
-# Calendar
-*This is coming soon*
-
-## Getting your project events into the Calendar
-If events from your project are not being listed in the calendar, please get in touch via our [mailing list][2], and let 
-us know the details of your event feed (ideally in iCal format). Note that only Apache Projects will be listed here
+This calendar lists events relating to The Apache Software Foundation and its projects. 
 
-   [1]: conferences.html  
-   [2]: http://mail-archives.apache.org/mod_mbox/community-dev/
\ No newline at end of file
+This Calendar is maintained by the Apache Community Development Committee (ComDev), 
+to have your event listed considered for addition please mail [dev@community.apache.org][1].
+Note that to be listed in this calendar events must conform to the [Third Party Event Branding Policy][2]. 
+
+<h2>Upcoming events</h2>
+<ul id="events">
+ <li><i>List loading</i></li>
+</ul>
+
+<iframe src="https://www.google.com/calendar/embed?src=nerseigospses068jd57bk5ar8%40group.calendar.google.com&ctz=America/New_York"
+style="border: 0" width="800" height="600" frameborder="0" scrolling="no"></iframe>
+
+This Calendar is also available as an [iCal feed][3]
+
+<script type="text/javascript">
+function handleContents(li, text) {
+   if(text == undefined || text.length == 0) {
+      return;
+   }
+   parts = text.split("\n");
+   for(var i=0; i<parts.length; i++) {
+      li.appendChild(document.createElement("br"));
+      li.appendChild(document.createTextNode(parts[i]));
+   }
+}
+
+var dateRegExp = new RegExp("^(\\d{4})-(\\d{2})-(\\d{2})$");
+function handleDates(li, when) {
+   var from = when['startTime'];
+   var to = when['endTime'];
+   if(from.match(dateRegExp) && to.match(dateRegExp)) {
+      var fp = from.split(dateRegExp);
+      var tp = to.split(dateRegExp);
+      var fromDate = new Date(fp[1],fp[2]-1,fp[3]);
+      var toDate = new Date(tp[1],tp[2]-1,tp[3]);
+      var realToDate = new Date(toDate.getTime() - 24*60*60*1000);
+
+      var text;
+      if(fromDate.getTime() == realToDate.getTime()) {
+         // Single day
+         text = from;
+      } else {
+         // Really multi day
+         text = from + " to " + realToDate.getFullYear() + "-" + 
+                (realToDate.getMonth()+1) + "-"  + realToDate.getDate();
+      }
+      li.appendChild(document.createTextNode(" - " + text))
+   } else {
+      li.appendChild(document.createTextNode(" - " + from))
+   }
+}
+
+function render(data) {
+   var ev = document.getElementById("events");
+   if(ev.hasChildNodes()) {
+      while(ev.childNodes.length >= 1) {
+         ev.removeChild(ev.firstChild);       
+      } 
+   }
+
+   var feed = data.feed;
+   for(var i=0; i<feed.entry.length; i++) {
+      var entry = feed.entry[i];
+      var title = entry.title.$t;
+      var text = entry.content.$t;
+      var when = entry['gd$when'][0];
+
+      var li = document.createElement("li");
+      var li_b = document.createElement("b");
+      li_b.appendChild(document.createTextNode(title));
+      li.appendChild(li_b);
+      handleDates(li, when);
+      handleContents(li, text);
+      ev.appendChild(li);
+   }
+}
+</script>
+<script src="http://www.google.com/calendar/feeds/nerseigospses068jd57bk5ar8@group.calendar.google.com/public/full?alt=json-in-script&callback=render&orderby=starttime&max-results=30&singleevents=true&sortorder=ascending&futureevents=true"></script>
+
+  [1]: mailto:dev@community.apache.org
+  [2]: http://www.apache.org/foundation/marks/events.html
+  [3]: https://www.google.com/calendar/ical/nerseigospses068jd57bk5ar8%40group.calendar.google.com/public/basic.ics
\ No newline at end of file