intellij-postfix-templates icon indicating copy to clipboard operation
intellij-postfix-templates copied to clipboard

Extend for Duration and Period methods in java

Open avmohan opened this issue 3 years ago • 2 comments

java.time.Duration & java.time.Period have several static methods for converting int/long into Duration/Period. Would be nice to have postfix methods for those.

avmohan avatar Dec 16 '21 11:12 avmohan

Thanks for the hint. I will add them.

xylo avatar Aug 31 '22 20:08 xylo

Hm, but java.time.Duration needs 2 arguments and Period even 3. I'm not so sure about the usefulness of those templates. In case of JavaFX I added now templates for seconds, minutes, hours, ... so that you can easily convert a number to Duration.seconds(NUMBER). Here I clearly see the benefit. For java.util.Duration and Period I would not even know where the expression should be inserted (as first, second or third parameter) and how to name the templates.

xylo avatar Sep 08 '22 09:09 xylo