Mike Hammill
2006-10-02 14:27:14 UTC
Hello all,
I am trying to modify my multimonth view to include the previous month,
the current month, and the month thereafter. My little hack got me the
three months I want, but there is no "label" for the first month shown;
instead, you see the title for the current month on both the top and
bottom of the whole three-month calendar as usual, which can be a little
disorienting in this particular situation. Exploring the .css files,
it really didn't jump out at me as to where I could add a label for the
first month, or if .css is really the place to begin. Any ideas?
Background:
I'm running CalendarX 0.6.6(stable), Plone 2.1.2, Zope (Zope
2.8.5-final, python 2.3.5, linux2). My little hack was to customize
getDictCommon by creating "mikeoffset" and replacing currentDate with it
as follows:
if viewname == 'multimonth':
mikeoffset = currentDate - 30
startDate = context.getStartOfMonth(mikeoffset)
endDate = context.getEndOfMonth(mikeoffset)
nextDate = (endDate + 1).Date()
prevDate = (startDate - 1).Date()
prevstring = 'previous month'
nextstring = 'next month'
currentstring = str(mikeoffset.Month())+' '+str(mikeoffset.year())
for monthnum in range(nummonths):
midmonth =
DateTime(str(mikeoffset.year())+'/'+str(mikeoffset.month())+'/15')
midmonth += monthnum*30
startDate = context.getStartOfMonth(midmonth)
startDateToShow = context.getStartOfMonthToShow(midmonth)
weeksInMonthToShow = context.getNumWeeksInMonthToShow(midmonth)
endDate = context.getEndOfMonth(midmonth)
endDateToShow = context.getEndOfDay(startDateToShow +
(7*weeksInMonthToShow) - 1)
startDateList.append(startDate)
endDateList.append(endDate)
startDateToShowList.append(startDateToShow)
endDateToShowList.append(endDateToShow)
weeksInMonthToShowList.append(weeksInMonthToShow)
I get a calendar with:
<< previous month October 2006 next month >>
[a calendar for September 2006 here]
October 2006
[a calendar for October 2006 here]
November 2006
[a calendar for November 2006 here]
<< previous month October 2006 next month >>
The header and footer (<< previous month October 2006 next
month >>) are no problem but what I would like is a label "September
2006" before the September calendar, just as there is for October and
November.
Any hints appreciated.
Best regards,
/Mike
I am trying to modify my multimonth view to include the previous month,
the current month, and the month thereafter. My little hack got me the
three months I want, but there is no "label" for the first month shown;
instead, you see the title for the current month on both the top and
bottom of the whole three-month calendar as usual, which can be a little
disorienting in this particular situation. Exploring the .css files,
it really didn't jump out at me as to where I could add a label for the
first month, or if .css is really the place to begin. Any ideas?
Background:
I'm running CalendarX 0.6.6(stable), Plone 2.1.2, Zope (Zope
2.8.5-final, python 2.3.5, linux2). My little hack was to customize
getDictCommon by creating "mikeoffset" and replacing currentDate with it
as follows:
if viewname == 'multimonth':
mikeoffset = currentDate - 30
startDate = context.getStartOfMonth(mikeoffset)
endDate = context.getEndOfMonth(mikeoffset)
nextDate = (endDate + 1).Date()
prevDate = (startDate - 1).Date()
prevstring = 'previous month'
nextstring = 'next month'
currentstring = str(mikeoffset.Month())+' '+str(mikeoffset.year())
for monthnum in range(nummonths):
midmonth =
DateTime(str(mikeoffset.year())+'/'+str(mikeoffset.month())+'/15')
midmonth += monthnum*30
startDate = context.getStartOfMonth(midmonth)
startDateToShow = context.getStartOfMonthToShow(midmonth)
weeksInMonthToShow = context.getNumWeeksInMonthToShow(midmonth)
endDate = context.getEndOfMonth(midmonth)
endDateToShow = context.getEndOfDay(startDateToShow +
(7*weeksInMonthToShow) - 1)
startDateList.append(startDate)
endDateList.append(endDate)
startDateToShowList.append(startDateToShow)
endDateToShowList.append(endDateToShow)
weeksInMonthToShowList.append(weeksInMonthToShow)
I get a calendar with:
<< previous month October 2006 next month >>
[a calendar for September 2006 here]
October 2006
[a calendar for October 2006 here]
November 2006
[a calendar for November 2006 here]
<< previous month October 2006 next month >>
The header and footer (<< previous month October 2006 next
month >>) are no problem but what I would like is a label "September
2006" before the September calendar, just as there is for October and
November.
Any hints appreciated.
Best regards,
/Mike