Kick..
Perhaps some one have a script or some help?
I found smething like this:
Code: Select all
-- GROUPSCRIPT gets passed a 'recordset' object.
-- the 'Month', 'Year' and 'Day' are fields in the data
-- Each cell is filled with 'Title' and 'Time'
imonth = tonumber(recordset:getrecord(1):field('Month'):content());
iyear = tonumber(recordset:getrecord(1):field('Year'):content());
function get_day_of_week(dd, mm, yy)
dw=os.date('*t',os.time{year=yy,month=mm,day=dd})['wday']
return dw,({"Sun","Mon","Tue","Wed","Thu","Fri","Sat" })[dw]
end
function get_days_in_month(month, year)
local days_in_month = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }
local d = days_in_month[month]
-- check for leap year
if (month == 2) then
if year % 4 == 0 then
if year % 100 == 0 then
if year % 400 == 0 then
d = 29
end
else
d = 29
end
end
end
return d
end
function populate_cell(row, col, day_of_week)
for record=1, recordset:size() do
myrecord = recordset:getrecord(record);
data_day = tonumber(myrecord:getfield('Day'):content());
if data_day == day_of_week then
this_entry = "<p>" .. myrecord:getfield('Title'):content() .. "</p>" .. "<p>" .. myrecord:getfield('Time'):content() .. "</p><br/>"
table:cell(row,col):setcontent(table:cell(row,col):getcontent() .. this_entry);
end
end
end
table = TABLE.new();
table:cell(1,1):setcontent("Sunday");
table:cell(1,2):setcontent("Monday");
table:cell(1,3):setcontent("Tuesday");
table:cell(1,4):setcontent("Wednesday");
table:cell(1,5):setcontent("Thursday");
table:cell(1,6):setcontent("Friday");
table:cell(1,7):setcontent("Saturday");
days_in_month = get_days_in_month(imonth, iyear);
first_day_in_month = get_day_of_week(1,imonth,iyear);
for day=1,days_in_month do
offset = (day-1) + first_day_in_month;
row = math.floor((offset-1) / 7)
column = math.floor(offset-1) % 7;
table:cell((row*2)+2,column+1):setcontent(day);
populate_cell((row*2)+3,column+1, day);
end;
table:present();
Only how to switch a dummy with this?