Re: Terminal date in period expressions

2016-06-29 Thread Simon Michael

On 6/29/16 8:19 AM, Vikas Rawal wrote:


Ledger users are used to it, but yes, of course you're right. That's why John 
suggested maybe adding support for specifying/showing inclusive end dates as 
well. This has some costs, eg more complexity. It's awaiting someone motivated 
to do the work. The first step is to come up with a specification I think.


Linguistically, it would be better to make “to” and “until"  include the 
terminal date, and use “before” to exclude the end date.

So these would be equivalent:

--period 'from 2015/04/01 to 2016/03/31’

--period ’since 2015/04/01 until 2016/03/31’

--period 'from 2015/04/01 before 2016/04/01’


Might be a bit too subtle/arguable..

We could also allow dates to have a suffix: inclusive/exclusive, 
incl/excl, i/e or similar:


-p '2015/04/01 to 2016/03/31incl'
-p '2015/04/01 to 2016/03/31i'
-p '2015/04/01 to 2016/03/31e'  # redundant
-e 2016/03/31e
-p '2015/04/01e to 2016/03/31'  # weird
-p '2015/04/01e'# wouldn't make sense
-p '2015 to 2016i'  # includes all of 2016 ?


--

--- 
You received this message because you are subscribed to the Google Groups "Ledger" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Terminal date in period expressions

2016-06-29 Thread Vikas Rawal
> 
> Ledger users are used to it, but yes, of course you're right. That's why John 
> suggested maybe adding support for specifying/showing inclusive end dates as 
> well. This has some costs, eg more complexity. It's awaiting someone 
> motivated to do the work. The first step is to come up with a specification I 
> think.
> 
> 

Linguistically, it would be better to make “to” and “until"  include the 
terminal date, and use “before” to exclude the end date.

So these would be equivalent:

--period 'from 2015/04/01 to 2016/03/31’

--period ’since 2015/04/01 until 2016/03/31’

--period 'from 2015/04/01 before 2016/04/01’

Vikas

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: Terminal date in period expressions

2016-06-29 Thread Simon Michael

On 6/28/16 7:31 PM, Vikas Rawal wrote:

Imagine the date is followed by 00:00:00. They are instants in time not entire 
days.



If they are meant to be instants in time, and the only possible time is 
00:00:00, why should it still be exclusive of the terminal instant?

Ledger’s treatment of time has to be consistent between the way time is 
interpreted when transactions are recorded (in the data file) and the way time 
is treated in the queries.

If we are assuming 00.00.00 time of the day if no time is (or can be) 
specified, then we have to do the same with transactions. This would imply that 
all transactions that took place on 2016/03/31 should be assumed to have taken 
place at 2016/03/31 00:00:00.  That by itself is not a sufficient reason for 
excluding that instant from this query.


The current semantics are that a transaction recorded with date 
2016/03/31 took place at some unspecified time on that day in your 
current timezone, later than any similarly-dated transactions already 
parsed.



What we have now is that if I want transactions from April 1, 2015 to March 31, 
2016, I have to say, show me transactions from April 1, 2015 to April 1, 2016. 
Forget ledger and programming for a second. Does this not sound odd from the 
perspective of an accountant/lay person? That is not how most people would 
think of “from” and “to”.


Ledger users are used to it, but yes, of course you're right. That's why 
John suggested maybe adding support for specifying/showing inclusive end 
dates as well. This has some costs, eg more complexity. It's awaiting 
someone motivated to do the work. The first step is to come up with a 
specification I think.




--

--- 
You received this message because you are subscribed to the Google Groups "Ledger" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Terminal date in period expressions

2016-06-28 Thread Vikas Rawal

> 
> Imagine the date is followed by 00:00:00. They are instants in time not 
> entire days.
> 

If they are meant to be instants in time, and the only possible time is 
00:00:00, why should it still be exclusive of the terminal instant?

Ledger’s treatment of time has to be consistent between the way time is 
interpreted when transactions are recorded (in the data file) and the way time 
is treated in the queries.

If we are assuming 00.00.00 time of the day if no time is (or can be) 
specified, then we have to do the same with transactions. This would imply that 
all transactions that took place on 2016/03/31 should be assumed to have taken 
place at 2016/03/31 00:00:00.  That by itself is not a sufficient reason for 
excluding that instant from this query.

What we have now is that if I want transactions from April 1, 2015 to March 31, 
2016, I have to say, show me transactions from April 1, 2015 to April 1, 2016. 
Forget ledger and programming for a second. Does this not sound odd from the 
perspective of an accountant/lay person? That is not how most people would 
think of “from” and “to”.

Vikas







-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: Terminal date in period expressions

2016-06-28 Thread John Wiegley
> Craig Earls  writes:

> Imagine the date is followed by 00:00:00. They are instants in time not
> entire days.

Craig is right, the "date" of the end of a range is always exclusive, even
though there are times that it would make more sense for it to be inclusive.
It might be useful to have an option to switch the two readings of such
ranges...

-- 
John Wiegley  GPG fingerprint = 4710 CF98 AF9B 327B B80F
http://newartisans.com  60E1 46C4 BD1A 7AC1 4BA2

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Terminal date in period expressions

2016-06-28 Thread Alexandre Rademaker

https://github.com/ledger/ledger/pull/458

--
Alexandre Rademaker
http://arademaker.github.io 


> On Jun 28, 2016, at 1:34 PM, Simon Michael  wrote:
> 
> On 6/28/16 4:47 AM, Vikas Rawal wrote:
>> The following period expression excludes transactions on March 31, 2016.
>> 
>> --period 'from 2015/04/01 to 2016/03/31’
>> 
>> Is this a feature or a bug? If it is a feature,  it would be good to express 
>> this clearly in the manual in discussion of period_expressions.
> 
> It's by design; Ledger's end dates are always exclusive.
> 
> This is probably mentioned somewhere in the manual, but a pull request making 
> it clearer would probably be accepted easily.

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Terminal date in period expressions

2016-06-28 Thread Simon Michael

On 6/28/16 4:47 AM, Vikas Rawal wrote:

The following period expression excludes transactions on March 31, 2016.

--period 'from 2015/04/01 to 2016/03/31’

Is this a feature or a bug? If it is a feature,  it would be good to express 
this clearly in the manual in discussion of period_expressions.


It's by design; Ledger's end dates are always exclusive.

This is probably mentioned somewhere in the manual, but a pull request 
making it clearer would probably be accepted easily.



--

--- 
You received this message because you are subscribed to the Google Groups "Ledger" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Terminal date in period expressions

2016-06-28 Thread Craig Earls
Imagine the date is followed by 00:00:00. They are instants in time not
entire days.

On Tuesday, June 28, 2016, Vikas Rawal  wrote:

> The following period expression excludes transactions on March 31, 2016.
>
> --period 'from 2015/04/01 to 2016/03/31’
>
> Is this a feature or a bug? If it is a feature,  it would be good to
> express this clearly in the manual in discussion of period_expressions.
>
> Vikas
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "Ledger" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ledger-cli+unsubscr...@googlegroups.com .
> For more options, visit https://groups.google.com/d/optout.
>


-- 
Craig, Corona De Tucson, AZ
enderw88.wordpress.com

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Terminal date in period expressions

2016-06-28 Thread Vikas Rawal
The following period expression excludes transactions on March 31, 2016.

--period 'from 2015/04/01 to 2016/03/31’

Is this a feature or a bug? If it is a feature,  it would be good to express 
this clearly in the manual in discussion of period_expressions.

Vikas

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: Message signed with OpenPGP using GPGMail