Customized script
hello, i need a customized script for this code in order to set a function inside the site Medic.ma Thank you
<!DOCTYPE html> <html> <head> <meta charset="UTF-8" name="viewport" content="width=device-width, initial-scal=1"/> <link rel="stylesheet" type="text/css" href="css/bootstrap.css"/> </head> <body> <nav class="navbar navbar-default"> <div class="container-fluid"> </div> </nav> <div class="col-md-6 well"> <hr style="border-top:1px dotted #ccc;"/> <div class='wrap' ng-app='app'> <div class='time-to'> <br /> </div> </div> </div> </body> </html>
(function() { var app; app = angular.module('app', []); app.directive('countdown', [ 'Util', '$interval', function(Util, $interval) { return { restrict: 'A', scope: { date: '@' }, link: function(scope, element) { var future; future = new Date(scope.date); $interval(function() { var diff; diff = Math.floor((future.getTime() - new Date().getTime()) / 1000); return element.text(Util.dhms(diff)); }, 1000); } }; } ]); app.factory('Util', [ function() { return { dhms: function(t) { var days, hours, minutes, seconds; days = Math.floor(t / 86400); t -= days * 86400; hours = Math.floor(t / 3600) % 24; t -= hours * 3600; minutes = Math.floor(t / 60) % 60; t -= minutes * 60; seconds = t % 60; return [days + 'd', hours + 'h', minutes + 'm', seconds + 's'].join(' '); } }; } ]); }).call(this);