Home › Toolset Professional Support › [Waiting for user feedback] years_from_now does not work as expected in WPML translated pages
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
This topic contains 23 replies, has 1 voice.
Last updated by Christopher Amirian 1 day ago.
Assisted by: Christopher Amirian.
Tell us what you are trying to do?
have a consistent output in all four languages of the site.
I have a 'OnThisDay' page that uses the years_from_now function as a query filter in a Toolset view. The EN page works fine, the other languages show previous dates. They show the last time the page was correctly updated, and does not 'refresh' to today.
Sometimes, by opening the EN page first, all other pages are correct too, but most of the time they are not. I do not really see a pattern.
Is there any documentation that you are following? not available as far as i could tell
Is there a similar example that we can see?
I tested today, and today = 22/8/25
FR, GE, NL show yesterday: hidden link
EN shows today, as it should: hidden link
What is the link to your site? hidden link
Hello. Thank you for contacting the Toolset support.
There seems to be some issue.
As I understand - you want to list the posts/events that falls on the current date? is that correct?
*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.
I have set the next reply to private which means only you and I have access to it.
I just cheked and it does show the correct events that falls on 26th August.
- hidden link
I am sorry, but this ticket will require more of your patience and persistence. The problem SOMETIMES happens, both on computer and phone.
So please, if you could try a few times more? Today, i could perfectly simulate the problem, today, at first it showed 25th instead of 26th, and then it correctly showed 26th, so you might, coïncidently, just have looked at a 'good' time.
I also removed those pages from cache.
Another suspect is 'timing' I think. When does the day start? Is that midnight of the servertime? Is that the timezone of the user looking at the page? It looks that before noon my time (GMT+1 Brussels Time) it shows the wrong date, and after my noon it shows the correct events on the EN page, but not on the other pages. So what is the difference on the EN page and on the translated pages?
So for today we can no longer test, the page is fine.
Tomorrow is another chance.
Thanks for your patience.
Hi,
Minesh will be available tomorrow to reply. But I suggest that you create a screencast for the issue so you can show us.
You can use loom.com or any alternative way to record your screen and share the video link with us.
That way, Minesh will understand what is the issue. Also, in the video try to show both the backend and front end.
Thanks.
Hi guys,
i created a Loom screencaptue video here : hidden link
I move around between the four languages of the page, and as you will notice two are ok, and two are not ok.
I review the video you shared but when I checked on site I can see with all languages three post and all belongs to 28th August.
And yes, that is exactly the problem. Mostly it does not work (like i show you in the video), and sometimes it works fine.
This still means there is a problem, and you telling me you cannot reproduce the error is not helping us any further.
What is the root cause for this behaviour of the translated pages? And how can we make it 100%?
It seems to me - the root cause is different timezones as explained with the following ticket:
- https://toolset.com/forums/topic/universal-time-for-toolset-date-field-in-wordpress-admin/?paged=2#post-2638341
- https://toolset.com/forums/topic/universal-time-for-toolset-date-field-in-wordpress-admin/?paged=2#post-2639189
Do you have posts added from different timezones and accessed in different timezones?
No.
I always create posts from my office in GMT+1 Brussels Time.
And the users I ask to check the pages are also in that same timezone, and some of them report that still today they see the pages of the 26th and not of the 28th.
But yes, we have summertime, so some of the posts might have been created in GMT+1 and others in GMT+2. But the users i check are all in the same time zone for the last few days.
When i read the ticket i do not see the relevance entirely. I use the Toolset date field to create dates for the events, I would assume the timestamp would be correct then.
I will do something else: i will exclude those pages from caching on the server side permanently.I will get back to you tomorrow with the results.
Yes - please exclude the pages from cache and also disable the view cache for all the languates and check what you discover.
I excluded those pages from the server cache
I set the Toolset 'view cache' off
I cleared the brwoser cache on the test machine
and today (30th at 12:15) it shows the EN page as it should, and the other three show the 29th.
Something else than caching is wrong....
That is really strange.
Here is a sandbox site and you can auto-login to it using the folloiwng link:
- hidden link
With the following custom field group that is assigned to the post type "Dog walkers". I've added custom field "Dog Birth Date" as custom date field.
- hidden link
You can setup few post with date and add a view and see if you able to reproduce the same issue. If yes, please share exact steps that I should follow that should lead me to reproduce the issue.
Thanks, I will try it on the sandbox.
In terms of reproducing...i set a clock everyday at the same moment (12:05), and check the pages in all languages. Most of the time there is a discrepancy between the EN page (which is always good), and the other languages. This means, I do not really 'take steps' that are reproducable, I just look at the pages every day.
The query filtering of all the pages is the same, so I do not understand why it would produce different results.
Well - in order to escalate the issue to next leval, either I should be able to reproduce the issue with clean installation or I will require exact steps to reproduce the issue on clean install.
Please try with the sandbox site I shared and check if you able to reproduce the issue by adding few posts with the said custom date field. If we faill to reproduce the issue with clean installation, I will require staging site as well as dupicator copy of your site.
Please give a shot to sandbox site I shared otherwise we will proceed to next required steps.