Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
auto-tx
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
vamp
auto-tx
Commits
2e53842f
Commit
2e53842f
authored
7 years ago
by
Niko Ehrenfeuchter
Browse files
Options
Downloads
Patches
Plain Diff
Make deltas above two months more detailed.
Refers to
#24
parent
e20cd008
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ATxCommon/TimeUtils.cs
+23
-3
23 additions, 3 deletions
ATxCommon/TimeUtils.cs
with
23 additions
and
3 deletions
ATxCommon/TimeUtils.cs
+
23
−
3
View file @
2e53842f
...
...
@@ -73,9 +73,29 @@ namespace ATxCommon
if
(
delta
<
2
*
month
)
return
$"
{
delta
/
week
}
weeks
{
desc
}
"
;
// TODO: make the remaining options more flexible (like "< day" above)
if
(
delta
<
year
)
return
$"
{
delta
/
month
}
monts
{
desc
}
"
;
if
(
delta
<
year
)
{
var
months
=
delta
/
month
;
var
weeks
=
(
delta
-
months
*
month
)
/
week
;
var
days
=
((
delta
-
months
*
month
)
-
weeks
*
week
)
/
day
;
var
ret
=
$"
{
months
}
months"
;
if
(
weeks
>
0
)
ret
+=
$"
{
weeks
}
weeks"
;
if
(
days
>
0
)
ret
+=
$"
{
days
}
days"
;
return
$"
{
ret
}
{
desc
}
"
;
}
if
(
delta
<
10
*
year
)
{
var
years
=
delta
/
year
;
var
months
=
(
delta
-
years
*
year
)
/
month
;
var
days
=
((
delta
-
years
*
year
)
-
months
*
month
)
/
day
;
var
ret
=
$"
{
years
}
years"
;
if
(
months
>
0
)
ret
+=
$"
{
months
}
months"
;
if
(
days
>
0
)
ret
+=
$"
{
days
}
days"
;
return
$"
{
ret
}
{
desc
}
"
;
}
return
$"
{
delta
/
year
}
years
{
desc
}
"
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment