From e9967fa22781d922ba4eb8fb44fe72d200ac4b14 Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Mon, 10 Nov 2025 21:04:10 +0000
Subject: [PATCH] =IconsManager.php update

---
 assets/js/dash/UtilityFunctions.js |   26 ++++++++++++++++++++++----
 1 files changed, 22 insertions(+), 4 deletions(-)

diff --git a/assets/js/dash/UtilityFunctions.js b/assets/js/dash/UtilityFunctions.js
index ec64aac..23f0737 100644
--- a/assets/js/dash/UtilityFunctions.js
+++ b/assets/js/dash/UtilityFunctions.js
@@ -189,10 +189,17 @@
  * @param icon
  * @returns {Node | ActiveX.IXMLDOMNode}
  */
+window.icon = document.querySelector('.icon').cloneNode(true);
+window.icon.className = 'icon';
 window.getIcon = function getIcon(icon){
 	if (typeof icon === 'undefined') {
 		return '';
 	}
+	console.log('Getting icon: '+icon);
+
+	let theIcon = window.icon.cloneNode(true);
+	theIcon.classList.add('icon-'+icon);
+	return theIcon;
 
 
 	if(!window.jvbIcons){
@@ -420,7 +427,22 @@
 window.showToast = function(message, type='success', actions={}){
 	window.jvbNotifications.showToast(message, type, actions);
 }
+window.dateFormatter = new Intl.DateTimeFormat('en-CA', {
+		year: 'numeric',
+		month: 'long',
+		day: 'numeric',
+		hour: '2-digit',
+		minute: '2-digit',
+		second: '2-digit',
+		timeZoneName: 'short'
+	});
 
+window.formatDate = function(date) {
+	if (!(date instanceof Date && !isNaN(date))) {
+		date = new Date(date);
+	}
+	return window.dateFormatter.format(date);
+}
 
 /**
  * Outputs the set text as if a typewriter were writing it
@@ -801,8 +823,6 @@
 
 	schedule(key, callback, delay = 1000) {
 		this.cancel(key);
-		console.log('Scheduling action: ', key);
-		console.log('With callback', callback);
 		this.timeouts.set(key, setTimeout(() => {
 			callback();
 			this.timeouts.delete(key);
@@ -811,7 +831,6 @@
 
 	cancel(key) {
 		if (this.timeouts.has(key)) {
-			console.log('Cancelling ', key);
 			clearTimeout(this.timeouts.get(key));
 			this.timeouts.delete(key);
 		}
@@ -819,7 +838,6 @@
 
 	cleanup() {
 		for (let timeout of this.timeouts.values()) {
-			console.log('clearing timeout: ', timeout);
 			clearTimeout(timeout);
 		}
 		this.timeouts.clear();

--
Gitblit v1.10.0