https://www.redmine.org/https://www.redmine.org/favicon.ico?16793021292012-09-21T19:51:13ZRedmineRedmine - Defect #11290: ParseDate missing in Ruby 1.9xhttps://www.redmine.org/issues/11290?journal_id=410952012-09-21T19:51:13ZGabriel Mazetto
<ul></ul><p>This issue affects RedmineGraphsPlugin (which can be found at: <a class="external" href="https://github.com/hdgarrood/redmine-graphs-plugin/network">https://github.com/hdgarrood/redmine-graphs-plugin/network</a></p>
<p>Here is a patch for 2.1.0:</p>
<pre>
diff --git a/lib/SVG/Graph/TimeSeries.rb b/lib/SVG/Graph/TimeSeries.rb
index ee47359..bfa7c96 100644
--- a/lib/SVG/Graph/TimeSeries.rb
+++ b/lib/SVG/Graph/TimeSeries.rb
@@ -1,5 +1,4 @@
require 'SVG/Graph/Plot'
-require 'parsedate'
module SVG
module Graph
@@ -157,8 +156,7 @@ module SVG
y = []
data[:data].each_index {|i|
if i%2 == 0
- arr = ParseDate.parsedate( data[:data][i] )
- t = Time.local( *arr[0,6].compact )
+ t = DateTime.parse( data[:data][i] ).to_time
x << t.to_i
else
y << data[:data][i]
@@ -173,8 +171,7 @@ module SVG
protected
def min_x_value=(value)
- arr = ParseDate.parsedate( value )
- @min_x_value = Time.local( *arr[0,6].compact ).to_i
+ @min_x_value = DateTime.parse( data[:data][i] ).to_time
end
</pre> Redmine - Defect #11290: ParseDate missing in Ruby 1.9xhttps://www.redmine.org/issues/11290?journal_id=411002012-09-22T07:47:14ZJean-Philippe Langjp_lang@yahoo.fr
<ul><li><strong>Category</strong> set to <i>Ruby support</i></li><li><strong>Status</strong> changed from <i>New</i> to <i>Resolved</i></li><li><strong>Assignee</strong> set to <i>Jean-Philippe Lang</i></li><li><strong>Target version</strong> set to <i>2.1.1</i></li><li><strong>Resolution</strong> set to <i>Fixed</i></li></ul><p>Patch committed in <a class="changeset" title="ParseDate missing in Ruby 1.9x (#11290)." href="https://www.redmine.org/projects/redmine/repository/svn/revisions/10439">r10439</a>.</p> Redmine - Defect #11290: ParseDate missing in Ruby 1.9xhttps://www.redmine.org/issues/11290?journal_id=413042012-09-29T16:26:18ZJean-Philippe Langjp_lang@yahoo.fr
<ul><li><strong>Status</strong> changed from <i>Resolved</i> to <i>Closed</i></li></ul><p>Merged in 2.1-stable.</p> Redmine - Defect #11290: ParseDate missing in Ruby 1.9xhttps://www.redmine.org/issues/11290?journal_id=437052013-01-02T09:24:47ZHein Gustavsen
<ul></ul><p>This patch is incorrect. Value is not used in the min_x_value method. It should look like this:<br /><pre>
def min_x_value=(value)
@min_x_value = DateTime.parse( value ).to_time
end
</pre></p> Redmine - Defect #11290: ParseDate missing in Ruby 1.9xhttps://www.redmine.org/issues/11290?journal_id=437222013-01-02T15:54:50ZToshi MARUYAMA
<ul></ul><p>Hein Gustavsen wrote:</p>
<blockquote>
<p>This patch is incorrect. Value is not used in the min_x_value method. It should look like this:<br />[...]</p>
</blockquote>
<p>I have created new issue <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Defect: incorrect fix of lib/SVG/Graph/TimeSeries.rb (Closed)" href="https://www.redmine.org/issues/12711">#12711</a>, thanks.</p>