I got this code working with the jQuery Countdown Plugin to take a string input and output a countdown in a div. Is there a better way of implementing this?
HTML
<div id="defaultCountdown" class="arg">Here</div>
Script
function stringToCountdown(element,str){
/* Parse the String */
var hh = parseInt(str.substr(0,2),10);
var mm = parseInt(str.substr(2,2),10);
var ss = parseInt(str.substr(4,2),10);
var parity = parseInt(str.substr(4,2),10);
var austDay = new Date();
austDay = new Date( austDay.getFullYear() , austDay.getMonth(),
austDay.getDate(),austDay.getHours()+hh,
austDay.getMinutes()+mm, austDay.getSeconds()+ss );
$('#defaultCountdown').countdown({until:austDay , compact: true,format: 'dHMs',expiryText: 'No More Counter for you'});
}
$(function () {
stringToCountdown('#defaultCountdown6','000005');
});
Should I rewrite this to make it simpler and faster?