0

Using angular-moment and simply trying to add a date based on one supplied. Angular-moment is loading, but nothing happening. Here is my snipet:

        <div class="beneFooter" style="clear: both;">
            <p><span>Last day to submit order for {{ item.lastUpdateDay|amAdd : '1' : 'MMMM' }}</span> <span style="float: right; padding-right: 10px;">{{ item.lastUpdateDay|date : 'MM/dd/yyyy' }}</span></p>                    
        </div>

Seems I should be able to simply use amAdd as I have and add '1' to show the following month. End result is, if my JSON object property shows todays date, using moment and angular-moment, I simply want to return October sine todays date is in September.

Mark
  • 1,812
  • 3
  • 29
  • 51
  • what does "nothing happening" mean? is the output completely empty? – Claies Sep 14 '15 at 18:48
  • it looks to me like you aren't following the [documentation](https://github.com/urish/angular-moment#amadd-filter) on how to use that filter. – Claies Sep 14 '15 at 18:50
  • I had it based on docs, but still no go. It doesn't show any of the properties. Error is: Error: [$injector:unpr] Unknown provider: amAddFilterProvider <- amAddFilter http://errors.angularjs.org/1.3.15/$injector/unpr?p0=amAddFilterProvider%20%3C-%20amAddFilter – Mark Sep 14 '15 at 19:19
  • even when code changed to:

    Last day to submit order for {{ item.lastUpdateDay|amAdd : '1' : 'month' | amDateFormat : 'MMMM' }} {{ item.lastUpdateDay|date : 'MM/dd/yyyy' }}

    – Mark Sep 14 '15 at 19:20
  • ok well Unknown Provider is an error, suggesting that the provider didn't actually load. That is information that should be in your question body, because now the question has changed from you not having the right syntax to the module isn't even loading. – Claies Sep 14 '15 at 19:21
  • Using the dev tools though, it shows angular-moment loading. Figured since that was loading, it was only a matter of calling that filter and not having to set any particular scope or anything. Is that not the case? – Mark Sep 14 '15 at 19:45
  • if you are getting `Unknown Provider` when trying to use `amAddFilter`, then you are probably missing `'angularMoment'` in your Dependency Injection, i.e. `var myapp = angular.module('myapp', ['angularMoment']);`.... either way, the filter won't work if you are throwing that error. – Claies Sep 14 '15 at 19:48
  • @Claies - thanks so far! So in my app.js, I do have: var app = angular.module('fpsClientApp', ['ngRoute', 'LocalStorageModule', 'angular-loading-bar', 'ui.bootstrap', 'kendo.directives', 'angularMoment' ]); – Mark Sep 14 '15 at 20:59

0 Answers0