function everydayRegisterLayer:data_create()
local time = os.time( pData )
--当前年份
local currentYear = pData.year
--当前月份
local currentMon = pData.month
--当前日期
local currentDay = pData.day
--保存这个月的天数
local mondays = self:count_month_day( currentYear, currentMon )
--计算1号是周几 周日是1周一是2,依次排序
local start = self:count_first_day_wday( currentDay, pData.wday )
print("show_month_num start, mondays, currentDay "..start.."-"..mondays.."-"..currentDay)
for i = 0, 41 do
--列
local r = i % 7
--行
local c = ( i - r ) / 7
-- 移除背景色
if self:getChildByTag( 3000 + i ) then
self:removeChildByTag( 3000 + i )
end
--添加非本月背景色
if (i <= start - 1) or (i > (start - 1 + mondays)) then
local pOther = cc.Sprite:createWithSpriteFrameName( "RE_other_month.png" )
pOther:setPosition( 180 + (r * 81), 429 - (c * 36.5))
-- serverTime 服务器时间 秒
local time = os.time( pData )
--当前年份
local currentYear = pData.year
--当前月份
local currentMon = pData.month
--当前日期
local currentDay = pData.day
--保存这个月的天数
local mondays = self:count_month_day( currentYear, currentMon )
--计算1号是周几 周日是1周一是2,依次排序
local start = self:count_first_day_wday( currentDay, pData.wday )
print("show_month_num start, mondays, currentDay "..start.."-"..mondays.."-"..currentDay)
for i = 0, 41 do
--列
local r = i % 7
--行
local c = ( i - r ) / 7
-- 移除背景色
if self:getChildByTag( 3000 + i ) then
self:removeChildByTag( 3000 + i )
end
--添加非本月背景色
if (i <= start - 1) or (i > (start - 1 + mondays)) then
local pOther = cc.Sprite:createWithSpriteFrameName( "RE_other_month.png" )
pOther:setPosition( 180 + (r * 81), 429 - (c * 36.5))