Bug when use Date from/to (Dafault layout: Services Booking)

  • Facundo Esteban Palermo
  • Topic Author
  • Offline
  • New Member
  • New Member
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

Please Log in or Create an account to join the conversation.

More
2 years 1 month ago #154448 by Mr. Dam
OK, we will find the way to solve this issue
Thanks
Dam

Please Log in or Create an account to join the conversation.

  • Facundo Esteban Palermo
  • Topic Author
  • Offline
  • New Member
  • New Member
More
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
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.

More
2 years 1 month ago #154467 by Mr. Dam
OK, i will test your code and see the result.
Thanks
Dam

Please Log in or Create an account to join the conversation.

  • Facundo Esteban Palermo
  • Topic Author
  • Offline
  • New Member
  • New Member
More
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
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