Question for jdate plugin

RobertG

Member
Hi,

I'm trying to upgrade a test site to J4.
I had no problem for the upgrade but I have an error with jdate plugin.

I need to set the next sunday date in a calendar.
Code:
date_default_timezone_set('UTC');
return date('Y-m-d',strtotime('next Sunday'));
Now we are on saturday june 10. With the J3 version (3.10.11), the new date is 2023-06-11 but with J4 (4.3.2) the new date remains on 2023-06-10

PHP version is 8.1 on both sites.

Could you tell me what is my error?
Thanks!
 

Attachments

  • 2023-06-10-jdate.png
    2023-06-10-jdate.png
    5.4 KB · Views: 49
I just installed Fabrik 4 delta on a test site J! 4.3.2 and created list, form, group, elements to display a choice of date, with the same code to display the date of the next Sunday.
It's Sunday the 11th, the next one should be the 18th, but the calendar returns the date of the 17th!
 
I changed the format for date adding h:i:s and the arrival date works now fine: next sunday is june 18
Code:
date_default_timezone_set('UTC');
return date('Y-m-d h:i:s',strtotime('next Sunday'));
But I'm using Javascript to calculate the next saturday for departure date: it works fine when I open the page on the first time, no more when I set another arrival date.
I'm not comfortable with JS ;)
 
I have issues like this, possibly because I'm based in Thailand. I set my Website Time Zone option (Global Configuration/Server) to Bangkok, not UTC.

In the JDate plugin - I change the 'Store Date As' option to Local Time. It's in JDate/Details/Date Formats tab. That works for me.

ps You would need to remove "date_default_timezone_set('UTC');" from your code.
 
I changed the format for date adding h:i:s and the arrival date works now fine: next sunday is june 18
Code:
date_default_timezone_set('UTC');
return date('Y-m-d h:i:s',strtotime('next Sunday'));
But I'm using Javascript to calculate the next saturday for departure date: it works fine when I open the page on the first time, no more when I set another arrival date.
I'm not comfortable with JS ;)

You'll have to check the console logs to see if any messages appear. (browser development tools)
 
Thanks to you two!

I tried to change UTC to "Europe/Paris", but had no change. Only adding h:i:s solved.
I think I saw a discussion on this forum where a member had a similar problem and added 00:00:00 to solve it.
 
Hi,

I changed the default time zone to "Europe/Paris". ;)
It works for the next Sunday.

But... change the "arrival" date needs to calculate the "departure date" to the next Saturday.
The two jdate plugins allow to manually type the date.
JavaScript makes the job, but when I set the sunday date to june 25, I need to click on the departure date field to change the displayed date to july first, but when I clic on the calendar icon, the date remains to june 24 (as when the arrival date was june 18).
I don't find how to change the date in the departure calendar.
 

Attachments

  • Capture d’écran 2023-06-13 121217.png
    Capture d’écran 2023-06-13 121217.png
    13 KB · Views: 50
  • Capture d’écran 2023-06-13 121702.png
    Capture d’écran 2023-06-13 121702.png
    38.1 KB · Views: 50
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top