billboard-top-100.js
function getNeighboringChart(chartItem, neighboringWeek) {
	if (neighboringWeek == NeighboringWeek.Previous) {
		if (chartItem[0].attribs.class.indexOf('dropdown__date-selector-option--disabled') == -1) {
			return {
				url: BILLBOARD_BASE_URL + chartItem[0].children[1].attribs.href,
				date: chartItem[0].children[1].attribs.href.split('/')[3]
			};
		}
	} else {
		if (chartItem[1].attribs.class.indexOf('dropdown__date-selector-option--disabled') == -1) {
			return {
				url: BILLBOARD_BASE_URL + chartItem[1].children[1].attribs.href,
				date: chartItem[1].children[1].attribs.href.split('/')[3]
			};
		}
	}
	return {
		url: '',
		date: ''
	}
}
function getNeighboringChart(chartItem, neighboringWeek) {
	if (neighboringWeek == NeighboringWeek.Previous) {
		if (chartItem[0].attribs.class.indexOf('dropdown__date-selector-option--disabled') == -1) {
			return {
				url: BILLBOARD_BASE_URL + chartItem[0].children[1].attribs.href,
				date: chartItem[0].children[1].attribs.href.split('/')[3]
			};
		}
	} else {
		if (chartItem[1].attribs.class.indexOf('dropdown__date-selector-option--disabled') == -1) {
			return {
				url: BILLBOARD_BASE_URL + chartItem[1].children[1].attribs.href,
				date: chartItem[1].children[1].attribs.href.split('/')[3]
			};
		}
	}
	return {
		url: '',
		date: ''
	}
}
function getNeighboringChart ( chartItem , neighboringWeek ) { if ( neighboringWeek == NeighboringWeek . Previous ) { if ( chartItem [ 0 ] . attribs . class . indexOf ( 'dropdown__date-selector-option--disabled' ) == - 1 ) { return { url : BILLBOARD_BASE_URL + chartItem [ 0 ] . children [ 1 ] . attribs . href , date : chartItem [ 0 ] . children [ 1 ] . attribs . href . split ( '/' ) [ 3 ] } ; } } else { if ( chartItem [ 1 ] . attribs . class . indexOf ( 'dropdown__date-selector-option--disabled' ) == - 1 ) { return { url : BILLBOARD_BASE_URL + chartItem [ 1 ] . children [ 1 ] . attribs . href , date : chartItem [ 1 ] . children [ 1 ] . attribs . href . split ( '/' ) [ 3 ] } ; } } return { url : '' , date : '' } }
Gets the neighboring chart for a given chart item and neighboring week type.

@param {HTMLElement} chartItem - The chart item
@param {enum} neighboringWeek - The type of neighboring week
@return {object} The neighboring chart with url and week

@example

getNeighboringChart(<div class="dropdown__date-selector-option">...</div>) // { url: 'http://www.billboard.com/charts/hot-100/2016-11-12', date: '2016-11-12' }
Gets the neighboring chart for a given chart item and neighboring week type .