bluecherrydvr / bluecherry-apps

Bluecherry surveillance system (server application)
http://www.bluecherrydvr.com
GNU General Public License v2.0
213 stars 68 forks source link

"err ajax" when trying to get a date range #388

Closed brooks-bridges closed 3 years ago

brooks-bridges commented 4 years ago

I have a default installation of 2.8.8 on Ubuntu 16.04.6 LTS with 5 cameras (Amcrest). I have no issues with any of the services, except when I try to search a date range, for example 07/15/2020 00:00 through 07/15/2020 23:55, I get a popup with "err ajax" and no other information.

I've tried this with many of the search settings, and nothing except the "Quick Date" dropdown appears to work. I get the same error in Chrome 84.0.4147.89 and Firefox 78.0.2.

The WWW Log shows this (sanitized) error:

[Fri Jul 24 19:50:13.830046 2020] [:error] [pid 16739] [client 172.21.100.20:56580] PHP Fatal error: Uncaught Error: Call to a member function format() on boolean in /usr/share/bluecherry/www/lib/Helpers.php:106\nStack trace:\n#0 /usr/share/bluecherry/www/ajax/playback.php(58): dateToUnix('07/15/2020 23:5...')\n#1 /usr/share/bluecherry/www/lib/Controller.php(123): playback->postData()\n#2 /usr/share/bluecherry/www/lib/Route.php(75): Controller->start(Object(stdClass))\n#3 /usr/share/bluecherry/www/index.php(14): Route->start()\n#4 {main}\n thrown in /usr/share/bluecherry/www/lib/Helpers.php on line 106, referer: https://cameras.xxxxxxxxx.com:7001/playback

brooks-bridges commented 4 years ago

sooooo..... any input on how to make this work correctly?

curtishall commented 4 years ago

I'm able to reproduce this in v2.8.8 and v3 (beta). I'll let you know when this is resolved.

curtishall commented 4 years ago

On line 91 in /usr/share/bluecherry/www/lib/Helpers.php

$res->format_php = 'm/d/Y h:i A';

Replace with:

$res->format_php = 'm/d/Y H:i A';

brooks-bridges commented 4 years ago

Looks like we're halfway there. I'm not getting the ajax error anymore, so thank you for that!

I does appear however that we have a 1300 vs 0100 issue. https://i.imgur.com/IxmGDj0.png

edit: Obviously "1300 PM" isn't really a thing, so maybe it's something with how it's parsing the AM/PM?

brooks-bridges commented 4 years ago

?? Is there a fix for the time not being right when searching?

curtishall commented 4 years ago

Yes, this is resolved in 3.0.3. Which distro are you using?

curtishall commented 3 years ago

Reassigned to @myjimmy to look into

Screen Shot 2021-04-14 at 8 30 20 PM