[prev in list] [next in list] [prev in thread] [next in thread] 

List:       perl-datetime
Subject:    Re: Issue with DateTime::Span->from_datetime_and_duration()
From:       David Pottage <d.pottage () cv-library ! co ! uk>
Date:       2013-08-28 10:12:27
Message-ID: 521DCD0B.5010501 () cv-library ! co ! uk
[Download RAW message or body]

On 27/08/13 19:54, Flavio S. Glock wrote:
> I've uploaded DateTime-Set-0.32 to cpan.
>
> The idea was that you would specify 'end' and a negative duration, like:
>
>   DateTime::Span->from_datetime_and_duration(
>     end      => DateTime->now(),
>     hours   => -24
>   )

I saw that, but I could not make it work, and in any case I am not sure 
that it makes sense for time durations to have a sign, though I dare say 
someone will show me a counter example.

> but that would not work because of a bug in 0.31 or before.
>
> The new version ignores the signal of the duration, and it does the 
> right thing depending on which other endpoint is specified.
>
> diff: 
> https://github.com/fglock/DateTime-Set/commit/83350c3e99455b5cbd0d2c158b0b7168b5c9908e

Thanks, that is impressively speedy service, especially after the last 
time I attempted to report a bug in the DateTime distro, and was told 
(paraphrased), "We have documented our illogical behavior so it is not a 
bug."

-- 
David Pottage
CV Library Ltd.



[Attachment #3 (text/html)]

<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">On 27/08/13 19:54, Flavio S. Glock
      wrote:<br>
    </div>
    <blockquote
cite="mid:CAHMRfDxawwS4HQ22gT7rxvihaRUi69CantO22ACvOrEFt=uHqA@mail.gmail.com"
      type="cite">
      <div dir="ltr">I've uploaded DateTime-Set-0.32 to cpan.
        <div><br>
          The idea was that you would specify 'end' and a negative
          duration, like:</div>
        <div><br>
        </div>
        <div><span style="font-family:arial,sans-serif;font-size:16px">&nbsp;
            &nbsp; DateTime::Span-&gt;from_datetime_</span><span
            style="font-family:arial,sans-serif;font-size:16px">and_duration(</span><br
  style="font-family:arial,sans-serif;font-size:16px">
          <span style="font-family:arial,sans-serif;font-size:16px">&nbsp; &nbsp;
            &nbsp; &nbsp; end &nbsp; &nbsp; &nbsp;=&gt; DateTime-&gt;now(),</span><br
            style="font-family:arial,sans-serif;font-size:16px">
          <span style="font-family:arial,sans-serif;font-size:16px">&nbsp; &nbsp;
            &nbsp; &nbsp; hours &nbsp; =&gt; -24</span></div>
        <div><span style="font-family:arial,sans-serif;font-size:16px">&nbsp;
            &nbsp; )</span><br>
        </div>
      </div>
    </blockquote>
    <br>
    I saw that, but I could not make it work, and in any case I am not
    sure that it makes sense for time durations to have a sign, though I
    dare say someone will show me a counter example.<br>
    <br>
    <blockquote
cite="mid:CAHMRfDxawwS4HQ22gT7rxvihaRUi69CantO22ACvOrEFt=uHqA@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div>but that would not work because of a bug in 0.31 or before.<br>
          <br>
          The new version ignores the signal of the duration, and it
          does the right thing depending on which other endpoint is
          specified.<br>
          <br>
          diff:&nbsp;<a moz-do-not-send="true"
href="https://github.com/fglock/DateTime-Set/commit/83350c3e99455b5cbd0d2c158b0b7168b5 \
c9908e">https://github.com/fglock/DateTime-Set/commit/83350c3e99455b5cbd0d2c158b0b7168b5c9908e</a><br>
  </div>
      </div>
    </blockquote>
    <br>
    Thanks, that is impressively speedy service, especially after the
    last time I attempted to report a bug in the DateTime distro, and
    was told (paraphrased), "We have documented our illogical behavior
    so it is not a bug."<br>
    <br>
    <span class="moz-txt-tag">--&nbsp;<br>
    </span>David Pottage
    <br>
    CV Library Ltd.
    <br>
    <br>
    <br>
  </body>
</html>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic