tazzcoco / simile-widgets

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

TIMEPLOT: Problem with incorrect year display #88

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. simile-timeplot/src/webapp/site/tests/time_geometries/index.html
2. The years are incorrectly displayed!

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

The first year marker should be for 2008, since the first event is in mid-2007.

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

Firefox 3.0.8, Ubuntu Intrepid, computer is set up to use CEST (Rome) time.

Please provide any additional information below.

Please find attached a file displaying exactly how I see the results of the
time_geometries test.

Original issue reported on code.google.com by davidnwe...@gmail.com on 29 Mar 2009 at 6:10

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by larryklu...@gmail.com on 29 Mar 2009 at 6:42

GoogleCodeExporter commented 9 years ago
@@ -12411,7 +12410,9 @@ Timeplot.DefaultTimeGeometry.prototype = {
                 case time.DECADE:
                 case time.CENTURY:
                 case time.MILLENNIUM:
-                  var l = t.getUTCFullYear();
+                 var tmpd = new Date(t.getTime());
+                  tmpd.setDate(t.getDate() + 1);
+                  var l = tmpd.getUTCFullYear();
                   break;
             }
             if (x > 0) {

(place it here so that I can find it later in case)

Original comment by stefano.mazzocchi@gmail.com on 30 Mar 2009 at 6:36

GoogleCodeExporter commented 9 years ago

Original comment by stefano.mazzocchi@gmail.com on 30 Mar 2009 at 6:37

GoogleCodeExporter commented 9 years ago
Any chance of this fix being applied to the core hosted distribution at
http://static.simile.mit.edu/timeplot/api/1.0/timeplot-api.js ?

Original comment by voiceins...@gmail.com on 26 Jun 2009 at 7:32

GoogleCodeExporter commented 9 years ago
This bug can be also observed in the Timeplot tutorial at
http://www.simile-widgets.org/timeplot/docs/

1) Look at the Timeplot resulting from tutorial step 10.
2) Notice that, e.g., the range of dates from year 2006 is labeled as year 2005.

Original comment by capts...@gmail.com on 7 Aug 2009 at 7:06

GoogleCodeExporter commented 9 years ago
Workaround = fix _calculateGrid (using the patch from comment #2) before 
instantiating 
DefaultTimeGeometry:

  function onLoad() {
      var eventSource = new Timeplot.DefaultEventSource();

      Timeplot.DefaultTimeGeometry.prototype._calculateGrid = function() {
      ...
                    case time.CENTURY:
                    case time.MILLENNIUM:
                      var tmpd = new Date(t.getTime());
                      tmpd.setDate(t.getDate() + 1);
                      var l = tmpd.getUTCFullYear();
                      break;
      ...
            return grid;
      };

Original comment by capts...@gmail.com on 7 Aug 2009 at 7:20