4 ms·
It would reduce value of a pattern-based API as an idea, that you can specify any format with combination of special characters. But you are right: this case is
by ivan_gammel 8y ago
It would reduce value of a pattern-based API as an idea, that you can specify any format with combination of special characters. But you are right: this case is so special that it would make sense to protect majority of developers from misuse. If builder pattern is used for date formatters, then it could throw an exception unless certain flag is also set:
var formatter = format(“ww-e-YYYY”)
.withWoYCalculations()
.build();
- naniwaduni 8y agoOne of the big benefits of using these APIs is often that you implicitly accept a greater range of user formats than you anticipated.