Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
angular-seconds-to-date
Advanced tools
Filter to convert a number representing seconds to a Date object
Filter to convert a number representing seconds to a Date object
From this awesome StackOverflow answer.
I found this filter to be of great use when attempting to format a number of seconds to a m[m]s[s]
format using MomentJS, since simply passing the time to the moment
constructor can lead to timezone issues.
Install angular-seconds-to-date
by running:
$ npm install --save angular-seconds-to-date
Add angular-seconds-to-date
to your Angular module dependency list:
var MyApp = angular.module('MyApp', [
require('angular-seconds-to-date')
]);
You can then make use of the secondsToDate
filter:
{{ 180 | secondsToDate }}
If you're having any problem, please raise an issue on GitHub and I'll be happy to help.
Run the test suite by doing:
$ npm test
Before submitting a PR, please make sure that you include tests, and that jshint runs without any warning:
$ npm run lint
The project is licensed under the MIT license.
FAQs
Filter to convert a number representing seconds to a Date object
The npm package angular-seconds-to-date receives a total of 3 weekly downloads. As such, angular-seconds-to-date popularity was classified as not popular.
We found that angular-seconds-to-date 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
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.