summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorplgruener <pl.gruener@gmail.com>2017-11-05 19:02:33 +0100
committerJonas Fonseca <jonas.fonseca@gmail.com>2018-05-19 21:10:06 -0400
commitc0df4500e0dacd2c59a81963a3aa1dddb37db148 (patch)
tree0a665fad7c7f3e153aee2d3645260293eb1fc3d2
parent5cbff8b8f56a7902040a14349b5bc35bd3740c70 (diff)
Adjust case of reldate letters according to ISO-8601
This commit fixes the wrong use of 'm' for month and 'M' for minute: In ISO-8601, uppercase letters YYYY-MM-DD are used to denote year,month,week,day; whereas lowercase letters hh:mm:ss are used for hour,minute,second. Closes #759
-rw-r--r--NEWS.adoc1
-rw-r--r--src/util.c10
-rwxr-xr-xtest/main/date-test48
3 files changed, 30 insertions, 29 deletions
diff --git a/NEWS.adoc b/NEWS.adoc
index deb0681f..bf89eec5 100644
--- a/NEWS.adoc
+++ b/NEWS.adoc
@@ -12,6 +12,7 @@ Improvements:
- Change the blame view to render more like `git blame`. (GH #812)
- Improve worktree and submodule support. (GH #459, #781, #783)
- Support running Tig via a Git alias. (GH #763)
+ - Use ISO-8601 letters for short relative dates. (GH #759)
Bug fixes:
diff --git a/src/util.c b/src/util.c
index 0684a2a9..47e8207d 100644
--- a/src/util.c
+++ b/src/util.c
@@ -133,12 +133,12 @@ struct reldate {
static const struct reldate reldate[] = {
{ "second", 's', 1, 60 * 2 },
- { "minute", 'M', 60, 60 * 60 * 2 },
+ { "minute", 'm', 60, 60 * 60 * 2 },
{ "hour", 'h', 60 * 60, 60 * 60 * 24 * 2 },
- { "day", 'd', 60 * 60 * 24, 60 * 60 * 24 * 7 * 2 },
- { "week", 'w', 60 * 60 * 24 * 7, 60 * 60 * 24 * 7 * 5 },
- { "month", 'm', 60 * 60 * 24 * 30, 60 * 60 * 24 * 365 },
- { "year", 'y', 60 * 60 * 24 * 365, 0 },
+ { "day", 'D', 60 * 60 * 24, 60 * 60 * 24 * 7 * 2 },
+ { "week", 'W', 60 * 60 * 24 * 7, 60 * 60 * 24 * 7 * 5 },
+ { "month", 'M', 60 * 60 * 24 * 30, 60 * 60 * 24 * 365 },
+ { "year", 'Y', 60 * 60 * 24 * 365, 0 },
};
static const char *
diff --git a/test/main/date-test b/test/main/date-test
index d7cdfde5..694e5f64 100755
--- a/test/main/date-test
+++ b/test/main/date-test
@@ -126,30 +126,30 @@ EOF
assert_equals 'relative-compact-date.screen' <<EOF
25h Kentaro Wada Add zsh completion file for autoload
-7d Jonas Fonseca Refactor DEFINE_ALLOCATOR to use helper method and asser
-1m Sven Wegener display: factor out separator functions
-8d Jonas Fonseca Merge pull request #429 from ideal/master
-13d ideal check if mem is NULL in DEFINE_ALLOCATOR
-2m Jonas Fonseca Use git_init to initialize the test/stage/gh-410-test re
-4m Jonas Fonseca Keep unstaged changes view open after an staging command
-5m Jonas Fonseca When redrawing the readline prompt also update the curso
-6m Jonas Fonseca Move script helper before usages in the display module
-7m Jonas Fonseca Merge branch 'hashed-refs'
-9m Jonas Fonseca hashed-refs: Use a hash table as the main data structure
-9m Jonas Fonseca Unify option_info lookup for normal options and view col
-10m Jonas Fonseca Add option to turn off automatic enabling of topo-order
-11m Tom Greuter Add option to install Tig with Homebrew
-12m Jonas Fonseca Fix diff context restoring for diff opened directly via
-1y Michael Barlow Add mouse support
-2y Jonas Fonseca Refactor stage view title formatting
-3y Jonas Fonseca [GH #83] WIP: main view lazy navigation mode prototype
-3y P. Sadik Create and use dup() of STDIN_FILENO instead of STDIN_FI
-4y Jonathan Neuschäfer Don't show out-of-sight tildes
-5y Pierre Habouzit Add an option to ignore unknown directories contents in
-6y Jonas Fonseca Fix another regression from the dirty flag changes causi
-7y Jonas Fonseca tig-0.10.git
-8y Jonas Fonseca Only split the tree view when the tree view is visible
-9y Jonas Fonseca Initial commit
+7D Jonas Fonseca Refactor DEFINE_ALLOCATOR to use helper method and asser
+1M Sven Wegener display: factor out separator functions
+8D Jonas Fonseca Merge pull request #429 from ideal/master
+13D ideal check if mem is NULL in DEFINE_ALLOCATOR
+2M Jonas Fonseca Use git_init to initialize the test/stage/gh-410-test re
+4M Jonas Fonseca Keep unstaged changes view open after an staging command
+5M Jonas Fonseca When redrawing the readline prompt also update the curso
+6M Jonas Fonseca Move script helper before usages in the display module
+7M Jonas Fonseca Merge branch 'hashed-refs'
+9M Jonas Fonseca hashed-refs: Use a hash table as the main data structure
+9M Jonas Fonseca Unify option_info lookup for normal options and view col
+10M Jonas Fonseca Add option to turn off automatic enabling of topo-order
+11M Tom Greuter Add option to install Tig with Homebrew
+12M Jonas Fonseca Fix diff context restoring for diff opened directly via
+1Y Michael Barlow Add mouse support
+2Y Jonas Fonseca Refactor stage view title formatting
+3Y Jonas Fonseca [GH #83] WIP: main view lazy navigation mode prototype
+3Y P. Sadik Create and use dup() of STDIN_FILENO instead of STDIN_FI
+4Y Jonathan Neuschäfer Don't show out-of-sight tildes
+5Y Pierre Habouzit Add an option to ignore unknown directories contents in
+6Y Jonas Fonseca Fix another regression from the dirty flag changes causi
+7Y Jonas Fonseca tig-0.10.git
+8Y Jonas Fonseca Only split the tree view when the tree view is visible
+9Y Jonas Fonseca Initial commit
[main] 91912eb97da4f6907015dab41ef9bba315730854 - commit 1 of 25 100%
EOF