Friday, January 11th, 2008

Drinking offline at the Happy Hour while being openly social

Category: Gears, JavaScript

Over in Gears land I met with Chandra Patni, the creator of happyhour:

Open Social Happy Hour is a port of Open Social Container Sample that employs Google Gears for persistence. It allows data coherency of open social widgets across browser windows.

As I said on the Gears blog:

The motivation for the project was speeding up the development cycle of OpenSocial components by allowing developers to bypass talking to a production server, or even a local one. Load up an HTML file and you are good to go. This also helped when getting designers into the mix as they could just style the HTML and they were done.

The container supports Caja, and adds useful minor features such as munging between a JavaScript date, and an ISO 8601 date that SQLite uses:

opensocial.HappyHourContainer.prototype.toISO8601String = function (date) {
var zeropad = function (num) { return ((num < 10) ? '0' : '') + num; } var str = ""; str += date.getUTCFullYear(); str += "-" + zeropad(date.getUTCMonth() + 1); str += "-" + zeropad(date.getUTCDate()); str += "T" + zeropad(date.getUTCHours()) + ":" + zeropad(date.getUTCMinutes())+ ":" + zeropad(date.getUTCSeconds()); var ms = date.getUTCMilliseconds(); str += "."+(ms < 10 ? "00"+ms : (ms < 100 ? "0"+ms : ms)); return str; }; [/javascript] In your application, you will probably want to pass in a bootstrap callback where you can insert dummy data to get going.

We had a busy day yesterday:

Posted by Dion Almaer at 8:01 am
1 Comment

3.1 rating from 17 votes

1 Comment »

Comments feed TrackBack URI

It’s cool to support gear which is something we are still trying to learn. I really like Dion’s google series on the blog. Really helps.

Other than that, it’s good to see someone actually get this UTC issue straighten out upfront. I wonder if it takes care of the day light saving issue in different timezone?

Comment by Liming — January 11, 2008

Leave a comment

You must be logged in to post a comment.