Skip to content

Commit de3f064

Browse files
authored
Merge pull request #63 from Digipalvelutehdas/feature/dashboard-datepicker-fixes
Feature/dashboard datepicker fixes
2 parents b2660ad + 5a11486 commit de3f064

File tree

3 files changed

+18
-14
lines changed

3 files changed

+18
-14
lines changed

core/lib/i18n/en.i18n.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -636,6 +636,8 @@
636636
"statusCodeCountsChart_title": "HTTP Status Codes",
637637
"statusCodeCountsChart_help_text": "You can use this chart to see the HTTP responses generated by your API for the requests it receives for a specific time period. You can filter the chart with response type for a single API or a combination of them. The overview information and other charts will be updated when you interact with HTTP Status Codes.",
638638
"swaggerUi_swaggerDocumentInvalidText": "Swagger document is not valid.",
639+
"timeFrameSelectPicker_from": "from",
640+
"timeFrameSelectPicker_to": "to",
639641
"updatePassword_legend_text": "Update password",
640642
"umbrella_createuser_error": "Failed to create user on API Umbrella.",
641643
"updatePassword_submitButton_text": "Change Password",
Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
<template name="timeFrameSelectPicker">
2-
<div class="input-daterange input-group time-frame-picker" id="datepicker">
3-
<span class="input-group-addon">from</span>
4-
<input type="text" class="form-control" id="analytics-timeframe-start" />
5-
<span class="input-group-addon">to</span>
6-
<input type="text" class="form-control" id="analytics-timeframe-end" />
2+
<div id="timeframe-datepickers" class="input-group input-daterange">
3+
<span class="input-group-addon">
4+
{{_ "timeFrameSelectPicker_from" }}
5+
</span>
6+
<input id="analytics-timeframe-start" type="text" class="form-control">
7+
<span class="input-group-addon">
8+
{{_ "timeFrameSelectPicker_to" }}
9+
</span>
10+
<input id="analytics-timeframe-end" type="text" class="form-control">
711
</div>
812
</template>

dashboard/client/filtering/datepicker/datepicker.js

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,14 @@ import $ from 'jquery';
66

77
Template.timeFrameSelectPicker.onRendered(function () {
88

9-
// Enable date picker on timeframe start
10-
$('#analytics-timeframe-start').datepicker({
9+
$('#timeframe-datepickers').datepicker({
1110
todayHighlight: true,
1211
endDate: 'today',
1312
autoclose: true,
14-
})
13+
});
14+
15+
// Event handler for timeframe start
16+
$('#analytics-timeframe-start').datepicker()
1517
// Save chosen date to URL parameter
1618
// in order to share dashboard state
1719
.on('changeDate', function (event) {
@@ -27,12 +29,8 @@ Template.timeFrameSelectPicker.onRendered(function () {
2729
$('#analytics-timeframe-start').datepicker('setDate', new Date(fromDate));
2830
}
2931

30-
// Enable date picker on timeframe end
31-
$('#analytics-timeframe-end').datepicker({
32-
todayHighlight: true,
33-
endDate: 'today',
34-
autoclose: true,
35-
})
32+
// Event handler for timeframe end
33+
$('#analytics-timeframe-end').datepicker()
3634
// Save chosen date to URL parameter
3735
.on('changeDate', function (event) {
3836
// Set fromDate URL parameter to ISO YYYY-mm-dd

0 commit comments

Comments
 (0)