-
AuthorPosts
-
November 11, 2021 at 7:04 pm #10389Marius HänelParticipant
Hey everyone,
I’ve found an issue with the countdown date combined with a translation.
I’m using the plugin in a german region with a german translatet WordPress installation. When I select the countdown date, the selected month is translated to german as you can see in this picture https://ibb.co/LDwdCKh.This translated datestring can’t be converted into a PHP date object so the banner won’t show on the page until I disable the countdown.
We’re not using any translation plugins.
I hope you can fix this problem in the next updates.
I would change the month name into the number (i.e. 12 instead of December) or change the datepicker output into a timestamp instead of using the datestring.Best regards,
MariusNovember 11, 2021 at 11:57 pm #10392Aakash ChakravarthyKeymasterHi Marius,
Thanks for using Announcer PRO.
I’m not sure why the translation plugin is modifying admin fields. Can you please let me know the name of the plugin you are using ?
For now can you please enter the countdown date manually in the below format ?
2022/12/31 23:00
Thanks,
AakashNovember 12, 2021 at 5:39 pm #10394Marius HänelParticipantHey Aakash,
thanks for your answer.
I’m not using a translation Plugin. We’re just use a german WordPress installation from the official WordPress site.
When I enter 2022/12/31 23:00 manually the Datepicker changed the Date automatically back to 7. Dezember 2021 00:00 on click outside of the input.
I guess it’s maybe a region based feature from the UI-Datepicker with the used Settings.
I “fixed” this problem for myself temporarily with a code change but as long as I have no other solution I’m not able to update the Plugin without override my quick fix changes.
Best regards,
MariusNovember 12, 2021 at 11:59 pm #10395Aakash ChakravarthyKeymasterHi Marius,
Got it. The date picker should not be affected though user language is different. I’ll test it out at my end.
Thanks,
AakashNovember 13, 2021 at 12:20 am #10396Aakash ChakravarthyKeymasterHi Marius,
I tried with German language. After picking the date/time or saving the announcement, the countdown timer value was not translated.
I guess some other plugin is tapping into the request and changing the value.
Any guess on which plugin might be doing this ?(or) some browser extension ?
Also can you please share the changes you made to fix this issue ? I would make a note of it in case this issue is seen widely with many users.
Thanks,
AakashNovember 16, 2021 at 7:37 pm #10403Marius HänelParticipantHey Aakash,
thanks for checking my problem.
I’ve set up a new WordPress installation without any other plugin and there it works.
I have no idee which other plugin caused this problem.
In the next few days I will check which Plugin caused the problem.I’ve made this change to solve the problem for me:
In the file includes -> display.php in line 277 I changed this line
$countdown_time = new DateTime( $settings[ 'cdt_countdown' ], new DateTimeZone( $wp_timezone_name ) );
To this
$countdown_time = DateTime::createFromFormat('j. F Y H:i', $settings[ 'cdt_countdown' ]);
But I guess it will only work when you have the same Datetime format like me (i.e. 7. Dezember 2021 00:00) in the Datepicker.
Best regards,
MariusNovember 16, 2021 at 9:57 pm #10404Aakash ChakravarthyKeymasterHi Marius,
Sure please do see if you are able to identify the plugin and check of there is any option provided by them to disable this.
Otherwise for now let it be as is.
Since this is an internal field, We cannot make it as a configurable option.
So I’ll update you on case of an update relased for the plugin, then you can make same change as now.
If I get any new idea, I’ll update accordingly.
Thanks,
Aakash -
AuthorPosts
- You must be logged in to reply to this topic.