Simple Machines Community Forum

SMF Support => SMF 2.1.x Support => Topic started by: Shades. on January 17, 2022, 06:53:16 PM

Title: Backwards Calendar Dates
Post by: Shades. on January 17, 2022, 06:53:16 PM
2.1RC4

I just added this event (https://bikerhound.com/index.php?topic=389.msg426;topicseen#new) to my calendar and the dates off to the right top of the post shows "April 10,2022April 06, 2022" all bunched up and backwards. It should read "April 06, 2022 - April 10, 2022".

How can I fix this?
Title: Re: Backwards Calendar Dates
Post by: ozp on January 18, 2022, 01:53:35 AM
Look in Display.template.php in your theme.

Search for foreach ($context['linked_calendar_events'] as $event)
Then you have the code for displaying the dates a bit further down.
This is the code from the default theme

if (!empty($event['allday']))
{
echo '<time datetime="' . $event['start_iso_gmdate'] . '">', trim($event['start_date_local']), '</time>', ($event['start_date'] != $event['end_date']) ? ' &ndash; <time datetime="' . $event['end_iso_gmdate'] . '">' . trim($event['end_date_local']) . '</time>' : '';

You have probably got the start and end date mixed up
Title: Re: Backwards Calendar Dates
Post by: Shades. on January 18, 2022, 12:34:25 PM
Just took a look and my code is exactly the same as what you posted! :o

Here is my Display.template file...

Edit: Also just uploaded a fresh/clean Display.template.php file and no change. Dates are still reversed!

Also by looking at a default install the dates are on the left so I don't have a clue how they got moved to the right. I guess one of my mods changed something. :(
Title: Re: Backwards Calendar Dates
Post by: Shades. on January 18, 2022, 01:23:26 PM
I have concluded that it is the Ehportal mod that caused this because when I uninstalled it everything displayed as it should by default so I will try and post over at that site and will post a fix here if I get one. Otherwise I may have to switch to another portal as bad as I don't want to! ???

Edit: Apparently I don't have permission to post over there soooo....(scratching head)!
Title: Re: Backwards Calendar Dates
Post by: Aleksi "Lex" Kilpinen on January 18, 2022, 02:45:55 PM
Quote from: Shades. on January 18, 2022, 01:23:26 PMEdit: Apparently I don't have permission to post over there soooo....(scratching head)!
Interesting. Just took a look at their support board and it seems kinda quiet, latest post is an unanswered complain about broken layout with shout box block made in september 21.
Title: Re: Backwards Calendar Dates
Post by: Shades. on January 19, 2022, 12:50:51 PM
Is there any css or some codes I can put in place to keep anything from changing that part of the dates in display.php or display.template.php or any other file?

@Chen Zhen can you provide any help on this? O:)
Title: Re: Backwards Calendar Dates
Post by: @rjen on January 19, 2022, 01:02:56 PM
Well, it is caused by the portal_shoutbox.css that applies a float to the ' time' element...

time{
font: 11px 'lucida grande', tahoma, verdana, arial, sans-serif;
font-weight: normal;
float:right;
color: #D5D5D5;
}

I would say that's not good practice, because an element named 'time' will most likely also exist outside the portal...

So there you are...

You can add this at the end of your css to undo it, but it would be better it the portal would not change this generic element..

div.information time {
    float: none;
}
Title: Re: Backwards Calendar Dates
Post by: Shades. on January 19, 2022, 01:11:54 PM
Awesome thank you! 8)
Title: Re: Backwards Calendar Dates
Post by: @rjen on January 19, 2022, 01:58:31 PM
Just an FYI. Your site looks quite funky on mobile. Not sure what's going on there but this cannot be good...
Title: Re: Backwards Calendar Dates
Post by: Shades. on January 19, 2022, 06:31:24 PM
Thanks yeah I'm working on that! I think a lot of it has to do with the ehportal so I'm testing now with ezportal. ;)
Title: Re: Backwards Calendar Dates
Post by: Shades. on January 20, 2022, 11:44:00 PM
Quote from: @rjen on January 19, 2022, 01:58:31 PMJust an FYI. Your site looks quite funky on mobile. Not sure what's going on there but this cannot be good...
I switched to ezportal...let me know how it looks to you now. ;)
Title: Re: Backwards Calendar Dates
Post by: @rjen on January 21, 2022, 02:36:38 AM
On mobile I am not seeing any evidence of a portal. If that's what you were aiming for (?) it looks better...

Title: Re: Backwards Calendar Dates
Post by: Shades. on January 21, 2022, 09:08:34 AM
Yes thanks! :)  I have the ezportal turned off for mobile...couldn't do that with ehportal. :'(

Edit: Just discovered that its not the ehportal mod alone, ehportal and the curve2 color changer mod do not work together on mobile. :(
Title: Re: Backwards Calendar Dates
Post by: @rjen on January 21, 2022, 10:06:12 AM
Don't know.

I am a long-time Tinyportal user, so I have not tried other portals recently...
Title: Re: Backwards Calendar Dates
Post by: Diego Andrés on January 21, 2022, 12:30:06 PM
I doubt the color curve mod is in any way related to mobile problems
Title: Re: Backwards Calendar Dates
Post by: Shades. on January 21, 2022, 01:32:28 PM
I'm not sure about anything lol here's all I know: :-\

I know it's gotta be in css somewhere but I cant find the problem!

I have several 2.1RC4 test sites and all of them have Ehportal and Curve Color Changer and work fine on mobile. But for some reason when I try to use my main sites backup sql for a freshly installed test set and install the mentioned mods (with no other mods installed) and it comes out like @rjen pointed out on mobile. But I don't have that problem with EZportal and the Color Changer, they work just fine together on mobile!

Something weird going on here! :o