Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
ddb81de5
Commit
ddb81de5
authored
Feb 27, 2014
by
Christian Winther
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
allow hour, day, week and year time rounding
parent
c4219ba0
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
1 deletions
+19
-1
src/app/components/kbn.js
+19
-1
No files found.
src/app/components/kbn.js
View file @
ddb81de5
...
@@ -534,12 +534,30 @@ function($, _, moment) {
...
@@ -534,12 +534,30 @@ function($, _, moment) {
if
(
size
<
1000
)
{
if
(
size
<
1000
)
{
return
size
.
toFixed
(
0
)
+
" ms"
;
return
size
.
toFixed
(
0
)
+
" ms"
;
}
}
// Less than 1 min
else
if
(
size
<
60000
)
{
else
if
(
size
<
60000
)
{
return
(
size
/
1000
).
toFixed
(
decimals
)
+
" s"
;
return
(
size
/
1000
).
toFixed
(
decimals
)
+
" s"
;
}
}
else
{
// Less than 1 hour, devide in minutes
else
if
(
size
<
3600000
)
{
return
(
size
/
60000
).
toFixed
(
decimals
)
+
" min"
;
return
(
size
/
60000
).
toFixed
(
decimals
)
+
" min"
;
}
}
// Less than one day, devide in hours
else
if
(
size
<
86400000
)
{
return
(
size
/
3600000
).
toFixed
(
decimals
)
+
" hour"
;
}
// Less than one week, devide in days
else
if
(
size
<
604800000
)
{
return
(
size
/
86400000
).
toFixed
(
decimals
)
+
" day"
;
}
// Less than one month, devide in weeks
else
if
(
size
<
2.62974e9
)
{
return
(
size
/
604800000
).
toFixed
(
decimals
)
+
" week"
;
}
// Less than one year, devide in weeks
else
if
(
size
<
3.15569e10
)
{
return
(
size
/
2.62974e9
).
toFixed
(
decimals
)
+
" year"
;
}
};
};
kbn
.
microsFormat
=
function
(
size
,
decimals
)
{
kbn
.
microsFormat
=
function
(
size
,
decimals
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment