Skip to content

Add object detection, tracking, mobile notifications, and search to any security camera.

mess that works

roryclear0894cec233b4
diff --git a/clearcam/player.html b/clearcam/player.html
index 092128b..f981e05 100644
--- a/clearcam/player.html
+++ b/clearcam/player.html
@@ -161,30 +161,6 @@
window.onload = alertQueryParams;
-
- document.addEventListener('DOMContentLoaded', function() {
- const datePicker = document.getElementById('datePicker');
-
- // Set the default value of the date picker to the current date
- const fetchStartTime = new Date();
- const currentDate = formatDate(fetchStartTime);
- datePicker.value = currentDate;
-
- // Add an event listener to handle date changes
- datePicker.addEventListener('change', function() {
- const selectedDate = new Date(this.value);
- const formattedDate = formatDate(selectedDate);
- console.log('Selected Date:', formattedDate);
- });
-
- function formatDate(date) {
- const year = date.getFullYear();
- const month = String(date.getMonth() + 1).padStart(2, '0');
- const day = String(date.getDate()).padStart(2, '0');
- return `${year}-${month}-${day}`;
- }
- });
-
const yolo_classes = [
["person", "red"], ["bicycle", "green"], ["car", "blue"],
["motorcycle", "cyan"], ["airplane", "magenta"], ["bus", "yellow"],
@@ -399,6 +375,28 @@
const day = String(date.getDate()).padStart(2, '0');
return `${year}-${month}-${day}`;
}
+
+ document.addEventListener('DOMContentLoaded', function() {
+ const datePicker = document.getElementById('datePicker');
+ datePicker.value = currentDate;
+
+ // Add an event listener to handle date changes
+ datePicker.addEventListener('change', function() {
+ alert("data changed");
+ const selectedDate = new Date(this.value);
+ const formattedDate = formatDate(selectedDate);
+ alert(formattedDate);
+ console.log('Selected Date:', formattedDate);
+ window.location.href = `${window.location.pathname}?date=${formattedDate}`;
+ });
+
+ function formatDate(date) {
+ const year = date.getFullYear();
+ const month = String(date.getMonth() + 1).padStart(2, '0');
+ const day = String(date.getDate()).padStart(2, '0');
+ return `${year}-${month}-${day}`;
+ }
+ });
let isFetchingSegments = false;
async function fetchSegments() {