Wasserstrom

BOGO 50% Off Flatware!

FOODSERVICE TRENDS YOU NEED TO KNOW

read our blog ›

BECOME A WASSERSTROM SUBSCRIBER

Sign up for exclusive discounts, new product announcements, and more!

Privacy Policy We'll never sell your info to a third party. Opt out any time.

urn true; } // Function to check if the current date is within the start and end date range function applyVisibilityBasedOnDate(data) { // Validate input first if (!validateData(data)) { return; } // Log the data we're working with console.log("Banner Data:", { contentId: data.contentId, start: data.start, end: data.end }); const currentDate = new Date().toISOString().split('T')[0]; console.log("Current Date:", currentDate); // Get the content element by ID const contentElement = document.getElementById(data.contentId); // Debug element finding console.log("Looking for element with ID:", data.contentId); console.log("Found element:", contentElement); // Document structure debug console.log("All IDs in document:", Array.from(document.getElementsByTagName('*')) .filter(el => el.id) .map(el => el.id)); if (!contentElement) { console.error(`Element with ID "${data.contentId}" not found in the document`); console.log("Document body:", document.body.innerHTML); return; } // Check if the current date is between start and end dates if (currentDate < data.start || currentDate> data.end) { contentElement.style.display = 'none'; console.log(`Banner hidden: current date (${currentDate}) not within range (${data.start} - ${data.end})`); } else { contentElement.style.display = 'block'; console.log("Banner displayed: date is within range"); } } // Add event listener to ensure DOM is loaded document.addEventListener('DOMContentLoaded', () => { console.log("DOM fully loaded"); applyVisibilityBasedOnDate(duoBannerData); }); // Also run immediately in case the script loads after DOM content applyVisibilityBasedOnDate(duoBannerData);

FOODSERVICE TRENDS YOU NEED TO KNOW

read our blog ›

BECOME A WASSERSTROM SUBSCRIBER

Sign up for exclusive discounts, new product announcements, and more!

Privacy Policy We'll never sell your info to a third party. Opt out any time.

urn true; } // Function to check if the current date is within the start and end date range function applyVisibilityBasedOnDate(data) { // Validate input first if (!validateData(data)) { return; } // Log the data we're working with console.log("Banner Data:", { contentId: data.contentId, start: data.start, end: data.end }); const currentDate = new Date().toISOString().split('T')[0]; console.log("Current Date:", currentDate); // Get the content element by ID const contentElement = document.getElementById(data.contentId); // Debug element finding console.log("Looking for element with ID:", data.contentId); console.log("Found element:", contentElement); // Document structure debug console.log("All IDs in document:", Array.from(document.getElementsByTagName('*')) .filter(el => el.id) .map(el => el.id)); if (!contentElement) { console.error(`Element with ID "${data.contentId}" not found in the document`); console.log("Document body:", document.body.innerHTML); return; } // Check if the current date is between start and end dates if (currentDate < data.start || currentDate> data.end) { contentElement.style.display = 'none'; console.log(`Banner hidden: current date (${currentDate}) not within range (${data.start} - ${data.end})`); } else { contentElement.style.display = 'block'; console.log("Banner displayed: date is within range"); } } // Add event listener to ensure DOM is loaded document.addEventListener('DOMContentLoaded', () => { console.log("DOM fully loaded"); applyVisibilityBasedOnDate(duoBannerData); }); // Also run immediately in case the script loads after DOM content applyVisibilityBasedOnDate(duoBannerData);

FOODSERVICE TRENDS YOU NEED TO KNOW

read our blog ›

BECOME A WASSERSTROM SUBSCRIBER

Sign up for exclusive discounts, new product announcements, and more!

Privacy Policy We'll never sell your info to a third party. Opt out any time.

urn true; } // Function to check if the current date is within the start and end date range function applyVisibilityBasedOnDate(data) { // Validate input first if (!validateData(data)) { return; } // Log the data we're working with console.log("Banner Data:", { contentId: data.contentId, start: data.start, end: data.end }); const currentDate = new Date().toISOString().split('T')[0]; console.log("Current Date:", currentDate); // Get the content element by ID const contentElement = document.getElementById(data.contentId); // Debug element finding console.log("Looking for element with ID:", data.contentId); console.log("Found element:", contentElement); // Document structure debug console.log("All IDs in document:", Array.from(document.getElementsByTagName('*')) .filter(el => el.id) .map(el => el.id)); if (!contentElement) { console.error(`Element with ID "${data.contentId}" not found in the document`); console.log("Document body:", document.body.innerHTML); return; } // Check if the current date is between start and end dates if (currentDate < data.start || currentDate> data.end) { contentElement.style.display = 'none'; console.log(`Banner hidden: current date (${currentDate}) not within range (${data.start} - ${data.end})`); } else { contentElement.style.display = 'block'; console.log("Banner displayed: date is within range"); } } // Add event listener to ensure DOM is loaded document.addEventListener('DOMContentLoaded', () => { console.log("DOM fully loaded"); applyVisibilityBasedOnDate(duoBannerData); }); // Also run immediately in case the script loads after DOM content applyVisibilityBasedOnDate(duoBannerData);

FOODSERVICE TRENDS YOU NEED TO KNOW

read our blog ›

BECOME A WASSERSTROM SUBSCRIBER

Sign up for exclusive discounts, new product announcements, and more!

Privacy Policy We'll never sell your info to a third party. Opt out any time.

urn true; } // Function to check if the current date is within the start and end date range function applyVisibilityBasedOnDate(data) { // Validate input first if (!validateData(data)) { return; } // Log the data we're working with console.log("Banner Data:", { contentId: data.contentId, start: data.start, end: data.end }); const currentDate = new Date().toISOString().split('T')[0]; console.log("Current Date:", currentDate); // Get the content element by ID const contentElement = document.getElementById(data.contentId); // Debug element finding console.log("Looking for element with ID:", data.contentId); console.log("Found element:", contentElement); // Document structure debug console.log("All IDs in document:", Array.from(document.getElementsByTagName('*')) .filter(el => el.id) .map(el => el.id)); if (!contentElement) { console.error(`Element with ID "${data.contentId}" not found in the document`); console.log("Document body:", document.body.innerHTML); return; } // Check if the current date is between start and end dates if (currentDate < data.start || currentDate> data.end) { contentElement.style.display = 'none'; console.log(`Banner hidden: current date (${currentDate}) not within range (${data.start} - ${data.end})`); } else { contentElement.style.display = 'block'; console.log("Banner displayed: date is within range"); } } // Add event listener to ensure DOM is loaded document.addEventListener('DOMContentLoaded', () => { console.log("DOM fully loaded"); applyVisibilityBasedOnDate(duoBannerData); }); // Also run immediately in case the script loads after DOM content applyVisibilityBasedOnDate(duoBannerData);

FOODSERVICE TRENDS YOU NEED TO KNOW

read our blog ›

BECOME A WASSERSTROM SUBSCRIBER

Sign up for exclusive discounts, new product announcements, and more!

Privacy Policy We'll never sell your info to a third party. Opt out any time.

; } } window.addEventListener("load", async () => { try { const state = await getUserLocation(); console.log("Region from IP-API:", state); if (state === "Ohio") { console.log("User is from Ohio"); const banner = document.getElementById("oh_showcase_banner"); if (banner) { banner.classList.remove("hidden"); banner.classList.add("block"); } else { console.error("Banner element not found"); } } } catch (error) { console.error("Error in load event handler:", error); } });

FOODSERVICE TRENDS YOU NEED TO KNOW

read our blog ›

BECOME A WASSERSTROM SUBSCRIBER

Sign up for exclusive discounts, new product announcements, and more!

Privacy Policy We'll never sell your info to a third party. Opt out any time.