src/sedra.js
function abs(year, absDate) {

	// find the first saturday on or after today's date
	absDate = c.dayOnOrBefore(6, absDate + 6);

	var weekNum = (absDate - year.first_saturday) / 7;
	var index = year.theSedraArray[weekNum];

	if (undefined === index) {
		return abs(new Sedra(year.year + 1, year.il), absDate); // must be next year
	}
	if (typeof index == 'object') {
		// Shabbat has a chag. Return a description
		return {parsha: [index], chag: true};
	}
	if (index >= 0) {
		return {parsha: [parshiot[index]], chag: false};
	}

	index = D(index); // undouble the parsha
	return {parsha: [parshiot[index], parshiot[index + 1]], chag: false};
}
function abs(year, absDate) {

	// find the first saturday on or after today's date
	absDate = c.dayOnOrBefore(6, absDate + 6);

	var weekNum = (absDate - year.first_saturday) / 7;
	var index = year.theSedraArray[weekNum];

	if (undefined === index) {
		return abs(new Sedra(year.year + 1, year.il), absDate); // must be next year
	}
	if (typeof index == 'object') {
		// Shabbat has a chag. Return a description
		return {parsha: [index], chag: true};
	}
	if (index >= 0) {
		return {parsha: [parshiot[index]], chag: false};
	}

	index = D(index); // undouble the parsha
	return {parsha: [parshiot[index], parshiot[index + 1]], chag: false};
}
function abs ( year , absDate ) { // find the first saturday on or after today's date absDate = c . dayOnOrBefore ( 6 , absDate + 6 ) ; var weekNum = ( absDate - year . first_saturday ) / 7 ; var index = year . theSedraArray [ weekNum ] ; if ( undefined === index ) { return abs ( new Sedra ( year . year + 1 , year . il ) , absDate ) ; // must be next year } if ( typeof index == 'object' ) { // Shabbat has a chag. Return a description return { parsha : [ index ] , chag : true } ; } if ( index >= 0 ) { return { parsha : [ parshiot [ index ] ] , chag : false } ; } index = D ( index ) ; // undouble the parsha return { parsha : [ parshiot [ index ] , parshiot [ index + 1 ] ] , chag : false } ; }
returns an array describing the parsha on the first Saturday on or after absdate
returns an array describing the parsha on the first Saturday on or after absdate