Skip to content

Instantly share code, notes, and snippets.

@kaicode
Created February 25, 2014 11:51
Show Gist options
  • Save kaicode/9207511 to your computer and use it in GitHub Desktop.
Save kaicode/9207511 to your computer and use it in GitHub Desktop.
function getMonday() {
var date = new Date();
// Set date to Monday just gone
var day = date.getDay()
date.setDate(date.getDate() - (day == 0 ? -6:1));
// Zero time
date.setHours(0);
date.setMinutes(0);
date.setSeconds(0);
date.setMilliseconds(0);
return date.toISOString();
}
new TimeBasedCountingWidget({
targetClassName: 'money-since-start',
startDate: getMonday(),
countMultiplier: 57,
counttype:'money',
prefix: '<span class="sign">&pound;</span>'
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment