Skip to content

Commit b861dee

Browse files
committed
Fixes #1461
1 parent 68aa185 commit b861dee

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

module/Application/public/assets/js/headerbar.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,12 @@ var headerbar = function (url) {
200200
);
201201

202202
$('#navbar-first .opsup-form label, #navbar-first .opsup-name').on('click', function(e){
203-
$("#opsupwindow #opsup-content").load(url + 'opsups/opsups', function(){
203+
var day = '';
204+
if($("#calendar:visible").length > 0) {
205+
day = $('#date').val();
206+
day = day.replace(/\//g,"-");
207+
}
208+
$("#opsupwindow #opsup-content").load(url + 'opsups/opsups'+ (day.length > 0 ? '?day='+day : ''), function(){
204209
$("#opsupwindow").modal('show');
205210
});
206211
});

module/Application/src/Application/Controller/OpSupsController.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,14 @@ public function opsupsAction() {
8080
$qb = $em->createQueryBuilder();
8181

8282
$daystart = new \DateTime($day);
83+
$offset = $daystart->getTimezone()->getOffset($daystart);
84+
$daystart->setTimezone(new \DateTimeZone('UTC'));
85+
$daystart->add(new \DateInterval("PT" . $offset . "S"));
8386
$daystart->setTime(0, 0, 0);
87+
8488
$dayend = new \DateTime($day);
89+
$dayend->setTimezone(new \DateTimeZone('UTC'));
90+
$dayend->add(new \DateInterval("PT" . $offset . "S"));
8591
$dayend->setTime(23, 59, 59);
8692

8793
$qb->select('l')

0 commit comments

Comments
 (0)