Skip to content

Commit

Permalink
Adjust case of reldate letters according to ISO-8601
Browse files Browse the repository at this point in the history
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 jonas#759
  • Loading branch information
plgruener authored and rolandwalker committed May 21, 2018
1 parent 1ff3721 commit ec72cbf
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 29 deletions.
1 change: 1 addition & 0 deletions NEWS.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
10 changes: 5 additions & 5 deletions src/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 *
Expand Down
48 changes: 24 additions & 24 deletions test/main/date-test
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit ec72cbf

Please sign in to comment.