
Research
Security News
The Growing Risk of Malicious Browser Extensions
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
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
The npm package angular-moment-filter receives a total of 5 weekly downloads. As such, angular-moment-filter popularity was classified as not popular.
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.
Research
Security News
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
Research
Security News
An in-depth analysis of credential stealers, crypto drainers, cryptojackers, and clipboard hijackers abusing open source package registries to compromise Web3 development environments.
Security News
pnpm 10.12.1 introduces a global virtual store for faster installs and new options for managing dependencies with version catalogs.