adopted-ember-addons / adopted-ember-addons/ember-cp-validations

[Feature Request] Restore date validator capabilities re: 'format' and 'precision,' and allow use of 'now' as a reference time

Đang mở
#723 8 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
JavaScript
Star
439
Fork
172
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

The use of ember-validators >4 in #715 removed the ability to specify `'now'` and `'precision'` unnecessarily, and presents a huge pain point for consumers that generate their validations at the time of bundle/startup. (#715 failed to reflect these changes in the documentation site, too, so consumers can be [misled rather easily](https://adopted-ember-addons.github.io/ember-cp-validations/docs/classes/Date.html):
![image](https://user-images.githubusercontent.com/20871346/190194970-a8ee2b42-cad7-48d7-9d1d-292a7294c4f2.png)

Given that this addon wraps ember-validators, it should be simple for the Date validator to handle receiving `'now'` and `'precision'` arguments and construct the correct calls to make to ember-validators.

For example, if the validator is created with `'now'`, then any time the validator runs, it would compute the current datetime and forward that to ember-validator, rather than just passing down `'now'`.

With support for these two arguments restored, a large breaking change that requires consumer apps to rearchitect simply vanishes, making deprecation removal and upgrading easier for the ecosystem.

cc @fsmanuel for visibility

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.