
Security News
Deno 2.6 + Socket: Supply Chain Defense In Your CLI
Deno 2.6 introduces deno audit with a new --socket flag that plugs directly into Socket to bring supply chain security checks into the Deno CLI.
angular-duration-format
Advanced tools
AngularJS filter for formatting duration.
Add angular-duration-format as your app dependency.
angular.module('myModule', [
'angular-duration-format'
]);
In templates you can use
<p>
Time passed: {{ passed | duration:'hh:mm:ss:sss' }}<br/>
Preformatted: {{ passedPre }}
</p>
In controllers (or directives, services, anywhere)
angular.module('myModule').controller('exampleCtrl', function($scope, $filter) {
var durationFilter = $filter('duration');
$scope.passed = 123456789;
$scope.passedPre = durationFilter($scope.passed, 'hh:mm:ss:sss');
});
The result should be the same in both cases:
Time passed: 34:17:36:789
Preformatted: 34:17:36:789
Available formatting options:
sss for millisecondsEach number will be zero-padded to two places if you double letters (ex. hh, mm). Milliseconds are exception - they are padded to four places and you have to pass four letters (ssss).
You can use every separator you want, but be careful. Passing format h hours, m minutes will produce unexpected results 34 34ours, 17 17inutes. To avoid that, wrap every separator containing reserved letters in quotaion marks, like that h 'hours', m 'minutes'. (remember about escaping them in your code!). Now, the result should be nicely formatted 34 hours, 17 minutes.
Note, that you can ommit some unit "levels", but it can produce weird results. If in example above you change format to hh:ss, result will be 34:1056, because 17 minutes and 36 seconds it is 1056 seconds.
FAQs
AngularJS utils for formatting time
We found that angular-duration-format demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Deno 2.6 introduces deno audit with a new --socket flag that plugs directly into Socket to bring supply chain security checks into the Deno CLI.

Security News
New DoS and source code exposure bugs in React Server Components and Next.js: what’s affected and how to update safely.

Security News
Socket CEO Feross Aboukhadijeh joins Software Engineering Daily to discuss modern software supply chain attacks and rising AI-driven security risks.