Commit graph

55 commits

Author SHA1 Message Date
Paul Beckingham
d0d8d5eece Duration
- Dropped support for parsing many intermediate representations. For example,
  this list:

   monthly, months, month, mnths, mths, mth, mos, mo

  is now reduced to:

    monthly, months, month, mo
2014-06-09 17:14:32 -04:00
Paul Beckingham
9693a724f2 CmdEdit
- Converted from OldDuration to Duration.
2014-05-28 23:55:20 -04:00
Paul Beckingham
07282d2343 Duration
- Missing include.
2014-05-28 23:36:59 -04:00
Paul Beckingham
117ade1609 Duration
- Duration inherits all of OldDuration's formatting capabilities.
- ::formatISO adds support for ISO8601 desginated period type.
2014-05-28 23:28:56 -04:00
Paul Beckingham
965284875c Duration
- Migrated methods and unit tests from OldDuration to Duration.
2014-05-28 22:41:29 -04:00
Paul Beckingham
9bfe40fac7 Lexer, Duration
- Merged libexpr code.
2014-01-02 00:55:53 -05:00
Paul Beckingham
d27451590a Duration Rename
- In preparation for a new (different) Duration object, the source files need
  to be renamed.
2014-01-02 00:12:28 -05:00
Paul Beckingham
773b55d374 Code Cleanup
- Removed L10N define.  It served its purpose.
2013-04-07 23:50:51 -04:00
Paul Beckingham
1dccd29643 Copyright 2013
- Updated copyright notices.
2013-03-04 17:47:12 -05:00
Paul Beckingham
330761e997 Blank Durations
- Instead of dispalying '-' for a zero-length duration, nothing is ('') is
  displayed instead.  This allows a completely empty duration column to be
  culled by the rc.print.empty.columns=no feature.
- Unit tests updated accordingly.
2013-02-24 14:26:52 -05:00
Paul Beckingham
23cd59a9a1 Chase warning due to the opaque type time_t in printf
Signed-off-by: Paul Beckingham <paul@beckingham.net>
2012-08-21 15:41:30 +01:00
Paul Beckingham
945127ad05 Portability
- Fixed warning that only appears on FreeBSD.
2012-08-21 11:11:55 +01:00
Paul Beckingham
57aa2de98c UDA
- Implemented UDAs in the 'edit' command for all four UDA data types.
2012-07-16 00:16:36 -04:00
Paul Beckingham
99b0c5568a Bug #972, #1018
- Fixed bug that accepted a recurrence duration of '7' as '7secs' instead
  of the intended '7days'.  It is now an error to omit the units.  Thanks to
  Vlad Zhivotnev, Stanley G.
- Modified unit tests to avoid a different error.
2012-07-08 14:24:39 -04:00
Paul Beckingham
2203d3364d Bug
- Fixed bug where '6 months' was interpreted as 180 days, but when rendered
  was shown as '5 months' (thanks to Aikido Guy).
- Multiple unit test corrections.
2012-04-04 18:42:11 -04:00
Paul Beckingham
96fe3f42ba Minor Refactoring
- Added support for more type-specific checks of attribute values.
- Added support for more type-specific attribute rendering.
- Improved generalized methods for checking columns in a report.
- Added unit tests.
- Minor code cleanup.
- Added secret hidden feature for internal testing.
2012-02-05 20:56:46 -05:00
Paul Beckingham
6580095002 Copyright
- Year change.
2012-01-02 23:32:10 -05:00
Federico Hernandez
8116c6a103 License
- moving task from GPL to MIT license
  top level src directory
2011-10-08 00:04:01 +02:00
Paul Beckingham
dab06f8672 Code Cleanup
- All objects now use the same convention for naming members.  The
  consistency is a good thing.
2011-08-25 21:54:28 -04:00
Paul Beckingham
257f5ab3da Bug #458
- Fixed bug #458, removing the ambiguous 'm' as a duration, leaving 'mi[nutes]'
  and 'mo[nths]' requiring at least two characters for a match.
2011-08-23 22:46:32 -04:00
Paul Beckingham
2f60bdf9d0 Bug #720
- Fixed bug #720, so that when the 'info' report renders total active time,
  it uses a lossless format (thanks to Bernhard B).
2011-08-23 22:15:00 -04:00
Paul Beckingham
6ed2bcd605 Durations
- Removed support for ' 1 wk', namely spaces before and after the ordinal.
  This removes (some) ambiguity in more complex command lines.
- Fixed unit tests accordingly.
2011-08-21 23:19:10 -04:00
Paul Beckingham
1714601ce4 Duration
- Allowed durations to be specified numerically as seconds, in string form.
  This flexibility allows the removal of special-case handling that stores
  recurrence periods in raw form ('monthly'), reducing code size.  As a
  consequence this means that recurrence may now be rendered according to
  Duration::formatCompact, which is desirable.
- Added supporting unit tests.
2011-08-21 13:32:55 -04:00
Paul Beckingham
08fcb5362e Bug - Durations
- Duration were parsed as <int><unit> in A3, whereas <number><unit> is
  correct.
- Added Nibbler::str method for internal access.
- Nibbler::save, ::restore now return positions.  Useful for extracting
  substrings.
- Modified countdown.t to use the (now) correct units for durations.
2011-08-17 00:45:09 -04:00
Paul Beckingham
ffa5bc43fe E9
- Working towards arg date/duration eval.
2011-08-06 00:59:14 -04:00
Paul Beckingham
f502ee0c52 Duration
- Implemented Duration::get_units to return the list of supported
  duration units (wk, week, weekly ...).
2011-07-24 13:15:27 -04:00
Paul Beckingham
a4eb390a04 Duration
- The "annual" and "yearly" options were listed twice.
2011-07-24 12:57:10 -04:00
Paul Beckingham
197524a5fc Expression
- Added configurable 'abbreviation.minimum' (default:2) setting to
  control how auto-completion works.
2011-07-20 10:51:13 -04:00
Paul Beckingham
8ff3a1675d Duration
- Implemented operator+=, operator-=.
- Added unit tests.
2011-07-04 14:22:33 -04:00
Paul Beckingham
fc793e7b1d Duration
- Implemented missing operator<=, operator>=.
- Added corresponding unit tests.
2011-07-04 13:34:20 -04:00
Paul Beckingham
fd484ee264 Feature
- The duration 'm' is now interpreted as 'months', not 'minutes'.
2011-06-30 18:35:54 -04:00
Paul Beckingham
c9cc43dc5f I18N
- Localized more files.
2011-06-25 23:32:40 -04:00
Paul Beckingham
c23c374b17 Duration
- Implemented operator- for us by the Variant.
2011-06-14 21:29:17 -04:00
Paul Beckingham
ffcc2a49d8 Duration
- Converted Duration::valid to a static method, to match Date.
2011-06-10 18:36:10 -04:00
Paul Beckingham
8fabffe18c Code Cleanup
- Eliminated '#include "x"' by changing all to '#include <x>'.
2011-05-28 00:19:59 -04:00
Paul Beckingham
d9b2ac0f33 Variant
- Salvaged Variant code from older project, for use in expression
  evaluation.
2011-04-05 23:47:09 -04:00
Paul Beckingham
462caf5bd4 Copyright
- Updated copyright to 2011.
2010-12-31 22:03:05 -05:00
Paul Beckingham
38ffa390ea Bug #542
- Fixed bug #542, which sorted the countdown columns incorrectly (thanks to
  Michelle Crane).
- Duration could not parse all varieties of it's own output, which is why the
  sorting was broken, in particular negative durations and real numbers in
  durations (such as (1.2y').
- Sorting in Table::sort_compare for Table::periodAscending and
  Table::periodDescending was broken.
- Missing unit tests for countdown_compact.
- Imported Nibbler::getNumber from the Attitash project.
- Additional Duration unit tests.
- Additional Nibbler unit tests.
- Additional countdown.t unit tests.
2010-11-26 14:00:49 -05:00
Paul Beckingham
44fe227595 Product Name Change
- Converted all (appropriate) uses of 'task' to 'taskwarrior'.
2010-08-21 12:31:00 -04:00
Paul Beckingham
123a46eef9 Enhancement/Fixes - Duration
- Reorganized Duration::valid and Duration::parse to use the same list
  of supported constructs.
- Added missing copy constructor.
- Added missing ctor initializer list.
- Corrected handling of negative time_t values.
- Added support for more duration formats.
- Corrected autoComplete use.
- Added Duration::negative.
- Corrected unit test descriptions.
2010-07-25 22:05:02 -04:00
Paul Beckingham
623f8d869e Portability
- Added missing includes.
2010-06-27 17:06:51 -04:00
Paul Beckingham
007c194c8c Bug #417 - Sorting by countdown_compact not working
- Added support for more varied durations when specifying recurring tasks,
  such as '3 mths' or '24 hrs'.
- Fixed bug #417, which caused sorting on countdown fields to be wrong
  (thanks to Michell Crane).
- Durations are now based on seconds, rather than days, and can accept/parse
  negative durations.
2010-06-27 13:44:04 -04:00
Paul Beckingham
9477660e02 Enhancement - Duration
- Relocated util/formatSeconds and util/formatSecondsCompact into
  Duration object.
- Relocated unit tests.
- Upgraded Duration object to use seconds, not days.
- Enhanced Duration so that it can now parse '4 mins' etc.
2010-06-27 00:57:52 -04:00
Paul Beckingham
1f8f4c631d Enhancement - Duration
- Durations can now parse '3 wks', '1 wk', '1w', and similar for yrs,
  qtrs, mths, wks, days.
- Added unit tests.
2010-06-26 21:47:52 -04:00
Paul Beckingham
9ce55bcf67 Copyright
- Updated the copyright notices to 2010, for the 1.9.0 release.
2009-12-27 12:39:42 -05:00
Paul Beckingham
2cf25b7c35 Code Cleanup
- Used the shorter form of std::string::substr that defaults the second
  argument to std::string::npos.
2009-12-13 16:59:28 -05:00
Paul Beckingham
fbb217538e Code Cleanup
- Removed unnecessary use of the scope resolution operator.
2009-11-17 22:34:28 -05:00
Paul Beckingham
8488cbd1a6 Bug Fix - #231 time_t/int collision on 32-bit systems
- Fixed bug #231 by removing the operator int () cast from the Duration
  class.  On a 32-bit system, "time_t" may be defined as "int", in
  which case the int cast and time_t cast are essentially duplicates.
  Thanks to Pietro Cerutti, who also provided a patch.
2009-07-26 16:11:14 -04:00
Paul Beckingham
cbecec263a Enhancement - all attribute modifiers working
- Implemented before, below, under, after, above, over.
2009-06-20 15:37:01 -04:00
Paul Beckingham
7e2da42f40 Bug Fix - due date, colorization
- Fixed bug that caused colorization to be way, way off.  Silly
  mistake.
- Fixed bug whereby due dates and durations were stored as-is, but
  should have been converted.
- On a related note, added Date::toEpochString,
  Duration::operator (std::string).
2009-06-17 22:52:04 -04:00