theshoeshiner commented on code in PR #1062:
URL: https://github.com/apache/commons-lang/pull/1062#discussion_r1252959306


##########
src/main/java/org/apache/commons/lang3/time/DurationFormatUtils.java:
##########
@@ -48,6 +48,13 @@
  * Token values are printed using decimal digits.
  * A token character can be repeated to ensure that the field occupies a 
certain minimum
  * size. Values will be left-padded with 0 unless padding is disabled in the 
method invocation.
+ * <br>
+ * Tokens can be marked as optional by surrounding them with brackets [ ]. 
These tokens will 
+ * only be printed if the token value is non-zero. Any literals within 
optional blocks will only be 
+ * printed if the nearest prior non-literal token value was non-zero.

Review Comment:
   Originally I could not come up with too many scenarios where a leading 
literal would make sense, but surrounding a token with brackets does seem like 
a reasonable use. I agree the simplest/best solution would be to use the first 
token. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to