added startOfWeek to js calendar. simplified code