CoreCommunity ExtensionsIncubatorDistributionsTYPO3 4.5 ProjectsTYPO3 4.6 ProjectsTYPO3 4.7 ProjectsTYPO3 6.0 ProjectsTYPO3 6.1 ProjectsTYPO3 6.2 Projects (+)

Bug #34533

currentDayHeader calculated incorrectly in Calendar Base 1.4.3

Added by Fabian about 1 year ago. Updated 8 months ago.

Status:Closed Start date:2012-03-05
Priority:Should have Due date:
Assignee:Thomas Kowtsch % Done:

100%

Category:Calendar Views Spent time: -
Target version:1.5
Votes: 0

Description

The currentDayHeader CSS class is calculated incorrectly in view/class.tx_cal_new_weekview.php.

Line 466:

if($localDayIndex \== $weekdayIndex){

should be

if($localDayIndex \== $weekdayIndex+1){

Tested this and the fix seems to work so far.

Please mind that i added the backslashes to escape the double "=" signs, since the editor filtered them out.

Greetings,
Fabian

History

Updated by Thomas Kowtsch about 1 year ago

  • Status changed from New to Needs Feedback
  • Assignee set to Thomas Kowtsch
  • Target version set to 1.5

Fabian,

can you please give us some more details?
- What cal version do you use? Latest TER release?
- What view are you facing this problem?
- What's your setting for weekday_start - default, Monday, or Sunday?

I'm very sure that this already got touched within the last months, and in my local copy with new_week_view everything works even when changing plugin configuration for weekday-start.

Thanks for your feedback!

Updated by Fabian about 1 year ago

We are using Base Cal 1.4.3 on TYPO3 4.5.11.

The view is the week_large one. Weekday start is set to Monday by Flexform plugin config. We are not using different pages for different views.

Like I said, applying above fix without changing any other setting seems to solve the problem.

Greetings,
Fabian

Edit: I doubt it's relevant, but our Backend is in German language.

Updated by Giovanni Minniti about 1 year ago

Applying this fix ends with a wrong mini calendar view (current day - 1)

Updated by Fabian about 1 year ago

But you also experienced an incorrect .currentDayHeader class in the month_large view before and therefore applied the fix?

Updated by Giovanni Minniti about 1 year ago

Yes I can confirm this. I am using Typo3 4.5.10 and calendar base 1.4.3.

Updated by Giovanni Minniti about 1 year ago

I corrected the incorrect mini calendar view by myself.
There is a wrong CLASSES Marker offset. Must start with CLASSES0!

Here my diff about that:

diff newSmallMonth.tmpl.new newSmallMonth.tmpl.org
24c24
< <tr class="###WEEK_CLASSES###"><th class="month-weeknums">###WEEK_LINK###</th><td class="dayNum###CLASSES0###">###DAYN
UM0###</td><td class="dayNum###CLASSES1###">###DAYNUM1###</td><td class="dayNum###CLASSES2###">###DAYNUM2###</td><td cla
ss="dayNum###CLASSES3###">###DAYNUM3###</td><td class="dayNum###CLASSES4###">###DAYNUM4###</td><td class="dayNum###CLASS
ES5###">###DAYNUM5###</td><td class="dayNum###CLASSES5###">###DAYNUM6###</td></tr>
---

<tr class="###WEEK_CLASSES###"><th class="month-weeknums">###WEEK_LINK###</th><td class="dayNum###CLASSES1###">###DAYN
UM0###</td><td class="dayNum###CLASSES2###">###DAYNUM1###</td><td class="dayNum###CLASSES3###">###DAYNUM2###</td><td cla
ss="dayNum###CLASSES4###">###DAYNUM3###</td><td class="dayNum###CLASSES5###">###DAYNUM4###</td><td class="dayNum###CLASS
ES6###">###DAYNUM5###</td><td class="dayNum###CLASSES0###">###DAYNUM6###</td></tr>

Updated by Daniel Minder 11 months ago

IMO the suggested patch above is wrong! Each template has two subparts: WEEK_SUBPART for weeks starting on monday and SUNDAY_WEEK_SUBPART for weeks starting on sunday. As you can see in the original newSmallMonth.tmpl the class number is equal to the day number when the week starts on sunday (since PEAR's getDayOfWeek returns 0 for sunday).

Thus, the correct patch is to change ONLY newLargeMonth.tmpl in the following way:

<!-- ###WEEK_SUBPART### start-->
<tr class="###WEEK_CLASSES###"><th class="month-weeknums" rowspan="###ROWSPAN###">###WEEK_LINK###</th><td class="dayNum###CLASSES1###">###DAYNUM0###</td><td class="dayNum###CLASSES2###">###DAYNUM1###</td><td class="dayNum###CLASSES3###">###DAYNUM2###</td><td class="dayNum###CLASSES4###">###DAYNUM3###</td><td class="dayNum###CLASSES5###">###DAYNUM4###</td><td class="dayNum###CLASSES6###">###DAYNUM5###</td><td class="dayNum###CLASSES0###">###DAYNUM6###</td></tr>
###ALLDAYS###
<tr class="days ###WEEK_CLASSES###">###DAYS###</tr>
<!-- ###WEEK_SUBPART### end -->

This works perfectly here.

Updated by Thomas Kowtsch 8 months ago

  • Status changed from Needs Feedback to Closed
  • % Done changed from 0 to 100

Commited in r66123 - thanks for the patch!

Also available in: Atom PDF