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
24a54cd9
Commit
24a54cd9
authored
Jun 21, 2016
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(units): refactoring #5404
parent
a7a5f36b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
38 deletions
+2
-38
public/app/core/utils/kbn.js
+2
-38
No files found.
public/app/core/utils/kbn.js
View file @
24a54cd9
...
@@ -581,37 +581,10 @@ function($, _, moment) {
...
@@ -581,37 +581,10 @@ function($, _, moment) {
}
}
};
};
// Date and time
kbn
.
toDateTime
=
function
(
size
,
timeScale
)
{
var
datetime
;
if
(
timeScale
===
's'
)
{
datetime
=
moment
.
unix
(
size
);
}
else
{
datetime
=
moment
(
size
);
}
return
datetime
;
};
kbn
.
toDuration
=
function
(
size
,
timeScale
)
{
kbn
.
toDuration
=
function
(
size
,
timeScale
)
{
return
moment
.
duration
(
size
,
timeScale
);
return
moment
.
duration
(
size
,
timeScale
);
};
};
kbn
.
valueFormats
.
dtms
=
function
(
size
)
{
return
kbn
.
toDateTime
(
size
,
'ms'
).
format
(
'YYYY-MM-DD hh:mm:ss'
);
};
kbn
.
valueFormats
.
dts
=
function
(
size
)
{
return
kbn
.
toDateTime
(
size
,
's'
).
format
(
'YYYY-MM-DD hh:mm:ss'
);
};
kbn
.
valueFormats
.
dtfromnowms
=
function
(
size
)
{
return
kbn
.
toDateTime
(
size
,
'ms'
).
fromNow
(
true
);
};
kbn
.
valueFormats
.
dtfromnows
=
function
(
size
)
{
return
kbn
.
toDateTime
(
size
,
's'
).
fromNow
(
true
);
};
kbn
.
valueFormats
.
dtdurationms
=
function
(
size
)
{
kbn
.
valueFormats
.
dtdurationms
=
function
(
size
)
{
return
kbn
.
toDuration
(
size
,
'ms'
).
humanize
();
return
kbn
.
toDuration
(
size
,
'ms'
).
humanize
();
};
};
...
@@ -656,17 +629,8 @@ function($, _, moment) {
...
@@ -656,17 +629,8 @@ function($, _, moment) {
{
text
:
'minutes (m)'
,
value
:
'm'
},
{
text
:
'minutes (m)'
,
value
:
'm'
},
{
text
:
'hours (h)'
,
value
:
'h'
},
{
text
:
'hours (h)'
,
value
:
'h'
},
{
text
:
'days (d)'
,
value
:
'd'
},
{
text
:
'days (d)'
,
value
:
'd'
},
]
{
text
:
'duration (ms)'
,
value
:
'dtdurationms'
},
},
{
text
:
'duration (s)'
,
value
:
'dtdurations'
}
{
text
:
'date and time'
,
submenu
:
[
{
text
:
'date and time (ms)'
,
value
:
'dtms'
},
{
text
:
'date and time (s)'
,
value
:
'dts'
},
{
text
:
'from now (ms)'
,
value
:
'dtfromnowms'
},
{
text
:
'from now (s)'
,
value
:
'dtfromnows'
},
{
text
:
'duration (ms)'
,
value
:
'dtdurationms'
},
{
text
:
'duration (s)'
,
value
:
'dtdurations'
}
]
]
},
},
{
{
...
...
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