Skip to content

Instantly share code, notes, and snippets.

@clouddueling
Created September 8, 2013 19:03
Show Gist options
  • Select an option

  • Save clouddueling/6487482 to your computer and use it in GitHub Desktop.

Select an option

Save clouddueling/6487482 to your computer and use it in GitHub Desktop.
jbclock angularjs directive
directives.directive('jbclock', function(){
return {
scope: {
startDate: '=',
endDate: '=',
},
link: function(scope, elm, attrs, controller) {
JBCountDown({
secondsColor: attrs.secondsColor || "#ffdc50",
secondsGlow: attrs.secondsGlow || "none",
minutesColor: attrs.minutesColor || "#9cdb7d",
minutesGlow: attrs.minutesGlow || "none",
hoursColor: attrs.hoursColor || "#378cff",
hoursGlow: attrs.hoursColor || "none",
daysColor: attrs.daysColor || "#ff6565",
daysGlow: attrs.daysColor || "none",
// must be timestamp
startDate: moment(scope.startDate).unix(),
endDate: moment(scope.endDate).unix(),
now: moment().unix(),
seconds: moment().format('s')
});
}
};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment