{"id":13494182,"url":"https://github.com/urish/angular-moment","last_synced_at":"2025-10-05T16:30:49.175Z","repository":{"id":8658269,"uuid":"10312052","full_name":"urish/angular-moment","owner":"urish","description":"Moment.JS directives for Angular.JS (timeago and more)","archived":true,"fork":false,"pushed_at":"2020-06-15T07:01:16.000Z","size":491,"stargazers_count":2596,"open_issues_count":51,"forks_count":394,"subscribers_count":47,"default_branch":"master","last_synced_at":"2025-09-28T10:39:57.010Z","etag":null,"topics":["angularjs","moment"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/urish.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-05-27T09:45:13.000Z","updated_at":"2025-09-20T14:20:53.000Z","dependencies_parsed_at":"2022-07-08T06:17:24.424Z","dependency_job_id":null,"html_url":"https://github.com/urish/angular-moment","commit_stats":null,"previous_names":[],"tags_count":46,"template":false,"template_full_name":null,"purl":"pkg:github/urish/angular-moment","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/urish%2Fangular-moment","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/urish%2Fangular-moment/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/urish%2Fangular-moment/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/urish%2Fangular-moment/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/urish","download_url":"https://codeload.github.com/urish/angular-moment/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/urish%2Fangular-moment/sbom","scorecard":{"id":911995,"data":{"date":"2025-08-11","repo":{"name":"github.com/urish/angular-moment","commit":"b23448e2fb09f12cb2f54f38913fdce932700c4f"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.4,"checks":[{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":3,"reason":"Found 7/21 approved changesets -- score normalized to 3","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Maintained","score":0,"reason":"project is archived","details":["Warn: Repository is archived."],"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 16 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-24T19:33:24.158Z","repository_id":8658269,"created_at":"2025-08-24T19:33:24.158Z","updated_at":"2025-08-24T19:33:24.158Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278228285,"owners_count":25952074,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-03T02:00:06.070Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["angularjs","moment"],"created_at":"2024-07-31T19:01:22.658Z","updated_at":"2025-10-05T16:30:48.898Z","avatar_url":"https://github.com/urish.png","language":"JavaScript","readme":"angular-moment\n==============\n\nAngularJS directive and filters for [Moment.JS](http://www.momentjs.com).\n\nCopyright (C) 2013, 2014, 2015, 2016, 2017, 2018 Uri Shaked \u003curi@urish.org\u003e\n\n[![Build Status](https://travis-ci.org/urish/angular-moment.png?branch=master)](https://travis-ci.org/urish/angular-moment)\n[![Coverage Status](https://coveralls.io/repos/urish/angular-moment/badge.png)](https://coveralls.io/r/urish/angular-moment)\n\n### New Angular version is now available: [ngx-moment](https://github.com/urish/ngx-moment)\n\n---\n\nInstallation\n------------\n\nYou can choose your preferred method of installation:\n* Through bower: `bower install angular-moment --save`\n* Through npm: `npm install angular-moment moment --save`\n* Through NuGet: `Install-Package angular-moment Moment.js`\n* From a CDN: [jsDelivr](https://cdn.jsdelivr.net/npm/angular-moment@1.3.0/angular-moment.min.js) or [CDNJS](https://cdnjs.cloudflare.com/ajax/libs/angular-moment/1.3.0/angular-moment.min.js)\n* Download from github: [angular-moment.min.js](https://raw.github.com/urish/angular-moment/master/angular-moment.min.js)\n\n\nInstructions for using moment-timezone with webpack\n----------\n\n Even if you have `moment-timezone` in your `package.json`, `angular-moment` will not be able to use it unless you override\n  moment using Angular's dependency injection [See Resolved Issue](https://github.com/urish/angular-moment/pull/234)\n \n ```javascript\n var angular = require('angular');\n require('angular-moment');\n var ngModule = angular.module('ngApp',['angularMoment']);\n ngModule.constant('moment', require('moment-timezone'));\n ```\n \n \nUsage\n-----\nInclude both **moment.js** and **angular-moment.js** in your application.\n\n```html\n\u003cscript src=\"components/moment/moment.js\"\u003e\u003c/script\u003e\n\u003cscript src=\"components/angular-moment/angular-moment.js\"\u003e\u003c/script\u003e\n```\n\nAdd the module `angularMoment` as a dependency to your app module:\n\n```js\nvar myapp = angular.module('myapp', ['angularMoment']);\n```\n\nIf you need internationalization support, load specified moment.js locale file right after moment.js:\n\n```html\n\u003cscript src=\"components/moment/moment.js\"\u003e\u003c/script\u003e\n\u003cscript src=\"components/moment/locale/de.js\"\u003e\u003c/script\u003e\n\u003cscript src=\"components/angular-moment/angular-moment.js\"\u003e\u003c/script\u003e\n```\n\nThen call the `amMoment.changeLocale()` method (e.g. inside your app's run() callback):\n\n```js\nmyapp.run(function(amMoment) {\n\tamMoment.changeLocale('de');\n});\n```\n\n\n### Use in controller/service/factory\nInject the `moment`-constant into your dependency injection. For example:\n \n```js\nangular.module('fooApp')\n    .controller('FooCtrl', ['$scope', 'moment', function ($scope, moment) {\n        $scope.exampleDate = moment().hour(8).minute(0).second(0).toDate();\n    }]);\n```\n\n### am-time-ago directive\nUse the `am-time-ago` directive to format your relative timestamps. For example:\n\n```html\n\u003cspan am-time-ago=\"message.time\"\u003e\u003c/span\u003e\n```\n\nangular-moment will dynamically update the span to indicate how much time\npassed since the message was created. So, if your controller contains the following\ncode:\n```js\n$scope.message = {\n   text: 'hello world!',\n   time: new Date()\n};\n```\n\nThe user will initially see \"a few seconds ago\", and about a minute\nafter the span will automatically update with the text \"a minute ago\",\netc.\n\n### amParse filter\n\nParses a custom-formatted date into a moment object that can be used with the `am-time-ago` directive and the\nother filters. For example, the following code will accept dates that are formatted like \"2015.04.25 22:00:15':\n\n```html\n\u003cspan am-time-ago=\"message.time | amParse:'YYYY.MM.DD HH:mm:ss'\"\u003e\u003c/span\u003e\n```\n\n### amFromUnix filter\n\nConverts a unix-timestamp (seconds since 1/1/1970) into a moment object. Example:\n\n```html\n\u003cspan am-time-ago=\"message.unixTime | amFromUnix\"\u003e\n```\n\n### amUtc filter\n\nCreate / switch the current moment object into UTC mode. For example, given a date object in `message.date`, \nthe following code will display the time in UTC instead of the local timezone:\n\n```html\n\u003cspan\u003e{{message.date | amUtc | amDateFormat:'MM.DD.YYYY HH:mm:ss'}}\u003c/span\u003e\n```\n\n### amUtcOffset filter\n\nUses the given utc offset when displaying a date. For example, the following code will display the date with\na UTC + 3 hours time offset:\n\n```html\n\u003cspan\u003e{{message.date | amUtcOffset:'+0300' | amDateFormat:'MM.DD.YYYY HH:mm:ss'}}\u003c/span\u003e\n```\n\n### amLocal filter\n\nChanges the given moment object to be in the local timezone. Usually used in conjunction with `amUtc` / `amTimezone` \nfor timezone conversion. For example, the following will convert the given UTC date to local time:\n\n```html\n\u003cspan\u003e{{message.date | amUtc | amLocal | amDateFormat:'MM.DD.YYYY HH:mm:ss'}}\u003c/span\u003e\n```\n\n### amTimezone filter\n\nApplies a timezone to the given date / moment object. You need to include `moment-timezone.js` in your project\nand load timezone data in order to use this filter. The following example displays the time in Israel's timezone:\n\n```html\n\u003cspan\u003e{{message.date | amTimezone:'Israel' | amDateFormat:'MM.DD.YYYY HH:mm:ss'}}\u003c/span\u003e\n```\n\n### amDateFormat filter\nFormat dates using moment.js format() method. Example:\n\n```html\n\u003cspan\u003e{{message.time | amDateFormat:'dddd, MMMM Do YYYY, h:mm:ss a'}}\u003c/span\u003e\n```\n\nThis snippet will format the given time as \"Monday, October 7th 2013, 12:36:29 am\".\n\nFor more information about Moment.JS formatting options, see the\n[docs for the format() function](http://momentjs.com/docs/#/displaying/format/).\n\n### amCalendar filter\n\nFormat dates using moment.js calendar() method. Example:\n\n```html\n\u003cspan\u003e{{message.time | amCalendar:referenceTime:formats}}\u003c/span\u003e\n```\n\nThis snippet will format the given time as e.g. \"Today 2:30 AM\" or \"Last Monday 2:30 AM\" etc..\n\nFor more information about Moment.JS calendar time format, see the\n[docs for the calendar() function](http://momentjs.com/docs/#/displaying/calendar-time/).\n\n### amDifference filter\n\nGet the difference between two dates in milliseconds.\nParameters are date, units and usePrecision. Date defaults to current date. Example:\n\n```html\n\u003cspan\u003eScheduled {{message.createdAt | amDifference : null : 'days' }} days from now\u003c/span\u003e\n```\n\nThis snippet will return the number of days between the current date and the date filtered.\n\nFor more information about Moment.JS difference function, see the\n[docs for the diff() function](http://momentjs.com/docs/#/displaying/difference/).\n\n### amDurationFormat filter\n\nFormats a duration (such as 5 days) in a human readable format. See [Moment.JS documentation](http://momentjs.com/docs/#/durations/creating/)\nfor a list of supported duration formats, and [`humanize() documentation`](http://momentjs.com/docs/#/durations/humanize/) \nfor explanation about the formatting algorithm.\n\nExample:\n\n```html\n\u003cspan\u003eMessage age: {{message.ageInMinutes | amDurationFormat : 'minute' }}\u003c/span\u003e\n```\n\nWill display the age of the message (e.g. 10 minutes, 1 hour, 2 days, etc).\n\n### amSubtract filter\n\nSubtract values (hours, minutes, seconds ...) from a specified date.\n\nSee [Moment.JS documentation](http://momentjs.com/docs/#/durations/creating/) for a list of supported duration formats.\n\nExample:\n\n```html\n\u003cspan\u003eStart time: {{day.start | amSubtract : '1' : 'hours' | amDateFormat : 'hh'}} : {{day.start | amSubtract : '30' : 'minutes' | amDateFormat : 'mm'}}\u003c/span\u003e\n\n```\n\n### amAdd filter\n\nAdd values (hours, minutes, seconds ...) to a specified date.\n\nSee [Moment.JS documentation](http://momentjs.com/docs/#/durations/creating/) for a list of supported duration formats.\n\nExample:\n\n```html\n\u003cspan\u003eStart time: {{day.start | amAdd : '1' : 'hours' | amDateFormat : 'hh'}} : {{day.start | amAdd : '30' : 'minutes' | amDateFormat : 'mm'}}\u003c/span\u003e\n\n```\n\n### amStartOf filter\n\nMutates the original moment by setting it to the start of a unit(minute, hour, day..) of time.\n\nSee [Moment.JS documentation](http://momentjs.com/docs/#/manipulating/start-of/) for a list of supported duration formats.\n\nExample:\n\n```html\n\u003cspan\u003e{{ date | amStartOf:'month' | amLocal }}\u003c/span\u003e\n\n```\n\n### amEndOf filter\n\nMutates the original moment by setting it to the end of a unit(minute, hour, day..) of time.\n\nSee [Moment.JS documentation](http://momentjs.com/docs/#/manipulating/end-of/) for a list of supported duration formats.\n\nExample:\n\n```html\n\u003cspan\u003e{{ date | amEndOf:'month' | amLocal }}\u003c/span\u003e\n\n```\n\n### Time zone support\n\nThe `amDateFormat` and `amCalendar` filters can be configured to display dates aligned\nto a specific timezone. You can configure the timezone using the following syntax:\n\n```js\nangular.module('myapp').constant('angularMomentConfig', {\n    timezone: 'Name of Timezone' // e.g. 'Europe/London'\n});\n```\n\nRemember to include `moment-timezone.js` v0.3.0 or greater in your project, otherwise the custom timezone\nfunctionality will not be available. You will also need to include a timezone data file that\nyou can create using the [Timezone Data Builder](http://momentjs.com/timezone/)\nor simply download from [here](https://rawgithub.com/qw4n7y/7282780/raw/6ae3b334b295f93047e8f3ad300db6bc4387e235/moment-timezone-data.js).\n\n### Accessing `moment()` in your JavaScript\n\nIf you wish to use `moment()` in your services, controllers, or directives, simply inject the `moment` variable into the\nconstructor.\n\nLicense\n----\n\nReleased under the terms of the [MIT License](LICENSE).\n","funding_links":[],"categories":["JavaScript","Directive","others"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Furish%2Fangular-moment","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Furish%2Fangular-moment","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Furish%2Fangular-moment/lists"}