Commit graph

77 commits

Author SHA1 Message Date
Martin Michlmayr
fafd7c1346 Check whether a month is followed by a year
Bug fix for #375
2014-05-30 18:27:22 -04:00
Alexis Hildebrandt
2b9208e850 Bump copyright information to 2014 2014-02-02 12:36:22 +01:00
Tim Crews
0dbb38fe27 Source changes needed for Microsoft Visual C++ compatibility.
Includes an implementation of strptime, compiled only for Win32 platform.
2013-06-14 21:29:47 -07:00
John Wiegley
0951bcebef Bump copyright information to 2013 2013-02-18 06:51:21 -06:00
John Wiegley
4681e58d7f Converted the Ledger build system to use CMake 2012-05-20 04:48:05 -05:00
John Wiegley
f4f3058b8c Switch to using Boost.Format 2012-05-14 21:44:00 -06:00
John Wiegley
32eaa03469 Fixed a hidden memory corruption bug 2012-05-14 21:41:38 -06:00
John Wiegley
e2a22cb8c2 Allow --input-date-format to specify separators
Fixes #650
2012-03-19 03:51:07 -05:00
John Wiegley
e2afc783db Increased file copyrights to 2012 2012-02-29 22:32:23 -06:00
John Wiegley
5517871144 Corrected problem with parsing of leap days 2012-02-28 21:19:36 -06:00
John Wiegley
6adfcc8469 Rewrite the way interval reports are generated 2012-02-28 02:34:37 -06:00
John Wiegley
887f429ae4 Added debug code for debugging interval reports 2012-02-28 01:37:29 -06:00
John Wiegley
a19b541dd9 Removed unneeded default cases 2012-02-17 15:15:32 -06:00
John Wiegley
24a993cf00 Fixes for variable shadowing (27/28) 2012-02-17 15:06:30 -06:00
John Wiegley
8f8275733c Fixes for variable shadowing (26/28) 2012-02-17 15:06:29 -06:00
John Wiegley
f0791bbd72 Cleanup whitespace 2011-08-18 14:48:38 -04:00
John Wiegley
add6f6ca2a Removed unused variables 2011-08-18 14:46:36 -04:00
John Wiegley
365188a1e2 Clarified an #ifdef 2011-04-11 23:40:36 -05:00
John Wiegley
0be39fce6a Parse %m/%d/%Y %H:%M:%S as an input date/time
This is to support reading of Timelog files.
2010-12-04 12:51:40 -05:00
John Wiegley
fcfa491485 Improvements to time period parsing
Things like "since last month" and "4 weeks ago", and "since 4 weeks
ago" are now all working.
2010-06-21 17:02:48 -04:00
John Wiegley
d15bb66ee4 Added missing call to resolve_end() in find_period 2010-06-20 20:29:56 -04:00
John Wiegley
470730c92d --input-date-format now affects dates with times 2010-06-20 18:37:14 -04:00
John Wiegley
63b4bdaecf Support period expressions "this/next/last week" 2010-06-14 08:14:48 -04:00
John Wiegley
d9d04f62a3 Allow period exprs "from today", "until tomorrow" 2010-06-14 08:04:40 -04:00
John Wiegley
c4e908915c Support period expressions like "last 4 weeks" 2010-06-14 07:56:21 -04:00
John Wiegley
904fff97d0 Fix to allow time periods like "every 14 days" 2010-06-14 07:30:24 -04:00
John Wiegley
dcffd218a1 Revised how Ledger handles the "current year"
Now when the Y directive sets the current year for a region, it affects
everything, as if the clock really were set back to that year.
2010-06-14 03:23:09 -04:00
John Wiegley
ead42c27e3 Added a missing break statement
This broke the meaning of -p "this month".
2010-06-13 23:09:01 -04:00
John Wiegley
9effdb3aa2 Option --input-date-format adds to candidate list 2010-06-13 01:03:47 -04:00
John Wiegley
dea2aed0b5 Untabified all source files 2010-06-11 17:02:25 -04:00
John Wiegley
b848ace768 Allow opt -NDEBUG build to complete without warnings 2010-06-04 06:02:00 -04:00
John Wiegley
e0c5f6db30 Fixed two memory reference errors 2010-06-02 00:27:35 -04:00
John Wiegley
c645ac1de7 If FMT_CUSTOM is given, and no format, use FMT_PRINTED 2010-05-22 22:04:26 -04:00
John Wiegley
3e1ec40551 Report an error for incorrect dates like 2010/04/32
Fixes EF57C685-2C18-49A1-9A8C-FB3BE6F99C41
2010-05-22 21:35:02 -04:00
John Wiegley
ab416f759f Updated copyrights to 2003-2010 2010-03-05 22:14:10 -05:00
John Wiegley
590ba76bd1 Restore "-p this" option (aka -p 'this month') 2010-01-21 04:33:56 -05:00
John Wiegley
d176abf625 Fix for date parsing when no year is given 2010-01-16 21:12:13 -05:00
John Wiegley
8c18f66dec Don't rely on the integral value of a boolean 2009-11-20 18:03:35 -05:00
John Wiegley
6cd0ba584e Guarded some debug code 2009-11-18 05:50:21 -05:00
John Wiegley
e4b3f0bb3a The new period parser is passing all tests 2009-11-18 05:45:48 -05:00
John Wiegley
7fe369eb49 The new period parser is implemented, but untested 2009-11-18 04:11:14 -05:00
John Wiegley
fe9af7ace7 Added a "range" member to date_interval_t
This is used to define the beginning/ending ranges of the time period,
before it becomes fixed (by calling stabilize()) and then sets the
values of start and end.
2009-11-18 01:28:01 -05:00
John Wiegley
3e91c3bf2c Added several new types for working with dates and ranges
date_specifier_t ::
    This is like a plain date_t, except it knows what wasn't specified.
    For example, if 2008/06 is parsed, it becomes date_specifier_t which
    knows that no day was given.  If you ask for the begin() date of the
    specifier, it will be 2008/06/01; the end() date (which is
    exclusive) will be 2008/07/01.

  date_range_t ::
    A date range is a range of two specifiers, either of which (but not
    both) may be omitted.  This makes it possible to represent
    expressions like "from june to july", where no day or year is given.
    The exact dates will be inferred by using the current year, and
    fixing the range from YEAR/06/01 to YEAR/07/01.  That is, the range
    goes from the begin() of one date specifier to the begin() of the
    other.

  date_specifier_or_range_t ::
    A variadic type that can be either a date_specifier_t or a
    date_range_t.  It's just a wrapper to represent the fact that ranges
    can be implicit via specifiers (such as, "in june"), or explicit via
    ranges ("since 2008").
2009-11-17 22:23:46 -05:00
John Wiegley
d6cb382b20 Moved date_interval_t::duration_t to date_duration_t 2009-11-17 22:12:17 -05:00
John Wiegley
a866f39210 Added a date_traits_t type 2009-11-17 22:03:32 -05:00
John Wiegley
c28d828d8e Renamed date_interval_t::end to finish 2009-11-17 21:51:51 -05:00
John Wiegley
2986bc779e Stylistic change: assert(0) -> assert(false) 2009-11-13 01:48:32 -05:00
John Wiegley
4a249d6172 Fixed issues with period strings like "2009/10" 2009-11-02 01:59:24 -05:00
John Wiegley
3a9b7df4e5 date_interval_t now uses a duration_t object
This is instead of using boost::variant.
2009-10-30 18:03:26 -04:00
John Wiegley
ab433d28e0 Support a --now option, for testing purposes
This sets Ledger's notion of the "current time" to the given date.  This
makes it possible to have stable output from budgeting and forecasting
reports, for the sake of baseline tests.
2009-10-27 21:32:55 -04:00