Looking for a way to allow users to input specific timeframes? For example, 1 week or 5 days and 12 hours. I found that using Duration from Moment.js seemed like the best solution.
The snippet of code below is currently giving me 2 00:00
, indicating 2 days instead of the expected 1 day due to there only being 24 hours in the timeframe.
moment.utc(moment.duration(24, 'hours').as("milliseconds")).format("D HH:mm");
Any ideas on what might be going wrong here?