• clemensfuhrbach

    (@clemensfuhrbach)


    Hey there,
    recently I have an error in displaying the date. All days are correct in my database, but wrong while created for any display (front-/backend).

    As a quick workaround I replaced line 227 and 237
    $mfgigcal_date .= “<div class=\”day\”>” . date_i18n(“d”, $start_date) . “</div>”;

    with
    $mfgigcal_date .= “<div class=\”day\”>” . $startArray[2] . “</div>”;

    Same in line 244 but there with $endArray
    $mfgigcal_date .= “<div class=\”day\”>” . $endArray[2] . “</div>”;

    As a quick workaround that works for me, however, it would be great if someone has an idea what’s wrong/not working on that spot.

    Cheers
    Clemens

Viewing 15 replies - 1 through 15 (of 21 total)
  • Plugin Author Matthew Fries

    (@brewermfnyc)

    Clemens

    This helps a lot. I’ve had 2 people tell me they are having this issue. I’ve been unable to replicate it here and this the first info I’ve gotten confirming that the data in the DB isn’t distorted – that it’s an issue with date_i18n() returning the wrong day. Looking into it!

    Did you happen to notice, is it just the day (number) that is incorrect? Or is it actually shifting it by a day?

    For example: Nov 30 becomes Dec 1 on output.

    Also – are you seeing this in the admin area AND on your site? Or is it correct in admin area?

    Thanks for the help.

    Thread Starter clemensfuhrbach

    (@clemensfuhrbach)

    Hey Matthew,

    it pretty much looks like the day is always -1 – so 01.01.2020 turns 31.12.2019

    Also – are you seeing this in the admin area AND on your site? Or is it correct in admin area?

    I can confirm that it is wrong in the table/listing of all dates, but it is correct if I go and edit one special event with its details.

    If you need further information just let me know!

    Plugin Author Matthew Fries

    (@brewermfnyc)

    Thanks for the help. I know that WP date function is reported to be kinda finicky, so I’m looking for answers. I might send you a patch to try out (since I can’t replicate the problem here) if you’re game. Would be nice to know an update does what I hope before I release it!

    Thread Starter clemensfuhrbach

    (@clemensfuhrbach)

    Thanks, I just tried out the update, but it’s breaking down my WordPress with an critical error…

    Plugin Author Matthew Fries

    (@brewermfnyc)

    Eeek!! Can you tell me what the error says? I did test it on 5 or 6 different sites I run before posting here and didn’t have any issues.

    Thread Starter clemensfuhrbach

    (@clemensfuhrbach)

    Fatal error: Cannot redeclare date_format_php_to_js() (previously declared in /…/101_live/wp-content/plugins/cqpim/script-enqueing.php:1651) in /…/101_live/wp-content/plugins/mf-gig-calendar/mf_gig_calendar.php on line 961

    Actually I think it seems to be a plugin-plugin issue in my case

    Thread Starter clemensfuhrbach

    (@clemensfuhrbach)

    Hey @royzband,
    I had a quick look at your page and I think you can work with the workaround I posted if the current version is not working/till the update is working.

    As a quick workaround I replaced line 227 and 237
    $mfgigcal_date .= “<div class=\”day\”>” . date_i18n(“d”, $start_date) . “</div>”;

    with
    $mfgigcal_date .= “<div class=\”day\”>” . $startArray[2] . “</div>”;

    Same in line 244 but there with $endArray
    $mfgigcal_date .= “<div class=\”day\”>” . $endArray[2] . “</div>”;

    • This reply was modified 4 years, 11 months ago by Jan Dembowski. Reason: Deleted offer for email

    Thankyou for your help. I’m not sure where to find these lines 227 and 237

    Thread Starter clemensfuhrbach

    (@clemensfuhrbach)

    in
    mf_gig_calendar.php

    Line 215ff

    function mfgigcal_FormatDate($start_date, $end_date) { // FUNCTION ///////////

    OK, I found where to edit those lines but am getting an error when trying to save:

    Your PHP code changes were rolled back due to an error on line 227 of file wp-content/plugins/mf-gig-calendar/mf_gig_calendar.php. Please fix and try saving again.

    syntax error, unexpected ‘class’ (T_CLASS)

    So workaround not working in my case. Matthew, is there a patch or update somewhere? Someone mentioned trying it, but I don’t see where I can download it.
    If not, what is the timeline for getting a fix. I’m getting a bit desperate, so to avoid fans showing up on wrong dates I now will go in and adjust our dates one day later to make them appear correct online. But then everything will be messed up again once fixed, so I don’t want to manually change too much.
    thank you, and sorry this is a problem for you. I love your plug-in……

    Plugin Author Matthew Fries

    (@brewermfnyc)

    Sorry to be MIA on this. Crazy busy in my normal life at the moment.

    The only way I was able to replicate this problem was by messing with my time zone in WP. The tool that provides the translated dates (so it can be in many languages) doesn’t handle time zones very well. My latest update 1.0.4 fixed that for me on my couple testing servers. So I’m just guessing at what might be the problem for you. Still looking for a solution here.

    If you contact me directly through my website I might be able to help you specifically – at least temporarily until I find a real solution.

    Sorry for the problems here. Again I’ve got 3-4 different versions of WP running on different versions of PHP and can’t replicate the problem…

    Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    @clemensfuhrbach Do not post your email address in these forums again. Off forum contact has gone amazingly bad in the past so please keep it here.

    If you are not the original person who posted this topic and need support then per the forum guidelines please start your own topic.

    https://www.ads-software.com/support/forum-user-guide/faq/#i-have-the-same-problem-can-i-just-reply-to-someone-elses-post-with-me-too

    You can do so here.

    https://www.ads-software.com/support/plugin/mf-gig-calendar/#new-post

    Update on problem reported by @royzband

    Dates were still showing as -1 day.

    After reading through this thread, I tried changing the timezone in WP settings.

    Previous settings were UTC-05, and I changed it to use “New York” and that solved the problem. The dates are now showing correctly.

    I didn’t dig deeper than that, so I don’t know whether the change worked because WP treats a name-based timezone differently, or if all that was required was a resetting of the timezone.

    But either way, it worked.

    Disappointing further update on problem reported by @royzband

    After a few days, we noticed that the problem was still there, but this time with a twist that may be noteworthy or not.

    Dates within the next 90 days are still shown correctly, but dates more than 90 days in the future are showing with the 1-day offset (-1) on the public view.

    One additional observation that may help is that the problem is even noticeable within the admin pages:

    • The admin “upcoming performances” list view also shows the -1-day offset.
    • The admin “add/edit” view must be set +1-day in order to counteract the -1-day offset in the other views.

    I’m not sure what could explain this. Perhaps the plugin author has some thoughts.

Viewing 15 replies - 1 through 15 (of 21 total)
  • The topic ‘Wrong Date (Day -1)’ is closed to new replies.