Пример #1
0
 def __init__(self, cellCache, year, month):
     self.year = year
     self.month = month
     self.monthLen = getMonthLen(year, month, calTypes.primary)
     self.offset = getWeekDay(year, month, 1)  ## month start offset
     initJd = core.primary_to_jd(year, month, 1)
     self.weekNum = [getWeekNumberByJd(initJd + i * 7) for i in range(6)]
     #########
     startJd, endJd = core.getJdRangeForMonth(year, month, calTypes.primary)
     tableStartJd = startJd - self.offset
     #####
     list.__init__(self, [[
         cellCache.getCell(tableStartJd + yPos * 7 + xPos)
         for xPos in range(7)
     ] for yPos in range(6)])
Пример #2
0
 def __init__(self, cellCache, year, month):
     self.year = year
     self.month = month
     self.monthLen = getMonthLen(year, month, calTypes.primary)
     self.offset = getWeekDay(year, month, 1)## month start offset
     self.weekNum = [getWeekNumber(year, month, 1+7*i) for i in range(6)]
     #########
     startJd, endJd = core.getJdRangeForMonth(year, month, calTypes.primary)
     tableStartJd = startJd - self.offset
     #####
     list.__init__(self, [
         [
             cellCache.getCell(
                 tableStartJd + yPos*7 + xPos
             ) for xPos in range(7)
         ] for yPos in range(6)
     ])
Пример #3
0
def setParamsFunc(cell):
    offset = getWeekDay(cell.year, cell.month, 1)  ## month start offset
    yPos, xPos = divmod(offset + cell.day - 1, 7)
    cell.monthPos = (xPos, yPos)
    ###
    """
Пример #4
0
def setParamsFunc(cell):
	offset = getWeekDay(cell.year, cell.month, 1)## month start offset
	yPos, xPos = divmod(offset + cell.day - 1, 7)
	cell.monthPos = (xPos, yPos)
	###
	"""