From 03cb5af7be534d436140481f1180825561b0bfc4 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sat, 30 Mar 2013 17:42:45 -0400 Subject: [PATCH] Defaults - The 'dateformat' settings now default to the ISO-8601 standard of 'Y-M-D'. --- ChangeLog.230 | 1 + NEWS | 1 + doc/man/taskrc.5.in | 15 ++++++++------- src/Config.cpp | 10 +++++----- test/annotate.t | 3 ++- test/bug.1036.t | 3 ++- test/bug.368.t | 2 +- test/bug.628.t | 2 +- test/bug.annual.t | 3 ++- test/bug.before.t | 3 ++- test/bug.range.t | 3 ++- test/color.due.t | 3 ++- test/color.duetoday.t | 3 ++- test/color.overdue.t | 3 ++- test/date.iso.t | 2 +- test/default.t | 3 ++- test/denotate.t | 3 ++- test/import.t | 3 ++- test/import.yaml.t | 3 ++- test/roundtrip.t | 3 ++- test/sequence.t | 3 ++- test/uda_date.t | 3 ++- test/uuid.t | 3 ++- 23 files changed, 50 insertions(+), 31 deletions(-) diff --git a/ChangeLog.230 b/ChangeLog.230 index 2be965cc3..f0734186b 100644 --- a/ChangeLog.230 +++ b/ChangeLog.230 @@ -13,6 +13,7 @@ Features + Adds a new 'sync' verbosity token, which will reminds when a backlog builds up and needs a sync. + Supports IPv4 and IPv6 server addresses. + + The 'dateformat' settings now default to the ISO-8601 standard of 'Y-M-D'. Bugs + Fixed bug #1197 so that 'tasksh' now recognized Ctrl-D to exit. diff --git a/NEWS b/NEWS index cc8c819eb..da9869274 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,7 @@ New Features in taskwarrior 2.3.0 - New task server sync capabilities. - New shell with Readline support. + - The 'dateformat' settings now default to the ISO-8601 standard of 'Y-M-D'. New commands in taskwarrior 2.3.0 diff --git a/doc/man/taskrc.5.in b/doc/man/taskrc.5.in index 3c3ec2fce..607f80160 100644 --- a/doc/man/taskrc.5.in +++ b/doc/man/taskrc.5.in @@ -468,19 +468,19 @@ Enables the extension system. Defaults to on. .SS DATES .TP -.B dateformat=m/d/Y +.B dateformat=Y-M-D .TP -.B dateformat.report=m/d/Y +.B dateformat.report= .TP .B dateformat.holiday=YMD .TP -.B dateformat.edit=m/d/Y H:N:S +.B dateformat.edit=Y-M-D H:N:S .TP -.B dateformat.info=m/d/Y H:N:S +.B dateformat.info=Y-M-D H:N:S .TP -.B dateformat.annotation=m/d/Y +.B dateformat.annotation= .TP -.B report.X.dateformat=m/d/Y +.B report.X.dateformat=Y-M-D This is a string of characters that defines how taskwarrior formats date values. The precedence order for the configuration variable is report.X.dateformat then dateformat.report then dateformat for formating the due dates in reports. @@ -489,7 +489,8 @@ will be applied to the date. Entered dates as well as all other displayed dates in reports are formatted according to dateformat. -The default value is: m/d/Y. The string can contain the characters: +The default value is the ISO-8601 standard: Y-M-D. The string can contain the +characters: .RS .RS diff --git a/src/Config.cpp b/src/Config.cpp index a21def780..1adfa5c0d 100644 --- a/src/Config.cpp +++ b/src/Config.cpp @@ -108,12 +108,12 @@ std::string Config::_defaults = "abbreviation.minimum=2 # Shortest allowed abbreviation\n" "\n" "# Dates\n" - "dateformat=m/d/Y # Preferred input and display date format\n" + "dateformat=Y-M-D # Preferred input and display date format\n" "dateformat.holiday=YMD # Preferred input date format for holidays\n" - "dateformat.edit=m/d/Y H:N:S # Preferred display date format when editing\n" - "dateformat.info=m/d/Y H:N:S # Preferred display date format for information\n" - "dateformat.report=m/d/Y # Preferred display date format for reports\n" - "dateformat.annotation=m/d/Y # Preferred display date format for annotations\n" + "dateformat.edit=Y-M-D H:N:S # Preferred display date format when editing\n" + "dateformat.info=Y-M-D H:N:S # Preferred display date format for information\n" + "dateformat.report= # Preferred display date format for reports\n" + "dateformat.annotation= # Preferred display date format for annotations\n" "weekstart=Sunday # Sunday or Monday only\n" "displayweeknumber=yes # Show week numbers on calendar\n" "due=7 # Task is considered due in 7 days\n" diff --git a/test/annotate.t b/test/annotate.t index 01c58104b..d055ba1c0 100755 --- a/test/annotate.t +++ b/test/annotate.t @@ -40,7 +40,8 @@ if (open my $fh, '>', 'annotate.rc') "report.rrr.description=rrr\n", "report.rrr.columns=id,description\n", "report.rrr.sort=id+\n", - "color=off\n"; + "color=off\n", + "dateformat=m/d/Y\n"; close $fh; ok (-r 'annotate.rc', 'Created annotate.rc'); } diff --git a/test/bug.1036.t b/test/bug.1036.t index 782f56ded..18a8bb499 100755 --- a/test/bug.1036.t +++ b/test/bug.1036.t @@ -33,7 +33,8 @@ use Test::More tests => 4; # Create the rc file. if (open my $fh, '>', 'bug.rc') { - print $fh "data.location=.\n"; + print $fh "data.location=.\n", + "dateformat=m/d/Y\n"; close $fh; ok (-r 'bug.rc', 'Created bug.rc'); } diff --git a/test/bug.368.t b/test/bug.368.t index db0f0926a..2b2a3c9b0 100755 --- a/test/bug.368.t +++ b/test/bug.368.t @@ -34,7 +34,7 @@ use Test::More tests => 4; if (open my $fh, '>', 'bug.rc') { print $fh "data.location=.\n", - "dateformat=m/d/Y\n", + "dateformat.info=m/d/Y\n", "confirmation=no\n"; close $fh; ok (-r 'bug.rc', 'Created bug.rc'); diff --git a/test/bug.628.t b/test/bug.628.t index d3ff20f94..ddfa0ada7 100755 --- a/test/bug.628.t +++ b/test/bug.628.t @@ -47,7 +47,7 @@ qx{../src/task rc:bug.rc add wait:\\"Wed Jan 01 2020\\" A buggy task 2>&1}; # Result: Immediately delete the created task my $output = qx{../src/task rc:bug.rc waiting 2>&1}; -like ($output, qr/1\/1\/2020/ms, 'a b D Y dateformat correctly parsed.'); +like ($output, qr/Jan 01 2020/ms, 'a b D Y dateformat correctly parsed.'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data bug.rc); diff --git a/test/bug.annual.t b/test/bug.annual.t index 0cc8191ce..83edc9feb 100755 --- a/test/bug.annual.t +++ b/test/bug.annual.t @@ -33,7 +33,8 @@ use Test::More tests => 13; # Create the rc file. if (open my $fh, '>', 'annual.rc') { - print $fh "data.location=.\n"; + print $fh "data.location=.\n", + "dateformat=m/d/Y\n"; close $fh; ok (-r 'annual.rc', 'Created annual.rc'); } diff --git a/test/bug.before.t b/test/bug.before.t index cd7e3046b..e10fab9ab 100755 --- a/test/bug.before.t +++ b/test/bug.before.t @@ -36,7 +36,8 @@ if (open my $fh, '>', 'before.rc') { print $fh "data.location=.\n", "confirmation=no\n", - "dateformat=m/d/Y\n"; + "dateformat=m/d/Y\n", + "dateformat.info=m/d/Y\n"; close $fh; ok (-r 'before.rc', 'Created before.rc'); } diff --git a/test/bug.range.t b/test/bug.range.t index 6fda24427..6adb4752a 100755 --- a/test/bug.range.t +++ b/test/bug.range.t @@ -34,7 +34,8 @@ use Test::More tests => 5; if (open my $fh, '>', 'range.rc') { print $fh "data.location=.\n", - "confirmation=no\n"; + "confirmation=no\n", + "dateformat=m/d/Y\n"; close $fh; ok (-r 'range.rc', 'Created range.rc'); } diff --git a/test/color.due.t b/test/color.due.t index 3fb83a4e2..b96bb916b 100755 --- a/test/color.due.t +++ b/test/color.due.t @@ -35,7 +35,8 @@ if (open my $fh, '>', 'color.rc') { print $fh "data.location=.\n", "color.due=red\n", - "_forcecolor=1\n"; + "_forcecolor=1\n", + "dateformat=m/d/Y\n"; close $fh; ok (-r 'color.rc', 'Created color.rc'); } diff --git a/test/color.duetoday.t b/test/color.duetoday.t index e74222c48..c8e7d68ce 100755 --- a/test/color.duetoday.t +++ b/test/color.duetoday.t @@ -35,7 +35,8 @@ if (open my $fh, '>', 'color.rc') { print $fh "data.location=.\n", "color.due.today=red\n", - "_forcecolor=1\n"; + "_forcecolor=1\n", + "dateformat=m/d/Y\n"; close $fh; ok (-r 'color.rc', 'Created color.rc'); } diff --git a/test/color.overdue.t b/test/color.overdue.t index 3ddd8297c..49d626dc9 100755 --- a/test/color.overdue.t +++ b/test/color.overdue.t @@ -35,7 +35,8 @@ if (open my $fh, '>', 'color.rc') { print $fh "data.location=.\n", "color.overdue=red\n", - "_forcecolor=1\n"; + "_forcecolor=1\n", + "dateformat=m/d/Y\n"; close $fh; ok (-r 'color.rc', 'Created color.rc'); } diff --git a/test/date.iso.t b/test/date.iso.t index d1eca0234..d1a7dfe9e 100755 --- a/test/date.iso.t +++ b/test/date.iso.t @@ -34,7 +34,7 @@ use Test::More tests => 4; if (open my $fh, '>', 'iso.rc') { print $fh "data.location=.\n", - "dateformat=m/d/Y\n"; + "dateformat.info=m/d/Y\n"; close $fh; ok (-r 'iso.rc', 'Created iso.rc'); } diff --git a/test/default.t b/test/default.t index cebe9e83e..b591a78ab 100755 --- a/test/default.t +++ b/test/default.t @@ -37,7 +37,8 @@ if (open my $fh, '>', 'default.rc') "default.command=list\n", "default.project=PROJECT\n", "default.priority=M\n", - "default.due=eom\n"; + "default.due=eom\n", + "dateformat=m/d/Y\n"; close $fh; ok (-r 'default.rc', 'Created default.rc'); } diff --git a/test/denotate.t b/test/denotate.t index 9b44d822a..dbae50684 100755 --- a/test/denotate.t +++ b/test/denotate.t @@ -39,7 +39,8 @@ if (open my $fh, '>', 'denotate.rc') "confirmation=off\n", "report.rrr.description=rrr\n", "report.rrr.columns=id,description\n", - "report.rrr.sort=id+\n"; + "report.rrr.sort=id+\n", + "dateformat=m/d/Y\n"; close $fh; ok (-r 'denotate.rc', 'Created denotate.rc'); } diff --git a/test/import.t b/test/import.t index 2dcfd80f8..3108190ec 100755 --- a/test/import.t +++ b/test/import.t @@ -33,7 +33,8 @@ use Test::More tests => 13; # Create the rc file. if (open my $fh, '>', 'import.rc') { - print $fh "data.location=.\n"; + print $fh "data.location=.\n", + "dateformat=m/d/Y\n"; close $fh; ok (-r 'import.rc', 'Created import.rc'); } diff --git a/test/import.yaml.t b/test/import.yaml.t index 5d50668fa..135d9335f 100755 --- a/test/import.yaml.t +++ b/test/import.yaml.t @@ -33,7 +33,8 @@ use Test::More tests => 16; # Create the rc file. if (open my $fh, '>', 'import.rc') { - print $fh "data.location=.\n"; + print $fh "data.location=.\n", + "dateformat=m/d/Y\n"; close $fh; ok (-r 'import.rc', 'Created import.rc'); } diff --git a/test/roundtrip.t b/test/roundtrip.t index fcd7e8b6e..b2cd1a734 100755 --- a/test/roundtrip.t +++ b/test/roundtrip.t @@ -36,7 +36,8 @@ if (open my $fh, '>', 'roundtrip.rc') print $fh "data.location=.\n", "verbose=off\n", "confirmation=no\n", - "defaultwidth=100\n"; + "defaultwidth=100\n", + "dateformat=m/d/Y\n"; close $fh; ok (-r 'roundtrip.rc', 'Created roundtrip.rc'); } diff --git a/test/sequence.t b/test/sequence.t index b71cd35d7..10e2adc02 100755 --- a/test/sequence.t +++ b/test/sequence.t @@ -34,7 +34,8 @@ use Test::More tests => 26; if (open my $fh, '>', 'seq.rc') { print $fh "data.location=.\n", - "confirmation=off\n"; + "confirmation=off\n", + "dateformat.annotation=m/d/Y\n"; close $fh; ok (-r 'seq.rc', 'Created seq.rc'); } diff --git a/test/uda_date.t b/test/uda_date.t index 5eacfda34..2430f0c0a 100755 --- a/test/uda_date.t +++ b/test/uda_date.t @@ -40,7 +40,8 @@ if (open my $fh, '>', 'uda.rc') "report.uda.description=UDA Test\n", "report.uda.columns=id,extra,description\n", "report.uda.sort=extra,description\n", - "report.uda.labels=ID,Extra,Description\n"; + "report.uda.labels=ID,Extra,Description\n", + "dateformat=m/d/Y\n"; close $fh; ok (-r 'uda.rc', 'Created uda.rc'); } diff --git a/test/uuid.t b/test/uuid.t index 12bd849a8..ab2cac603 100755 --- a/test/uuid.t +++ b/test/uuid.t @@ -33,7 +33,8 @@ use Test::More tests => 26; # Create the rc file. if (open my $fh, '>', 'uuid.rc') { - print $fh "data.location=.\n"; + print $fh "data.location=.\n", + "dateformat=m/d/Y\n"; close $fh; ok (-r 'uuid.rc', 'Created uuid.rc'); }