Hi all,

the primary requirement is: „Do not generate errors on month_delta 
mathematics“

The implementation and thus resulting date is not so important, I think.

So if we will implement any error-free logic, then everything will be ok.

 

In my opinion, if the user has date say Mar 10th, or 03/10 and wants to 
subtract one month, it just wants to do MM=03-1 -> 02/10. If the formula 
generates invalid date (03/31 -> 02/31) then we should offer a valid date, 
e.g. 02/28. Nothing more special.
For general use the implementation of any existing logic (bash) should be 
acceptable.

Thank you

Pavel


Dne čtvrtek 19. září 2019 15:00:20 UTC+2 Thomas Keffer napsal(a):
>
> On Wed, Sep 18, 2019 at 11:37 PM gjr80 <[email protected] <javascript:>> 
> wrote:
>
>> That aside, whether you call it a bug or not I don't think we should have 
>> a tag that when you give it an allowed value/parameter it aborts the 
>> template. 
>>
>
> We don't. The tag that caused the error was user-supplied.
>
> From Graham's experiments, it looks like sqlite and bash simply subtract 
> four weeks. The span tag can already do that, so if that's what the user 
> wants, s/he can just specify it.
>
> As for Python, it doesn't even offer month arithmetic (at least, through 
> class datetime.timedelta), probably for the reasons we have discovered. 
> I'm thinking we should do the same.
>
> -tk
>  
>

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/36ad9d07-b295-4733-b0b2-44c9437133cd%40googlegroups.com.

Reply via email to