Menu Content

Podpora

> Diskusní fóra, FAQs & placená podpora
Welcome, Guest
Username Password: Remember me

URGENT - Calendar doesnt work 1st wk of a new year
(1 viewing) (1) Guest
Support forum for users using free edition of Book it!. These forums are for mutual help among users.

NOTE: Due to our capacity limitations, ARTIO does not monitor this forum category regularly. If you want direct support from ARTIO, please start a ticket at Support Dashboard. If you have no support ticket available, you need to purchase it. .

TOPIC: URGENT - Calendar doesnt work 1st wk of a new year

Re: URGENT - Calendar doesnt work 1st wk of a new year 8 years, 12 months ago #47342

Had the same issue.

Basically the problem is in this file:

C:\Program Files\wamp\www\booking\administrator\components\com_booking\helpers\booking.php


in this function:

function getWeekCalendar(&$subject, &$setting, $count = 'week', $isAdmin = false, $rids = null)


You need to replace the following lines:

this:
$setting->defaultYear = $setting->currentYear = (int) $current->format('Y');

with this:
$setting->defaultYear = $setting->currentYear = (int) $current->format('o');


this:
$setting->current = $current->format('Y-W');

with this:
$setting->current = $current->format('o-W');


this:
$setting->selected = $selected->format('Y-W');

with this:
$setting->selected = $selected->format('o-W');


this:
$setting->lastAllowYear = (int) $lastAllow->format('Y');

with this:
$setting->lastAllowYear = (int) $lastAllow->format('o');


this:
$setting->lastAllow = $lastAllow->format('Y-W');

with this:
$setting->lastAllow = $lastAllow->format('o-W');


this:
$setting->previousYear = (int) $last->format('Y');

with this:
$setting->previousYear = (int) $last->format('o');


Basically, you change the 'Y' format to the 'o' format. It gets the proper year if the current week is not from the current year.

o ISO-8601 year number. This has the same value as Y, except that if the ISO week number (W) belongs to the previous or next year, that year is used instead. (added in PHP 5.1.0)



I hope that helps somebody. The developer should say their final word on this, of course.
The topic has been locked.

Re: URGENT - Calendar doesnt work 1st wk of a new year 8 years, 12 months ago #47344

Thanks jedivader. It works for me.
The topic has been locked.

Re: URGENT - Calendar doesnt work 1st wk of a new year 8 years, 12 months ago #47345

It worked for 5 minuts
I think after reservation something goes wrong and calendar flips over
The topic has been locked.

Re: URGENT - Calendar doesnt work 1st wk of a new year 8 years, 12 months ago #47346

same problem ...

lasertag-sohren.de

just 2017 in the calendar viewable. Theres alot of damage for us. No customer can make a booking this days. Thats very not ok
The topic has been locked.

Re: URGENT - Calendar doesnt work 1st wk of a new year 8 years, 12 months ago #47347

i have the same problem
artio 2.3.1 on joomla 2.5 now shows january 2017! :-/

we are all losing money due to this error, we expect an urgent correction by artio software programmers!
The topic has been locked.

Re: URGENT - Calendar doesnt work 1st wk of a new year 8 years, 12 months ago #47348

Good news - the problem will be solved itself on Monday Jan, 4.

It assumes these first days as a week number 53. That's why we have year 2017.

A added some lines of code to work around the problem.

As jedivader said you should modify file

administrator\components\com_booking\helpers\booking.php


in function:

function getWeekCalendar(&$subject, &$setting, $count = 'week', $isAdmin = false, $rids = null)


make some changes:

1. Instead of

$setting->current = $current->format('Y-W');


put

 
if ((int) $current->format('W') > 52) {
$setting->current = $current->format('Y') . '-01';
} else {
$setting->current = $current->format('Y-W');
}


2. AFTER (not instead)

$setting->week = $setting->defaultWeek? $setting->defaultWeek : 1;


add

 
if ($setting->week > 52) $setting->week = 1;


On my testing environment it works.
The topic has been locked.
Přihlášení uživatele Prázdný