# intended behaviour of secondary dates:
# print     shows both dates
# register  shows the primary or (with --date2) secondary date
# -b/-e/-p  match the primary or (with --date2) secondary date
# date:D    matches the primary or (with --date2) secondary date
# date2:D   matches the secondary date

# 1. --date2 causes the secondary date to be displayed
hledger -f - register --date2
<<<
2009/1/1=2010/1/1 x
  a  1
  b
>>>
2010-01-01 x                    a                                1             1
                                b                               -1             0
>>>=0

# 2. --date2 causes -b/-e/-p to match the secondary date
hledger -f- register -p 2014/1/2 --date2
<<<
2014/1/1=1/2
  (a)  1

2014/1/3
  (b)  1
>>>
2014-01-02                      (a)                              1             1
>>>=0

# 3. --date2 causes date: to match the secondary date
hledger -f- register date:2014/1/2 --date2
<<<
2014/1/1=1/2
  (a)  1

2014/1/3
  (b)  1
>>>
2014-01-02                      (a)                              1             1
>>>=0

# 4. date2: matches the secondary date (but does not necessarily display it)
hledger -f- register date2:2014/1/2
<<<
2014/1/1=1/2
  (a)  1

2014/1/3
  (b)  1
>>>
2014-01-01                      (a)                              1             1
>>>=0

# 5. date2: plus --date2 both matches and displays the secondary date
hledger -f- register date2:2014/1/2 --date2
<<<
2014/1/1=1/2
  (a)  1

2014/1/3
  (b)  1
>>>
2014-01-02                      (a)                              1             1
>>>=0

# 6. date2: matching is not affected by --date2
hledger -f- register date2:2014/1/1 --date2
<<<
2014/1/1=1/2
  (a)  1

2014/1/3
  (b)  1
>>>
>>>=0

# 7. with --date2, the secondary date is used for sorting
hledger -f- register --date2
<<<
2014/1/1=2/2
  (a)  1

2014/1/3=2/1
  (b)  1
>>>
2014-02-01                      (b)                              1             1
2014-02-02                      (a)                              1             2
>>>=0
