Skip to content
This repository has been archived by the owner on Nov 30, 2021. It is now read-only.

Preprocess set in configuration not used by filters #49

Closed
awb opened this issue May 14, 2014 · 3 comments
Closed

Preprocess set in configuration not used by filters #49

awb opened this issue May 14, 2014 · 3 comments

Comments

@awb
Copy link

awb commented May 14, 2014

Configuring a preprocessor like this:

 angular.module('myapp').constant('angularMomentConfig', { preprocess: 'utc' });

has no effect on filtered values. The fix is to add one line to the preprocessDate() method:

this.preprocessDate = function (value, preprocess, format) {
    preprocess = preprocess || angularMomentConfig.preprocess; // THIS LINE MISSING
    if (this.preprocessors[preprocess]) {
        preprocess = preprocess || angularMomentConfig.preprocess;
        ...
@urish
Copy link
Owner

urish commented May 14, 2014

Good catch, fixed in a slightly different way - we use the default preprocess value only if the given value is undefined. This allows to override the default value with null when desired.

@urish urish closed this as completed May 14, 2014
@awb
Copy link
Author

awb commented May 15, 2014

Thanks for the instant response! I had some trouble getting bower to install the fixed version since you haven't bumped the version number.

bower uninstall angular-moment
bower cache clean angular-moment
bower install angular-moment

did not do the trick but this finally did:

bower install angular-moment#c538a6ef88cb1bac1ec909683d37a8a0d5807a7f

Thanks again!

@urish
Copy link
Owner

urish commented May 16, 2014

Released as 0.7.1

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants