I am migrating from Momentjs to Luxon. I allow users to pick a number of hours that a task will take. When we save this value, I'd like it to normalize. So if a task takes 90 hours, I would prefer if we stored 3 days and 18 hours. I store the ISO Duration String so I'd like to convert PT90H to P3DT18H... of course with any given value.
I have tried Luxon's normalize
function, I tried to call it like so:
const duration = Duration.fromObject({ hours: 90 });
duration.normalize().toISO();
However, normalize
does not seem to do anything to the result. I still get PT90H. Is there a built in way to do this with Luxon?