PageSourceSearch

https://www.lyleandscott.com/cdn/shop/t/458/assets/countdown-utils.js?v=122153968106940608701788364387

js lyleandscott.com collected 2026-09-24 22:59:53 UTC 987 bytes, 2 lines download raw bytes

1export function parseCountdownDate(input){if(!input)return null;const parts=input.match(/(\d+)/g);return!parts||parts.length<3?null:new Date(Number(parts[2]),Number(parts[1])-1,Number(parts[0]),Number(parts[3]||0),Number(parts[4]||0),Number(parts[5]||0)).getTime()}export function formatCountdown(timeLeft){const sanitized=Math.max(0,timeLeft),days=Math.floor(sanitized/(1e3*60*60*24)),hours=Math.floor(sanitized%(1e3*60*60*24)/(1e3*60*60)),minutes=Math.floor(sanitized%(1e3*60*60)/(1e3*60)),seconds=Math.floor(sanitized%(1e3*60)/1e3);return`${days}d : ${hours}h : ${minutes}m : ${seconds}s`}export function startCountdown(endDate,onTick,onEnd){const tick=()=>{const timeLeft=endDate-Date.now();return timeLeft<=0?(onEnd?.(),!1):(onTick(timeLeft),!0)};if(!tick())return()=>{};const intervalId=setInterval(()=>{tick()||clearInterval(intervalId)},1e3);return()=>clearInterval(intervalId)}
2//# sourceMappingURL=/cdn/shop/t/458/assets/countdown-utils.js.map?v=122153968106940608701788364387

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.