I have some Events with a Start Date and End Date. When Displaying the Dates, I use several conditional Statements to determine which final display layout of the date that I want.
For Example, if the Start Date and End Date are both the same day (ie... October 15th, 2024) then I only want to display one single date... October 24th, 2024
However if the Start Date and End Date span over 2 different months or 2 different years, I need to display both the Start and End Date separately.
Here is the conditional Statement that I use to compare the Months and years...
In one particular case the start date is May 5, 2022 and the End Date is also May 5, 2022....
[code]
####################
wpv-conditional attributes
####################
Array
(
[if] => ( 'May' ne 'May' ) OR ( '2022' ne '2022' )
[debug] => true
)
####################
Debug information
####################
--------------------
Original expression: ( 'May' ne 'May' ) OR ( '2022' ne '2022' )
--------------------
After replacing 1 general variables and comparing strings: ( 'May' ne 'May' ) OR ( '2022' ne '2022' )
Comparing May to May
After replacing 2 general variables and comparing strings: ( 'May' ne 'May' ) OR ( 2022 ne 2022 )
Comparing 2022 to 2022
Hello. Thank you for contacting the Toolset support.
In this case:
In one particular case the start date is May 5, 2022 and the End Date is also May 5, 2022....
What is your expected result. Can you please share admin access details and problem URL.
*** 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.
You shared:
However if the Start Date and End Date span over 2 different months or 2 different years, I need to display both the Start and End Date separately.
===>
Can you please tell me with what "exhibition" post I should check against which have start and end date configured as different dates in terms of month and year.
When I checked the exhibition posts:
- hidden link
I see all posts are configured with start date and end date with same month and year.
The Exhibitions Display page on the front end is here... hidden link
Look at the Exhibition called Four of a kind
The start date is August 24, 2022 and the end date is August 24, 2022
Therefore, due to the logic in my conditional statements the front end should display it as ONLY August 24, 2022 (which it does correctly).... However it also displays it as August 24 – 24, 2022.. which is incorrect (that conditional statement should be FALSE.. but it ends up as TRUE).
####################
wpv-conditional attributes
####################
Array
(
[if] => ( 'August' ne 'August' ) OR ( '2022' ne '2022' )
[debug] => true
)
####################
Debug information
####################
--------------------
Original expression: ( 'August' ne 'August' ) OR ( '2022' ne '2022' )
--------------------
After replacing 1 general variables and comparing strings: ( 'August' ne 'August' ) OR ( '2022' ne '2022' )
Comparing August to August
After replacing 2 general variables and comparing strings: ( 'August' ne 'August' ) OR ( 2022 ne 2022 )
Comparing 2022 to 2022