Thanks for this code.  This gave me the dates in format dd/mm/yyyy
which was a great start.  Unfortunately what I really wanted was Day,
dd mmm yyyy ( for eg. Mon, 15 Sep 2008).  After much searching I have
found a solution that can be used in version 1.3 if you don't want to
download the whole simile program.

Basically you need to get the sources.js file and save it and add that
to the list of scripts you call at the beginning of your html.  Make
sure you call it after
<script src="http://simile.mit.edu/timeline/api/timeline-api.js";
type="text/javascript"></script>
so that is overrules the sources.js file that it calls from there.

I essentially used the same code as jcorreia sent me above with a few
things adjusted:

This is what I now have inside fillTime: function(elmt, labeller){
var sDate = this._start;
                var eDate = this._end;
                var sDated = new Date(sDate);
                var eDated = new Date(eDate);
                Date.MONTH_NAMES =
["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];
                Date.prototype.getMonthName = function() {return
Date.MONTH_NAMES[this.getMonth()];}
                Date.WEEKDAY_NAMES = 
["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];
                Date.prototype.getWeekday = function() {return
Date.WEEKDAY_NAMES[this.getDay()];}
                var startString = sDated.getWeekday() + ", " + sDated.getDate() 
+ "
" + sDated.getMonthName() + " " + sDated.getFullYear();
                var endString = sDated.getWeekday() + ", " + eDated.getDate() + 
" "
+ sDated.getMonthName() + " " + eDated.getFullYear();

        if (this._instant) {
            if (this.isImprecise()) {
 
elmt.appendChild(elmt.ownerDocument.createTextNode(startString+ " - "
+endString));
            }
                        else {
 
elmt.appendChild(elmt.ownerDocument.createTextNode(startString));
            }
        }
                else {
            if (this.isImprecise()) {
 
elmt.appendChild(elmt.ownerDocument.createTextNode(labeller.labelPrecise(this._start)
+ " ~ " + labeller.labelPrecise(this._latestStart)));
 
elmt.appendChild(elmt.ownerDocument.createElement("br"));
 
elmt.appendChild(elmt.ownerDocument.createTextNode(labeller.labelPrecise(this._earliestEnd)
+ " ~ " + labeller.labelPrecise(this._end)));
            }
                        else {
 
elmt.appendChild(elmt.ownerDocument.createTextNode(startString+ " - "
+endString));
 
elmt.appendChild(elmt.ownerDocument.createElement("br"));
            }
        }
}

Thanks for everyones help! Much appreciated and I hope that this can
help someone else out in the future!

--~--~---------~--~----~------------~-------~--~----~
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