Newer Version Available

This content describes an older version of this product. View Latest

getYearsInDuration()

Returns the number of years in a duration.

Signature

getYearsInDuration(Duration duration)

Parameters

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

Returns

Type: number
The number of years in the duration.

Sample Code