PageSourceSearch

https://www.oic.or.th/template/js/countdown.js

js oic.or.th collected 2026-09-24 08:56:29 UTC 1,639 bytes, 10 lines download raw bytes

1(function($){'use strict';$.fn.countdown=function(options,callback){var thisEl=$(this);var settings={'date':null,'format':null};if(options){$.extend(settings,options);}
2function countdown_proc(){var eventDate=Date.parse(settings['date'])/1000;var currentDate=Math.floor($.now()/1000);if(eventDate<=currentDate){if(typeof callback==='function'){callback.call(this);}
3clearInterval(interval);return;}
4var seconds=eventDate-currentDate;var days=Math.floor(seconds/(60*60*24));seconds-=days*60*60*24;var hours=Math.floor(seconds/(60*60));seconds-=hours*60*60;var minutes=Math.floor(seconds/60);seconds-=minutes*60;if(days==1){thisEl.find(".timeRefDays").text("day");}else{thisEl.find(".timeRefDays").text("days");}
5if(hours==1){thisEl.find(".timeRefHours").text("hour");}else{thisEl.find(".timeRefHours").text("hours");}
6if(minutes==1){thisEl.find(".timeRefMinutes").text("minute");}else{thisEl.find(".timeRefMinutes").text("minutes");}
7if(seconds==1){thisEl.find(".timeRefSeconds").text("second");}else{thisEl.find(".timeRefSeconds").text("seconds");}
8if(settings['format']=="on"){var days=(String(days).length>=2)?days:"0"+days;var hours=(String(hours).length>=2)?hours:"0"+hours;var minutes=(String(minutes).length>=2)?minutes:"0"+minutes;var seconds=(String(seconds).length>=2)?seconds:"0"+seconds;}
9if(!isNaN(eventDate)){thisEl.find(".days").text(days);thisEl.find(".hours").text(hours);thisEl.find(".minutes").text(minutes);thisEl.find(".seconds").text(seconds);}else{alert("Invalid date. Here's an example: 12 Tuesday 2012 17:30:00");clearInterval(interval);}}
10countdown_proc();var interval=setInterval(countdown_proc,1000);}})(jQuery);

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.