Amit Kumar Goyal wrote:
>
> Hi,
>
> I want to format the way the date of an even appears in a timeline 
> bubble. Currently it is shown as “*_Sun, 29 Aug 1993 13:30:00 UTC_*” 
> which I want to appear as “*_29 Aug 1993_*” only.
>
> I have tried looking through the code but could not figure out how to 
> do it.
>
Search for labelPrecise in
http://simile.mit.edu/timeline/api/scripts/labellers.js
That is the code responsible for producing that date label in the 
timeline bubble. You can override it by including this script after you 
include timeline-api.js:

Timeline.GregorianDateLabeller.prototype.labelPrecise = function(date) {
    return Timeline.DateTime.removeTimeZoneOffset(
        date, 
        this._timeZone //+ (new Date().getTimezoneOffset() / 60)
    ).toUTCString();
};

and replace toUTCString with something like formatDate("MMM d, y").

I found some date formatting examples here:
http://www.mattkruse.com/javascript/date/

David
_______________________________________________
General mailing list
[email protected]
http://simile.mit.edu/mailman/listinfo/general

Reply via email to