angular-seconds-to-date
v1.0.1
Published
Filter to convert a number representing seconds to a Date object
Downloads
55
Maintainers
Readme
angular-seconds-to-date
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.
Installation
Install angular-seconds-to-date
by running:
$ npm install --save angular-seconds-to-date
Documentation
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 }}
Support
If you're having any problem, please raise an issue on GitHub and I'll be happy to help.
Tests
Run the test suite by doing:
$ npm test
Contribute
- Issue Tracker: github.com/jviotti/angular-seconds-to-date/issues
- Source Code: github.com/jviotti/angular-seconds-to-date
Before submitting a PR, please make sure that you include tests, and that jshint runs without any warning:
$ npm run lint
License
The project is licensed under the MIT license.