~xibo-maintainers/xibo/tempel

« back to all changes in this revision

Viewing changes to lib/Controller/Stats.php

  • Committer: GitHub
  • Author(s): Israt Jahan Farzana
  • Date: 2019-04-09 14:55:01 UTC
  • mfrom: (686.2.4)
  • Revision ID: git-v1:cb2c29bc605e5cc2a31c247b184211c56f4f5f82
Merge pull request #532 from ifarzana/release18_israt

OSX-443 Time Disconnected Stats are inaccurate

Show diffs side-by-side

added added

removed removed

Lines of Context:
884
884
        $tags = $this->getSanitizer()->getString('tags');
885
885
        $onlyLoggedIn = $this->getSanitizer()->getCheckbox('onlyLoggedIn') == 1;
886
886
 
887
 
        // What if the fromdt and todt are exactly the same?
888
 
        // in this case assume an entire day from midnight on the fromdt to midnight on the todt (i.e. add a day to the todt)
889
 
        if ($fromDt == $toDt) {
890
 
            $toDt->addDay(1);
 
887
        $currentDate = $this->getDate()->parse()->startOfDay()->format('Y-m-d');
 
888
 
 
889
        // fromDt is always start of selected day
 
890
        $fromDt = $this->getDate()->parse($fromDt)->startOfDay();
 
891
 
 
892
        // If toDt is current date then make it current datetime
 
893
        if ($this->getDate()->parse($toDt)->startOfDay()->format('Y-m-d') == $currentDate) {
 
894
            $toDt = $this->getDate()->parse();
 
895
        } else {
 
896
            $toDt = $this->getDate()->parse()->startOfDay();
891
897
        }
892
898
 
893
899
        // Get an array of display id this user has access to.