public function duration($value, $units = ['s', 'm', 'h', 'd', 'w', 'y'], $separator = ' ')
    {
        if (!isset($value)) {
            return null;
        }
        
        list($seconds, $minutes, $hours, $days, $weeks, $years) =
            $this->splitDuration($value, count($units) - 1) + array_fill(0, 6, null);
        
        $duration = '';
        if (isset($years) && isset($units[5])) {
            $duration .= $separator . $years . $units[5];
        }
        
        if (isset($weeks) && isset($units[4])) {
            $duration .= $separator . $weeks . $units[4];
        }
        
        if (isset($days) && isset($units[3])) {
            $duration .= $separator . $days . $units[3];
        }
        
        if (isset($hours) && isset($units[2])) {
            $duration .= $separator . $hours . $units[2];
        }
        
        if (isset($minutes) && isset($units[1])) {
            $duration .= $separator . $minutes . $units[1];
        }
        
        if (isset($seconds) && isset($units[0])) {
            $duration .= $separator . $seconds . $units[0];
        }
        
        return trim($duration, $separator);
    }