Skip Menu |

This queue is for tickets about the Finance-Quote CPAN distribution.

Report information
The Basics
Id: 45762
Status: rejected
Priority: 0/
Queue: Finance-Quote

People
Owner: eco [...] ecocode.net
Requestors: dbreiser [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 1.16
Fixed in: (no value)



Subject: VWD.pm assigns bogus time to quotes outside trading hours
at line 134 of VWD.pm: my $time = $wpkurs->look_down( "_tag", "div", "class", "datum" ); if ($time) { $info{$fund, "time"} = $time->as_trimmed_text; } During trading hours, "datum" contains a time as hh:mm:ss. After hours, datum returns a date as dd.mm.yy gnucash insists on a valid time to use a quote, so gnucash users can't use VWD values when $time=30.04.09 for example. Also, $date is set by the value at the top of the page, which is the date the quote is retrieved, not the date associated with the quote (unless of course it's during trading hours). It looks like the module should examine datum and either use it for time, or else use it for the date as appropriate. I'd be in favor of the module also assigning a time in the second case -- something like 18:00:00 that's clearly outside the trading day, but not so close to midnight that a small time zone change causes issues. I suppose maybe the time might be best as UTC for closing time, but I'm not so sure that's the best or not.
please send some stock id's I can use to write a test for this. (With F::Q I'm used to write a test before solving a bug) thanks -- Erik
From: Martin Kompf
Show quoted text
> During trading hours, "datum" contains a time as hh:mm:ss. After hours, > datum returns a date as dd.mm.yy > > gnucash insists on a valid time to use a quote, so gnucash users can't > use VWD values when $time=30.04.09 for example. >
The issue may be solved by applying the attached diff to VWD.pm This ensures that only valid times are reported, otherwise time is empty. This works for me well with gnucash 2.2.9. Martin
Subject: VWD.pm.diff
47c47 < $VERSION = '1.17'; --- > $VERSION = '1.17patched'; 138,139c138,139 < if ($time) { < $info{$fund, "time"} = $time->as_trimmed_text; --- > if ($time->as_trimmed_text =~ /([012]\d:[0-5]\d:[0-5]\d)/) { > $info{$fund, "time"} = $1;
thanks for the work VWD is working through gihub pull -- Erik