I noticed DateTime::Duration <=> is not
checking the 'reverse' flag.
Also, it would be useful to be able to
compare a duration to zero, in order to check if
it is negative, positive or null.
I could do that, just tell me if it is ok.
- Flavio S. Glock
On Fri, 4 Apr 2003 [EMAIL PROTECTED] wrote:
> I noticed DateTime::Duration <=> is not
> checking the 'reverse' flag.
>
> Also, it would be useful to be able to
> compare a duration to zero, in order to check if
> it is negative, positive or null.
>
> I could do that, just tell me if it is ok.
Sou
On Fri, 4 Apr 2003 [EMAIL PROTECTED] wrote:
> I noticed DateTime::Duration <=> is not
> checking the 'reverse' flag.
>
> Also, it would be useful to be able to
> compare a duration to zero, in order to check if
> it is negative, positive or null.
>
> I could do that, just tell me if it is ok.
Act
On Fri, 4 Apr 2003, Dave Rolsky wrote:
> > Also, it would be useful to be able to
> > compare a duration to zero, in order to check if
> > it is negative, positive or null.
Ugh, I must take a moment before replying to mail. I thought about this a
bit more and realized I don't really like it, bec
Dave Rolsky wrote:
> I thought about this a
> bit more and realized I don't really like it,
because it special cases one
> number, zero. But comparing it to other numbers
wouldn't make sense.
Ok. Maybe a $dt_dur->is_zero() method instead?
- Flavio S.
Glock
On Sat, 28 Jun 2003, Rick Measham wrote:
> This is just for comment. As per my previous email, this module allows
> one to compare durations when given a reference point. I'm not real
> happy with the method names, and I've just called it
> DateTime::Duration::Comp
error that comparison
operators are not overloaded in DateTime::Duration and that I should use
DateTime::Duration->compare() to do comparisons.
I have tracked this down and it appears that somewhere deep in the
template processing, TT is doing an 'eq' on a DateTime::Duration object
no info on this
> on Google.
>
> Somehow when you try to invoke any of
DateTime::Duration's accessor
> methods from within a TT template it dies with an
error that comparison
> operators are not overloaded in DateTime::Duration
and that I should use
> DateTime::Duration-&g
accessor
methods from within a TT template it dies with an
error that comparison
operators are not overloaded in DateTime::Duration
and that I should use
DateTime::Duration->compare() to do comparisons.
I have tracked this down and it appears that
somewhere deep in the
On Wed, 8 Dec 2004, Arshavir Grigorian wrote:
I have tracked this down and it appears that somewhere deep in the template
processing, TT is doing an 'eq' on a DateTime::Duration object and that's
throwing an exception.
This seems like it could be a general problem with TT. I wonder why it's
usi
On Thu, 9 Dec 2004, Arshavir Grigorian wrote:
- my $atroot = ($root eq $self);
+ my $atroot = ((ref ($root) eq ref ($self)) && ($root eq $self));
Even better would be something like this:
use Scalar::Util qw(refaddr);
my $atroot = ref $root && refaddr($root) == refaddr($self);
By "overload aware"
Dave Rolsky wrote:
On Wed, 8 Dec 2004, Arshavir Grigorian wrote:
I have tracked this down and it appears that somewhere deep in the
template processing, TT is doing an 'eq' on a DateTime::Duration
object and that's throwing an exception.
This seems like it could be a general problem with TT. I
Hi,
The documentation does not specify what What does
DateTime::Duration->compare() returns.
>From some testing I've done it seems like it
- 1 if the first duration is larger than the second,
- 0 if the durations are equal
- -1 is the second duration is larger than the
Hi Andreas,
It does need to be documented, but to explain:
$dt->compare follows the behavior of `cmp` and ``.
- Rick
On Thu, 10
Oct 2013 10:07:02 +0200, Andreas Isberg wrote:
> Hi,
> The
documentation does not specify what What does
DateTime::Duration->compare() returns.
14 matches
Mail list logo