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
a990b69b
Commit
a990b69b
authored
Dec 07, 2018
by
David Kaltschmidt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Explore: Parse initial dates
- parse dates passed from URL - keep everything local time for now
parent
140205a7
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
public/app/features/explore/Explore.tsx
+2
-2
public/app/features/explore/TimePicker.tsx
+1
-1
No files found.
public/app/features/explore/Explore.tsx
View file @
a990b69b
...
@@ -38,7 +38,7 @@ import Graph from './Graph';
...
@@ -38,7 +38,7 @@ import Graph from './Graph';
import
Logs
from
'./Logs'
;
import
Logs
from
'./Logs'
;
import
Table
from
'./Table'
;
import
Table
from
'./Table'
;
import
ErrorBoundary
from
'./ErrorBoundary'
;
import
ErrorBoundary
from
'./ErrorBoundary'
;
import
TimePicker
from
'./TimePicker'
;
import
TimePicker
,
{
parseTime
}
from
'./TimePicker'
;
interface
ExploreProps
{
interface
ExploreProps
{
datasourceSrv
:
DatasourceSrv
;
datasourceSrv
:
DatasourceSrv
;
...
@@ -115,7 +115,7 @@ export class Explore extends React.PureComponent<ExploreProps, ExploreState> {
...
@@ -115,7 +115,7 @@ export class Explore extends React.PureComponent<ExploreProps, ExploreState> {
}
else
{
}
else
{
const
{
datasource
,
queries
,
range
}
=
props
.
urlState
as
ExploreUrlState
;
const
{
datasource
,
queries
,
range
}
=
props
.
urlState
as
ExploreUrlState
;
initialQueries
=
ensureQueries
(
queries
);
initialQueries
=
ensureQueries
(
queries
);
const
initialRange
=
range
||
{
...
DEFAULT_RANGE
};
const
initialRange
=
{
from
:
parseTime
(
range
.
from
),
to
:
parseTime
(
range
.
to
)
}
||
{
...
DEFAULT_RANGE
};
// Millies step for helper bar charts
// Millies step for helper bar charts
const
initialGraphInterval
=
15
*
1000
;
const
initialGraphInterval
=
15
*
1000
;
this
.
state
=
{
this
.
state
=
{
...
...
public/app/features/explore/TimePicker.tsx
View file @
a990b69b
...
@@ -15,7 +15,7 @@ export const DEFAULT_RANGE = {
...
@@ -15,7 +15,7 @@ export const DEFAULT_RANGE = {
* Return a human-editable string of either relative (inludes "now") or absolute local time (in the shape of DATE_FORMAT).
* Return a human-editable string of either relative (inludes "now") or absolute local time (in the shape of DATE_FORMAT).
* @param value Epoch or relative time
* @param value Epoch or relative time
*/
*/
export
function
parseTime
(
value
:
string
,
isUtc
=
false
):
string
{
export
function
parseTime
(
value
:
string
|
moment
.
Moment
,
isUtc
=
false
):
string
|
moment
.
Moment
{
if
(
moment
.
isMoment
(
value
))
{
if
(
moment
.
isMoment
(
value
))
{
return
value
;
return
value
;
}
}
...
...
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