А ссылку на плагин?
Сделать такое возможно:
jsfiddle.netfunction isWorkHour(start, end) {
var date = new Date(),
hours = date.getHours();
return (hours > start && hours <= end) ? true : false;
}
function padNumber(number, pad) {
var N = Math.pow(10, pad);
return number < N ? ("" + (N + number)).slice(1) : "" + number;
}
function getRemainingTime(newData, oldData) {
var diff = (oldData.getTime() - newData.getTime()) / 1000;
var hrs = parseInt(diff / 3600);
diff = diff % 3600;
var minutes = parseInt(diff / 60);
return {
hrs: padNumber( Math.abs(hrs), 2 ),
mnt: padNumber( Math.abs(minutes), 2 )
}
}
function workHourse(start, end) {
var timer = document.getElementById('timer'),
text;
if ( isWorkHour(start, end) ) {
var time,
date = new Date(),
oldData = new Date();
oldData.setHours(end);
oldData.setMinutes(0);
oldData.setSeconds(0);
time = getRemainingTime(date, oldData);
str = 'Осталось работать: ' + time.hrs + ':' + time.mnt;
} else {
str = 'Рабочие часы закончились';
}
text = document.createTextNode(str);
timer.innerHTML = '';
timer.appendChild(text);
(setTimeout(function () {
workHourse(start, end);
}, 1000))(start, end);
}
workHourse(10, 12);