- Posts: 15
- Thank you received: 1
Bug when use Date from/to (Dafault layout: Services Booking)
- Facundo Esteban Palermo
- Topic Author
- Offline
- New Member
Less
More
2 years 1 month ago #154447
by Facundo Esteban Palermo
Bug when use Date from/to (Dafault layout: Services Booking) was created by Facundo Esteban Palermo
Hi!
When Date from/to is set in the Dafault layout: Services Booking (Menu), it works fine when rendering, but if you go forward one month and go back, it allows you to go beyond the starting month.
Example:
Date from: 2023-01-01
Date to: 2023-12-01
shows correct, since January.
select february
go back to january
Now you can go back to December
When Date from/to is set in the Dafault layout: Services Booking (Menu), it works fine when rendering, but if you go forward one month and go back, it allows you to go beyond the starting month.
Example:
Date from: 2023-01-01
Date to: 2023-12-01
shows correct, since January.
select february
go back to january
Now you can go back to December
Please Log in or Create an account to join the conversation.
- Mr. Dam
- Offline
- Administrator
Less
More
- Posts: 12818
- Thank you received: 1659
2 years 1 month ago #154448
by Mr. Dam
Replied by Mr. Dam on topic Bug when use Date from/to (Dafault layout: Services Booking)
OK, we will find the way to solve this issue
Thanks
Dam
Thanks
Dam
Please Log in or Create an account to join the conversation.
- Facundo Esteban Palermo
- Topic Author
- Offline
- New Member
Less
More
- Posts: 15
- Thank you received: 1
2 years 1 month ago - 2 years 1 month ago #154454
by Facundo Esteban Palermo
Replied by Facundo Esteban Palermo on topic Bug when use Date from/to (Dafault layout: Services Booking)
I've made a few small changes and it works, but I wanted to check with you before I'm breaking something else
components\com_osservicesbooking\helpers\calendar.php
line 135
line 140
line 286
Is it possible that this worked like $date_from1 before using javascript and ajax?
I'm looking to see if $date_from might give me a conflict elsewhere in the booking process, but so far I haven't found anything. If you know, let me know please. Thank you
edit: this solution brings conflict when displaying the calendar in the checkout. since it uses $date_from to re-render it. I have to see how to pass the variable of the selected month. I suppose that the matter must go by cart class.
components\com_osservicesbooking\helpers\calendar.php
line 135
Code:
//$date_from = $year."-".$month."-01"; COMMENTED
line 140
Code:
//$date_from = $current_year."-".$current_month."-".$current_date; COMMENTED
line 286
Code:
if(($date_from != "") && ($year == date("Y",$date_from_int)) && ($month == intval(date("m",$date_from_int)))) //if(($date_from1 != "") I CHANGED THAT
Is it possible that this worked like $date_from1 before using javascript and ajax?
I'm looking to see if $date_from might give me a conflict elsewhere in the booking process, but so far I haven't found anything. If you know, let me know please. Thank you
edit: this solution brings conflict when displaying the calendar in the checkout. since it uses $date_from to re-render it. I have to see how to pass the variable of the selected month. I suppose that the matter must go by cart class.
Last edit: 2 years 1 month ago by Facundo Esteban Palermo.
Please Log in or Create an account to join the conversation.
- Mr. Dam
- Offline
- Administrator
Less
More
- Posts: 12818
- Thank you received: 1659
2 years 1 month ago #154467
by Mr. Dam
Replied by Mr. Dam on topic Bug when use Date from/to (Dafault layout: Services Booking)
OK, i will test your code and see the result.
Thanks
Dam
Thanks
Dam
Please Log in or Create an account to join the conversation.
- Facundo Esteban Palermo
- Topic Author
- Offline
- New Member
Less
More
- Posts: 15
- Thank you received: 1
2 years 1 month ago #154481
by Facundo Esteban Palermo
Replied by Facundo Esteban Palermo on topic Bug when use Date from/to (Dafault layout: Services Booking)
I have now made this change in addition to the above.
components\com_osservicesbooking\classes\booking.html.php line 3010
components\com_osservicesbooking\classes\booking.html.php line 3010
Code:
$session = Factory::getApplication()->getSession();
$selected_date = $session->get('selected_date');
$dateArr = explode("-",$selected_date);
$p_year = $dateArr[0];
$p_month = $dateArr[1];
HelperOSappscheduleCalendar::initCalendar($p_year, $p_month,$lists['category'],$lists['employee_id'],$lists['vid'], $lists['sid'],$lists['date_from'],$lists['date_to'], 1, 1);
Please Log in or Create an account to join the conversation.
Moderators: Mr. Dam
Support
Documentation
Information
Copyright © 2024 Joomla Extensions by Joomdonation. All Rights Reserved.
joomdonation.com is not affiliated with or endorsed by the Joomla! Project or Open Source Matters.
The Joomla! name and logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.
The Joomla! name and logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.