Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
iCity
EnergyDashboard
Commits
9c7ea6b4
Commit
9c7ea6b4
authored
Jul 02, 2021
by
Sven Schneider
Browse files
added date picker to get date for data display for a specific date
parent
57149df7
Changes
2
Hide whitespace changes
Inline
Side-by-side
index.html
View file @
9c7ea6b4
...
...
@@ -31,6 +31,7 @@
<script
src=
"https://code.highcharts.com/modules/boost.js"
></script>
<script
src=
"https://code.highcharts.com/modules/accessibility.js"
></script>
<!-- Apexcharts lib -->
<script
src=
"https://cdn.jsdelivr.net/npm/apexcharts"
></script>
<link
rel=
"stylesheet"
href=
"css/styles.css"
/>
...
...
@@ -70,6 +71,12 @@
Dashboard
</a>
</div>
<form
id=
"DatePicker"
>
<label>
Select Date:
</label>
<input
type=
"date"
id=
"DateOfInterest"
name=
"DateOfInterest"
min=
"2020-01-01"
max=
"2020-12-31"
>
<input
type=
"submit"
value=
"Submit"
>
</form>
<p>
Date selected:
<span
id=
"DateSelected"
></span>
</p>
</div>
</nav>
</div>
...
...
@@ -131,6 +138,16 @@
</footer>
</div>
</div>
<script>
document
.
getElementById
(
'
DatePicker
'
).
onsubmit
=
function
()
{
var
dateSelected
=
document
.
getElementById
(
'
DateOfInterest
'
).
value
;
var
asDateType
=
new
Date
(
dateSelected
)
console
.
log
(
typeof
(
dateSelected
));
document
.
getElementById
(
'
DateSelected
'
).
innerHTML
=
dateSelected
;
return
false
;
};
</script>
</body>
</html>
\ No newline at end of file
index.js
View file @
9c7ea6b4
const
express
=
require
(
"
express
"
);
const
app
=
express
();
const
port
=
process
.
env
.
PORT
||
3000
;
app
.
use
(
express
.
static
(
"
public
"
));
app
.
get
(
"
/
"
,
(
req
,
res
)
=>
{
res
.
sendFile
(
__dirname
+
"
/index.html
"
);
res
.
sendFile
(
__dirname
+
"
/index.html
"
);
});
app
.
get
(
"
/index.html
"
,
(
req
,
res
)
=>
{
res
.
redirect
(
"
/
"
);
res
.
redirect
(
"
/
"
);
});
app
.
listen
(
port
,
()
=>
{
console
.
log
(
`App listening at localhost:
${
port
}
`
);
});
console
.
log
(
`App listening at localhost:
${
port
}
`
);
});
\ No newline at end of file
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