Showing only this week's events of a SharePoint calendar

Update: There was a mistake in the IsInCurrentWeek formula (ignored the year….), the updated version is now here.  Recently a colleague asked me for some modifications on one of her calendars. Basically, she wanted to display only the events of the current week in the corresponding web part. In order to get the default web part to do this, I had to find out whether a calendar entry is in the current week Details