You do know that in $datexpander(4wks 3days 2mins,wwdd)
$1 == 4wks 3days 2mins
and $2 = wwdd
right?

If there are commas between 4wks, 3days, 2 mins, then you'll have to check if $ [ $+ [ $0 ] ] contains a number or not...

ps: $duration can output just one of the intervals, $duration(3600) returns 1hr and not 1hr 0mins 0secs