getDaysInDuration()

Returns the number of days in a duration.

Signature

getDaysInDuration(Duration duration)

Parameters

duration
Type: Duration
The duration object returned by $A.localizationService.duration.

Returns

Type: number
The number of days in the duration.

Sample Code

var dur = $A.localizationService.duration(48, 'hour');
// Returns 2, the number of days for the given duration
$A.localizationService.getDaysInDuration(dur);