padefla / simile-widgets

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

http://simile.mit.edu/wiki/Timeline/Date_Ranges tutorial obsolete? #360

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
- What steps will reproduce the problem?

1.Following the http://simile.mit.edu/wiki/Timeline/Date_Ranges tutorial

- What is the expected output? What do you see instead?

It was expected to have hour quarters in the timeline but I get nothing.

What version of the product are you using? On what browser and what
operating system?

I'm using (2.3.0) version.
IE8 and FF6 don' work.
There's a problem between versions, the tutorial seems to be for an older
one, it saids to add "Timeline.DateTime.QUARTERHOUR = 4;" inside
"Timeline.DateTime object" in the date-time.js but the current object in
this file is "SimileAjax.DateTime".

Please provide any additional information below.

I have adapted all the steps to current versión (2.3.0) and it doesn't
work. What I have done:

 Edited date-time.js

    * Add a constant to the SimileAjax.DateTime object:

          SimileAjax.DateTime.QUARTERHOUR = 4;

    And shifted the values of the other constants accordingly. 

    * Added a gregorianUnitLength constant: 

a[d.QUARTERHOUR] = a[d.MINUTE] * 15;

    * Added a case for the roundDownToInterval member function: 

case SimileAjax.DateTime.QUARTERHOUR:
   date2.setUTCMilliseconds(0);
   date2.setUTCSeconds(0);
   var x = date2.getUTCMinutes();
   x=(x-(x%15))/15;
   date2.setUTCMinutes((x-(x%multiple))*15);
   break;

    * Added a case for the incrementByInterval member function: 

case SimileAjax.DateTime.QUARTERHOUR:
    date2.setTime(date2.getTime() +
SimileAjax.DateTime.gregorianUnitLengths[SimileAjax.DateTime.QUARTERHOUR]);
    break;

Edited labelers.js

    * Added a case for the defaultLabelInterval member function: 

case SimileAjax.DateTime.QUARTERHOUR:
    var m = date.getUTCMinutes();
    if (m == 0) {
        text = date.getUTCHours() + "hr";
        emphasized = true;
    } else {
        text = ":" + m;
    }
    break;

Original issue reported on code.google.com by el.pinto...@gmail.com on 22 Mar 2010 at 9:32

GoogleCodeExporter commented 8 years ago

Original comment by ryan...@csail.mit.edu on 23 Jun 2011 at 10:13

GoogleCodeExporter commented 8 years ago

Original comment by ryan...@csail.mit.edu on 23 Jun 2011 at 10:33