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

BREAKING CHANGE: preprocessors, custom input format and timezone become filters #174

Closed
urish opened this issue Sep 5, 2015 · 0 comments

Comments

@urish
Copy link
Owner

urish commented Sep 5, 2015

Currently, most of angular-moment's filters accept a preprocessor and format parameter. Over the time, the filters accumulated additional arguments, and now we have amDifferenceFilter which accepts 5 positional parameters (and another one suggested by #124 / #172).

What I have in mind for the next release (0.11.0) is a breaking change that will replace the concept of preprocessors with designated filters and will also remove support for specifying custom input date format from all the directives.

Instead, there will be designated filters that will take care of transforming string and unix-timestamp values into moments objects.

Thus, the following:

someDate | amDifference:otherDate:'minute':true:'unix':'unix'

Will become:

`someDate | amFromUnix | amDifference:(otherDate|amFromUnix):'minute':true)

Which is a little bit more verbose, but in my opinion more readable and greatly simplifies all the filters, as they will no longer have to worry about the input format and preprocessors.

Any thoughts?

@urish urish changed the title Removal of preprocessors, custom input format BREAKIGN CHANGE: preprocessors, custom input format and timezone become filters Sep 13, 2015
@urish urish closed this as completed in 4f3010b Sep 13, 2015
@urish urish changed the title BREAKIGN CHANGE: preprocessors, custom input format and timezone become filters BREAKING CHANGE: preprocessors, custom input format and timezone become filters Sep 14, 2015
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

1 participant