When setting issue estimates in JIRA, you can enter a string like "1d 2h 30m" and JIRA will translate this (I’m assuming) into a corresponding number of milliseconds.
Is there an available Java library that does this?
I’m using a Spring managed bean that takes a property indicating how often a directory ought to be purged, and I’d like to allow the configuration to take a human-readable string rather than an explicit number of milliseconds.
Alternatively, if there’s a better approach I’m not thinking of, I’d love to hear it.
The parser is not too complex:
The code is pretty fault tolerant, it just ignores almost anything it can’t decode (and it ignores any whitspace, so it accepts “1d 1s”, “1s 1d”, “1d20m300s” and so on).