transloco icon indicating copy to clipboard operation
transloco copied to clipboard

Merging global format settings with pipe parameters cause errors in date pipe

Open armanozak opened this issue 3 years ago • 0 comments

Current behavior

The global format settings are merged with the parameters passed to the pipe. This causes errors in the date pipe when dateStyle is set in the global config and you want to use options like year or month, and vice versa. Passing undefined for parameters set in global config is possible, but that is not a clean way.

Expected behavior

The pipe parameters to override the global format config, not be merged with it.

Minimal reproduction of the problem with instructions

Please check this StackBlitz playground. If you remove dateStyle: undefined and timeStyle: undefined, you will get an error.

Additional context

I understand that this may be a breaking change and require a major version release.

Contribution

I would like to make a pull request for this feature: [x] Yes! 🚀 [ ] Maybe next time

armanozak avatar Sep 03 '21 13:09 armanozak