The current format for dt.in_words() (1 year 2 months 3 weeks 4 days 5 hours 6 minutes 7 seconds) can be too verbose for some use-cases where a more compact format would be more suitable, so I propose adding an optional format parameter for more granular control of units\fields.
That way, if we call it like dt.in_words(format='YMD') we'd get 1 year 2 months 25 days, dt.in_words(format='MDm') would result in 14 months 25 days 306 minutes and so on
Feature Request
A
format
parameter in thein_words()
function to allow limiting the units used.Reasoning
Assuming a
The current format for
dt.in_words()
(1 year 2 months 3 weeks 4 days 5 hours 6 minutes 7 seconds
) can be too verbose for some use-cases where a more compact format would be more suitable, so I propose adding an optionalformat
parameter for more granular control of units\fields. That way, if we call it likedt.in_words(format='YMD')
we'd get1 year 2 months 25 days
,dt.in_words(format='MDm')
would result in14 months 25 days 306 minutes
and so on