def compute_day(self): pyear = year = self.jyear month= self.jmonth pmonth = month -1 if pmonth <= 0 : pmonth =12 pyear -=1 prev_month_length = month_length[utility.leap(pyear)][pmonth] prev_day_week = self.day_of_week(pyear, pmonth, prev_month_length) current_month_length=month_length[utility.leap(year)][month] sc = utility.scalar_Days(self.jyear, self.jmonth, 1) current_day_week = utility.jalalyDate(sc) day = (prev_month_length-(current_day_week-1)) if ( current_day_week==0): day=1 i=0 j=0 sday = 0 while(i<6): while(j<7): self.day[i][j]=day if (self.jday==day)and(sday==0): self.current_day=[i,j] day+=1 if (i>3)and(day>current_month_length): day =1 sday=1 if (i<2)and(day>prev_month_length): day =1 j+=1 i+=1 j=0
def compute_day(self): pyear = year = self.jyear month = self.jmonth pmonth = month - 1 if pmonth <= 0: pmonth = 12 pyear -= 1 prev_month_length = month_length[utility.leap(pyear)][pmonth] prev_day_week = day_of_week(pyear, pmonth, prev_month_length) current_month_length = month_length[utility.leap(year)][month] sc = utility.scalar_Days(self.jyear, self.jmonth, 1) current_day_week = utility.jalalyDate(sc) day = (prev_month_length - (current_day_week - 1)) if (current_day_week == 0): day = 1 i = 0 j = 0 sday = 0 while (i < 6): while (j < 7): self.day[i][j] = day if (self.jday == day) and (sday == 0): self.current_day = [i, j] day += 1 if (i > 3) and (day > current_month_length): day = 1 sday = 1 if (i < 2) and (day > prev_month_length): day = 1 j += 1 i += 1 j = 0
def day_of_week(year, month, day): days = utility.scalar_Days(year, month, day) days = utility.jalalyDate(days) return days
def day_of_week(self,year,month,day): days=utility.scalar_Days(year,month,day) days=utility.jalalyDate(days) return days