tomasjanik / simile-widgets

Automatically exported from code.google.com/p/simile-widgets
0 stars 0 forks source link

TIMELINE. setting time format in timeline bubble #265

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I'm constructing a timeline in which all the events simply correspond to a
year, not a date and time. It would be great if my pop-ups could just
display the year of the event, rather than every event displaying the
default Jan. 1st 18:00:00 GMT. I understand that I need to override the
fillInfoBubble function, but am unsure exactly how to do so. I know this
isn't the appropriate place to ask for javascript lessons, but if someone
has written a function previously or knows how to institute this change
fairly quickly, I would love to hear back from you.

[Submitted by James Fishwick on simile.mit.edu] 

Original issue reported on code.google.com by GabrielR...@googlemail.com on 14 Apr 2009 at 11:54

GoogleCodeExporter commented 9 years ago
add following after
"<script src="timeline_js/timeline-api.js"></script>" but before initialization 
of timeline.

    <script>
        //change date format in bubble.
        Timeline.GregorianDateLabeller.prototype.labelPrecise = function(date) {
            return SimileAjax.DateTime.removeTimeZoneOffset(date,this._timeZone).getFullYear();
        };
    </script>

Original comment by tengy...@gmail.com on 13 Apr 2012 at 1:56