
Product
Introducing Tier 1 Reachability: Precision CVE Triage for Enterprise Teams
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
angular-moment-filter
Advanced tools
The filter for angular.js based on moment.js(http://momentjs.com). Forked from dotSlashLu/moment-filter and published to npm.
Get the dependencies:
bower install angular-moment-filter --save
or just include index.js
anyhow.
Inject moment-filter to your app
angular.module('yourModule', ['moment-filter']);
{{input | moment:"function":"param1":"param2":...}}
is equivalent to
moment(input).function(param1, param2, ...)
input: data valid for moment(), string(e.g. "2014-11-01"), object(e.g new Date), etc. If you need to pass multiple strings as parameter for moment(), use array(e.g. [param1, param2] for moment(param1, param2))
function: function in moment().__proto__
, e.g. format, fromNow, subtract, etc.
(Note, you should pass a function name as a string, use {{str | moment : "fromNow"}}
rather than {{str | moment : fromNow}}
)
params: params passed to function
, each separated by :
To chain methods, just use another pipe:
{{str | moment:"subtract":1:'ms' | moment:"quarter"}}
-> moment(str).subtract(1, 'ms').quarter()
See test.html
or this Plunker: http://plnkr.co/edit/JXOYvZY7UeRbPxNbPe8i.
FAQs
moment filter for angular.js
We found that angular-moment-filter 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.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
Research
/Security News
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
Security News
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.