Skip to content

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

uses param

roryclear7b6111f62688
diff --git a/clearcam/player.html b/clearcam/player.html
index ba6ba21..092128b 100644
--- a/clearcam/player.html
+++ b/clearcam/player.html
@@ -145,8 +145,46 @@
</div>
</div>
</div>
-
+ <div style="margin-top: 20px;">
+ <label for="datePicker">Select Date:</label>
+ <input type="date" id="datePicker" name="datePicker">
+ </div>
<script>
+ function alertQueryParams() {
+ const urlParams = new URLSearchParams(window.location.search);
+ let params = '';
+ urlParams.forEach((value, key) => {
+ params += `${key}: ${value}\n`;
+ });
+ alert(params);
+ }
+
+ 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"],
@@ -340,9 +378,21 @@
}
}
- const fetchStartTime = new Date(); // Capture the time once and never change it
- const currentDate = formatDate(fetchStartTime); // Compute the date once
-
+ function getQueryParam(name) {
+ const urlParams = new URLSearchParams(window.location.search);
+ return urlParams.get(name);
+ }
+
+ let currentDate = "";
+
+ const dateParam = getQueryParam("date");
+ if (!dateParam) {
+ const fetchStartTime = new Date();
+ currentDate = formatDate(fetchStartTime);
+ } else{
+ currentDate = dateParam;
+ }
+
function formatDate(date) {
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0');