Commit graph

5850 commits

Author SHA1 Message Date
Tomas Babej
a1471b67fb CLI2: Do not attempt to evaluate values of string attributes 2021-01-30 21:40:41 -05:00
Jan Palus
9548bfdaba build: make sure internal libs are built as static
these libararies are not installed so don't leave the decision up to
enviroment which might build shared libraries resulting in binary
with missing deps after installation

Fixes #2403
2021-01-29 23:05:02 -05:00
Tomas Babej
2df80aac01 CmdCalendar: Default to current month if no due date is present
Previously, if no due date was set on any pending/waiting task, the
calendar output would start at the end of the currently supported date
period.

Default to current month instead.
2021-01-24 10:51:14 -05:00
Tomas Babej
0234cd8122 CmdCalendar: Support due dates up to year 9999 2021-01-24 10:51:14 -05:00
Tomas Babej
22228547ca CmdCalendar: Consider waiting status equivalent to pending for purposes of display
The purpose of displaying due dates on the calendar is to convey the
relative business of any given day. Waiting status signifies a task
should not be displayed in reports yet, but for the purposes of
planning, it should be displayed in the calendar overview.

Closes #2393.
2021-01-24 10:51:14 -05:00
Tomas Babej
05e7c2aff2 Lexer: Do not allow leading zero for two and more digit integers 2021-01-24 03:08:10 -05:00
Tomas Babej
6a33bb8656 Lexer: Do not allow leading zero for number type 2021-01-24 03:08:10 -05:00
Tomas Babej
5aa3073703 libshared: Bump libshared to extend Duration value support 2021-01-18 02:59:11 -05:00
Tomas Babej
ef1e889262 ColTypeDate: Do not explicitly add now to relative dates
Relative dates are now implicitly anchored around now datetime point
during casting, hence there is no reason to do this anymore.
2021-01-18 02:59:11 -05:00
Tomas Babej
5e0fc1caab Variant: Ensure implmentation of addition/subtraction of dates/durations does not involve casting
Implicit casting of a duration anchors it around the 'now' point in
time, which would throw off the conversion.
2021-01-18 02:59:11 -05:00
Tomas Babej
7242accb58 Variant: Convert durations into dates as implicitly anchored around now
The _period attribute holds the number of seconds that the Duration
holds, while _date attribute holds the number of seconds since the
beginning of unix epoch (also known as epoch time). As such, it does not
make sense to convert _period directly into _date.

Interpret _period as offset relative to current unix epoch time.

Closes #2390.
2021-01-18 02:59:11 -05:00
Tomas Babej
1855d2c729
libshared: Bump version 2021-01-16 18:47:40 -05:00
indev
098be0747d fix: remove lock file on interruption of 'task edit' (#2292) 2021-01-14 18:16:34 -05:00
Jochen Sprickerhof
663c6575ce Use str_replace from libshared 2021-01-07 22:37:04 -05:00
Jochen Sprickerhof
a95205357c Support editing multi-line annotations (Closes: #2283)
Since e4b9c1f annotations where JSON encoded in task edit to escape
new lines (\n). But other strings where mangled as well, like https://
becoming https:\/\/, making it hard to edit.

This patch removes the JSON encoding and indents new lines instead.
2021-01-07 22:37:04 -05:00
Tomas Babej
9017cd6e53
doc: Update copyright to 2021 2021-01-02 02:48:22 -05:00
Tomas Babej
2ebf4b864d
ColTypeNumeric: Support date and duration variants
If the lexer identifies an expression as an date or a duration, it
should be re-cast into integer value.

Closes #2101.
2021-01-02 00:21:02 -05:00
Tomas Babej
a641e4315f
Variant: Support 64-bit numeric values
Closes #2101.
2021-01-01 23:57:34 -05:00
Tomas Babej
1a001caedd
Task: Prevent double json-decoding of attribute values
In bd4a7081, json-decoding of attribute values was introduced as a
workaround to properly handle blackslashes in description and
annotations (see TW-880).

However, this behaviour is no longer present with the new parser and
introduces its own suite of issues (i.e. see #2140).

Closes #2140.
2020-12-31 14:23:55 -05:00
Tomas Babej
6ff63286b5
CmdInfo: Properly format date and duration UDAs
The 'type' variable was never assigned value, hence the checking for
'date' and/or 'duration' always failed. Use col->type() instead.

Closes #2060.
2020-12-28 20:36:32 -05:00
Tomas Babej
6bbfcba738
libshared: Support Datetime values until year 9999
Closes #2373.
2020-12-28 01:34:41 -05:00
Tomas Babej
9ed047d46d
Task: Support setting 64-bit integer values
Thanks to Stephan Rieche.
2020-12-27 21:29:15 -05:00
Tomas Babej
e6edac7edd
build: Update libshared to version supporting Unicode 11
Closes #2333.
2020-12-20 15:27:28 -05:00
Tomas Babej
982308412d
libshared: Updated to 418a1873aea42f0ed719218628b0ee166b2c281c 2020-12-14 22:37:13 -05:00
Tomas Babej
e37ab8a9ed
rules: Reduce code duplication 2020-12-14 22:35:38 -05:00
Tomas Babej
2336c4039d
rules: Mark coloring implementations that are not consistent with their corresponding virtual tags 2020-12-14 22:35:37 -05:00
Tomas Babej
2adc5994d5
rules: Make colorizeOverdue properly process dateEarlierToday date state
This makes the coloring implementation consistent with the
Task::is_overdue() method.

Closes #1998.
2020-12-14 22:35:37 -05:00
Tomas Babej
fbf8fe688e
CmdCalendar: Properly colorize overdue task from today
Even if task is due today, but the due time is in the past, it is
considered overdue according to the implementation of Task::is_overdue
method.

Make coloring in the calendar output consistent.
2020-12-14 22:35:36 -05:00
Tomas Babej
bfae79eac7
CmdCalendar: Remove accidental repeated blending 2020-12-14 22:35:35 -05:00
Tomas Babej
eb32c9d8d7
Context: Correctly handle XDG_CONFIG_HOME paths ending with '/' 2020-12-10 23:49:00 -05:00
Tomas Babej
f0e34a7ef7
Context: Do not append .config if XDG_CONFIG_HOME is defined
- Thanks to Julien Rabinow.
2020-12-10 23:34:59 -05:00
Tomas Babej
5dc42df7d0
Context: Correctly respect empty XDG_CONFIG_HOME 2020-12-09 21:21:17 -05:00
Tomas Babej
1f98b9d128
Context: Adjust styling 2020-12-09 20:35:13 -05:00
Julien Rabinow
5256797ea9 add support for XDG_CONFIG_HOME 2020-12-09 20:15:22 -05:00
Julien Rabinow
46b553dd8c reorder code to be in same order as comments (intuitive order) 2020-12-09 20:15:22 -05:00
Julien Rabinow
1aa77c9ede fix home_dir variable definition 2020-12-09 20:15:22 -05:00
Tomas Babej
fcfe01f301
recur: Prevent infinite loops with 0 periods
Specifying a recurrence interval that amounts to a zero, like 'P0M', 0q
or 0m causes task to fall into an infinite loop when trying to determine
next recurrence dates.

Detect scenarios with zero-length recurrence interval and throw an
exception.

Closes #2262.
2020-12-06 20:58:26 -05:00
Paul Beckingham
3e0a428185 Revert "[clang-tidy] Use .empty instead of comparing size"
This reverts commit a331cceded.
2020-12-05 16:18:37 -05:00
Paul Beckingham
b2d46a1eba Revert "[clang-tidy] Use auto where the type is known"
This reverts commit 6ce2a129dd.
2020-12-05 16:18:37 -05:00
Paul Beckingham
0a3a4d364d Revert "[clang-tidy] Use new range based loops"
This reverts commit a468537c1b.
2020-12-05 16:18:37 -05:00
Paul Beckingham
e3e158bf6a Revert "[clang-tidy] Replace push_back with emplace_back"
This reverts commit 897759e4dc.
2020-12-05 16:18:37 -05:00
Paul Beckingham
ead50d4d6e Revert "[clang-tidy] Use default to initialize constructors"
This reverts commit bf40ea8816.
2020-12-05 16:18:37 -05:00
Paul Beckingham
aa841f98c9 Revert "[clang-tidy] Add const where it makes sense"
This reverts commit defd49b13d.
2020-12-05 16:18:37 -05:00
Paul Beckingham
2652a9d3f1 Revert "[clang-tidy] Add const references where useful"
This reverts commit 37b641259c.
2020-12-05 16:18:37 -05:00
Paul Beckingham
8cf4e3de08 Revert "[clang-tidy] Access static member through qualified-id"
This reverts commit 6cd15235be.
2020-12-05 16:18:37 -05:00
Paul Beckingham
504aacd244 Revert "[clang-tidy] Pass by value with std::move"
This reverts commit e46039efb1.
2020-12-05 16:18:37 -05:00
Paul Beckingham
5502729131 Revert "[clang-tidy] Switch C headers to C++ ones"
This reverts commit 0344856d65.
2020-12-05 16:18:37 -05:00
Paul Beckingham
444e5955ac Revert "[clang-tidy] Convert 0/1 to false/true"
This reverts commit 54e40008c9.
2020-12-05 16:18:37 -05:00
Paul Beckingham
0b828be4aa Revert "[clang-tidy] Remove redundant init"
This reverts commit cc6826fc3a.
2020-12-05 16:18:37 -05:00
Paul Beckingham
9016c26828 Revert "[cl;ang-tidy] Don't initialize strings"
This reverts commit 426e067f43.
2020-12-05 16:18:37 -05:00