summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/times.cc2
-rw-r--r--test/baseline/opt-forecast-while.test74
-rw-r--r--test/regress/13965214.test2
3 files changed, 39 insertions, 39 deletions
diff --git a/src/times.cc b/src/times.cc
index 7ddc7bd4..c3b5009d 100644
--- a/src/times.cc
+++ b/src/times.cc
@@ -97,7 +97,7 @@ namespace {
if (result.tm_year == -1) {
result.tm_year = (year == -1 ? int(CURRENT_DATE().year()) : year) - 1900;
- if (result.tm_mon > (CURRENT_DATE().month() - 1))
+ if (year == -1 && result.tm_mon > (CURRENT_DATE().month() - 1))
result.tm_year--;
}
diff --git a/test/baseline/opt-forecast-while.test b/test/baseline/opt-forecast-while.test
index a2bed037..91e3a24f 100644
--- a/test/baseline/opt-forecast-while.test
+++ b/test/baseline/opt-forecast-while.test
@@ -244,42 +244,42 @@ reg --forecast-while='total < $3500' books
09-Nov-30 End of November Expenses:Books $110.00 $2880.00
09-Dec-01 December Expenses:Books $120.00 $3000.00
09-Dec-31 End of December Expenses:Books $120.00 $3120.00
-09-Mar-01 Forecast transaction Expenses:Books $10.00 $3130.00
-09-Apr-01 Forecast transaction Expenses:Books $10.00 $3140.00
-09-May-01 Forecast transaction Expenses:Books $10.00 $3150.00
-09-Jun-01 Forecast transaction Expenses:Books $10.00 $3160.00
-09-Jul-01 Forecast transaction Expenses:Books $10.00 $3170.00
-09-Aug-01 Forecast transaction Expenses:Books $10.00 $3180.00
-09-Sep-01 Forecast transaction Expenses:Books $10.00 $3190.00
-09-Oct-01 Forecast transaction Expenses:Books $10.00 $3200.00
-09-Nov-01 Forecast transaction Expenses:Books $10.00 $3210.00
-09-Dec-01 Forecast transaction Expenses:Books $10.00 $3220.00
-10-Jan-01 Forecast transaction Expenses:Books $10.00 $3230.00
-10-Feb-01 Forecast transaction Expenses:Books $10.00 $3240.00
-10-Mar-01 Forecast transaction Expenses:Books $10.00 $3250.00
-10-Apr-01 Forecast transaction Expenses:Books $10.00 $3260.00
-10-May-01 Forecast transaction Expenses:Books $10.00 $3270.00
-10-Jun-01 Forecast transaction Expenses:Books $10.00 $3280.00
-10-Jul-01 Forecast transaction Expenses:Books $10.00 $3290.00
-10-Aug-01 Forecast transaction Expenses:Books $10.00 $3300.00
-10-Sep-01 Forecast transaction Expenses:Books $10.00 $3310.00
-10-Oct-01 Forecast transaction Expenses:Books $10.00 $3320.00
-10-Nov-01 Forecast transaction Expenses:Books $10.00 $3330.00
-10-Dec-01 Forecast transaction Expenses:Books $10.00 $3340.00
-11-Jan-01 Forecast transaction Expenses:Books $10.00 $3350.00
-11-Feb-01 Forecast transaction Expenses:Books $10.00 $3360.00
-11-Mar-01 Forecast transaction Expenses:Books $10.00 $3370.00
-11-Apr-01 Forecast transaction Expenses:Books $10.00 $3380.00
-11-May-01 Forecast transaction Expenses:Books $10.00 $3390.00
-11-Jun-01 Forecast transaction Expenses:Books $10.00 $3400.00
-11-Jul-01 Forecast transaction Expenses:Books $10.00 $3410.00
-11-Aug-01 Forecast transaction Expenses:Books $10.00 $3420.00
-11-Sep-01 Forecast transaction Expenses:Books $10.00 $3430.00
-11-Oct-01 Forecast transaction Expenses:Books $10.00 $3440.00
-11-Nov-01 Forecast transaction Expenses:Books $10.00 $3450.00
-11-Dec-01 Forecast transaction Expenses:Books $10.00 $3460.00
-12-Jan-01 Forecast transaction Expenses:Books $10.00 $3470.00
-12-Feb-01 Forecast transaction Expenses:Books $10.00 $3480.00
-12-Mar-01 Forecast transaction Expenses:Books $10.00 $3490.00
+09-Apr-01 Forecast transaction Expenses:Books $10.00 $3130.00
+09-May-01 Forecast transaction Expenses:Books $10.00 $3140.00
+09-Jun-01 Forecast transaction Expenses:Books $10.00 $3150.00
+09-Jul-01 Forecast transaction Expenses:Books $10.00 $3160.00
+09-Aug-01 Forecast transaction Expenses:Books $10.00 $3170.00
+09-Sep-01 Forecast transaction Expenses:Books $10.00 $3180.00
+09-Oct-01 Forecast transaction Expenses:Books $10.00 $3190.00
+09-Nov-01 Forecast transaction Expenses:Books $10.00 $3200.00
+09-Dec-01 Forecast transaction Expenses:Books $10.00 $3210.00
+10-Jan-01 Forecast transaction Expenses:Books $10.00 $3220.00
+10-Feb-01 Forecast transaction Expenses:Books $10.00 $3230.00
+10-Mar-01 Forecast transaction Expenses:Books $10.00 $3240.00
+10-Apr-01 Forecast transaction Expenses:Books $10.00 $3250.00
+10-May-01 Forecast transaction Expenses:Books $10.00 $3260.00
+10-Jun-01 Forecast transaction Expenses:Books $10.00 $3270.00
+10-Jul-01 Forecast transaction Expenses:Books $10.00 $3280.00
+10-Aug-01 Forecast transaction Expenses:Books $10.00 $3290.00
+10-Sep-01 Forecast transaction Expenses:Books $10.00 $3300.00
+10-Oct-01 Forecast transaction Expenses:Books $10.00 $3310.00
+10-Nov-01 Forecast transaction Expenses:Books $10.00 $3320.00
+10-Dec-01 Forecast transaction Expenses:Books $10.00 $3330.00
+11-Jan-01 Forecast transaction Expenses:Books $10.00 $3340.00
+11-Feb-01 Forecast transaction Expenses:Books $10.00 $3350.00
+11-Mar-01 Forecast transaction Expenses:Books $10.00 $3360.00
+11-Apr-01 Forecast transaction Expenses:Books $10.00 $3370.00
+11-May-01 Forecast transaction Expenses:Books $10.00 $3380.00
+11-Jun-01 Forecast transaction Expenses:Books $10.00 $3390.00
+11-Jul-01 Forecast transaction Expenses:Books $10.00 $3400.00
+11-Aug-01 Forecast transaction Expenses:Books $10.00 $3410.00
+11-Sep-01 Forecast transaction Expenses:Books $10.00 $3420.00
+11-Oct-01 Forecast transaction Expenses:Books $10.00 $3430.00
+11-Nov-01 Forecast transaction Expenses:Books $10.00 $3440.00
+11-Dec-01 Forecast transaction Expenses:Books $10.00 $3450.00
+12-Jan-01 Forecast transaction Expenses:Books $10.00 $3460.00
+12-Feb-01 Forecast transaction Expenses:Books $10.00 $3470.00
+12-Mar-01 Forecast transaction Expenses:Books $10.00 $3480.00
+12-Apr-01 Forecast transaction Expenses:Books $10.00 $3490.00
>>>2
=== 0
diff --git a/test/regress/13965214.test b/test/regress/13965214.test
index c781e8bf..674d4d7d 100644
--- a/test/regress/13965214.test
+++ b/test/regress/13965214.test
@@ -24,7 +24,7 @@ Y2008
Income -140 0
08-Feb-20 C Bank 150 150
Income -150 0
-07-Mar-01 D Bank 160 160
+08-Mar-01 D Bank 160 160
Income -160 0
>>>2
=== 0