The Timeline default is to use Timeline.GregorianDateLabeller.labelPrecise.

The painter calls showBubble when you click an event.
This calls fillInfoBubble on the event.
This calls fillTime on the event, which is what calls labelPrecise.

To change this, make your own copy of the labelPrecise function and load it 
after you load Timeline. (I usually recommend against modifying the timeline 
source for these kinds of changes, and certainly don't try to make the edits in 
the timeline bundle file. Much better to load a clean copy of timeline and 
apply your own patches afterwards.)

I've been using Steven Levithan's Date Format.js
http://stevenlevithan.com/assets/misc/date.format.js

This provides most common date formats:
dateFormat.masks = {
        "default":      "ddd mmm dd yyyy HH:MM:ss",
        shortDate:      "m/d/yy",
        mediumDate:     "mmm d, yyyy",
        longDate:       "mmmm d, yyyy",
        fullDate:       "dddd, mmmm d, yyyy",
        shortTime:      "h:MM TT",
        mediumTime:     "h:MM:ss TT",
        longTime:       "h:MM:ss TT Z",
        isoDate:        "yyyy-mm-dd",
        isoTime:        "HH:MM:ss",
        isoDateTime:    "yyyy-mm-dd'T'HH:MM:ss",
        isoUtcDateTime: "UTC:yyyy-mm-dd'T'HH:MM:ss'Z'"
};

So using date.format.js and a custom labelPrecise:

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

gives: Wednesday, December 31, 1962

.format("shortDate") gives "12/31/62"

--Mike

On Jul 26, 2012, at 6:47 AM, Eugen Zhuravlov wrote:

> Hi Gents,
> Did anybody know how I can cut off "hh:mm:ss" from timeline?
> I need only dates in my popup. But now I also receive date & time - "21:00:00 
> UTC".
> I try to look in timeline-bundle.js but i cannot find in which function popup 
> generate is going to change format of date output.
> Can somebody give me a function name or method by which I can fix this?
> 
> Thanks in advance,
> Eugen.
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "SIMILE Widgets" group.
> To view this discussion on the web visit 
> https://groups.google.com/d/msg/simile-widgets/-/3FToLTsWp8IJ.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group at 
> http://groups.google.com/group/simile-widgets?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"SIMILE Widgets" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/simile-widgets?hl=en.

Reply via email to