Notifications
Clear all

wpForo 1.x.x [Solved] My forum is stuck on the DD/MM/YYYY date format

9 Posts
5 Users
6 Likes
1,763 Views
VeganOstomy
Posts: 112
Topic starter
(@veganostomy)
Estimable Member
Joined: 5 years ago
Posted by: @robert

Fixed Bug: Problem using WordPress date-time type in forum

I wasn't having problems before, but now my forum is stuck on the DD/MM/YYYY format. Cleared all caches, tried resaving the WP date setting and the WPforo setting and no change.ย 

8 Replies
Robert
Posts: 9265
Admin
(@robert)
Support Team
Joined: 6 years ago

Please provide more information.

  • What is your WP date format?
  • Have you enabled WP date format in Forums > Settings > Features admin page?
  • Have you deleted wpForo Cache and other plugin caches?
  • Where exactly you see that problem, please leave some screen.
Macky
Posts: 792
(@percysgrowroom)
Noble Member
Joined: 3 years ago

Its better this way, just leave it as it is ๐Ÿ˜‰ย 

1 Reply
DroneBot Workshop
(@dronebot-workshop)
Joined: 3 years ago

Eminent Member
Posts: 25
Posted by: @percysgrowroom

Its better this way, just leave it as it is ๐Ÿ˜‰ย 

No. it's extremely confusing that way.ย  While most of the world accepts DD/MM/YYYYย  Americans use MM/DD/YYYY. Unless it's past the 13th of the month it isn't obvious which one is implemented.

I have my WordPress set to Y-m-d, which should give a "universal" date format of YYYY-MM-DD that everyone can understand.

But it doesn't work! I'm experiencing the identical problem as VeganOstomy is, and my posts now have that ugly date format.

here are MY answers to Roberts response to VeganOstomy:

  • My WP Date Format is Y-m-d
  • I have indeed enabled "Enable WordPress Date/Time Format" in settings
  • I've deleted the wpForo Cache, I have no additional caching on the site.
  • Every post has an incorrect date format.

I attached a screenshot but honestly, I'm not sure why you need one - the problem is simply that the date on all the posts is in DD/MM/YYYY format and not in the selected YYYY-MM-DD format.

Please advise, thanks!

ย 

Robert
Posts: 9265
Admin
(@robert)
Support Team
Joined: 6 years ago

Thank you for the bug report. We found the issue and fixed. It'll be included in next update very soon.

As a patch, if you want to fix it manually using Plugin Editor or Hosing cPanel > File Manager:

Open: wp-content/plugins/wpforo/wpf-includes/functions.php file.

ย 

Find this function (line from 1231 to 1252 included ):

function wpforo_date_format($type){
if( in_array($type, array('datetime', 'date', 'time')) ){
if( wpforo_feature('wp-date-format') ){
$date_format = get_option('date_format');
$time_format = get_option('time_format');
}else{
$date_format = 'Y-m-d';
$time_format = 'H:i:s';
}

$sep = ' ';
if( $type == 'datetime' ){
$type = $date_format . $sep . $time_format;
}elseif( $type == 'date' ) {
$type = $date_format;
}elseif( $type = 'time' ){
$type = $time_format;
}
}

return $type;
}

ย 

Change it to this:

function wpforo_date_format($type){
$sep = ' ';
$wp_format = wpforo_feature('wp-date-format');
if( $wp_format ){
$date_format = get_option('date_format');
$time_format = get_option('time_format');
} else {
$date_format = 'Y-m-d';
$time_format = 'H:i:s';
}
if( in_array($type, array('datetime', 'date', 'time')) ){
if( $type == 'datetime' ){
$type = $date_format . $sep . $time_format;
}elseif( $type == 'date' ) {
$type = $date_format;
}elseif( $type = 'time' ){
$type = $time_format;
}
} elseif( $wp_format ){
$type = $date_format . $sep . $time_format;
}
return $type;
}
CrisW
Posts: 281
(@crisw)
Reputable Member
Joined: 4 years ago
Posted by: @robert

Thank you for the bug report. We found the issue and fixed. It'll be included in next update very soon.

As a patch, if you want to fix it manually using Plugin Editor or Hosing cPanel > File Manager:

Open: wp-content/plugins/wpforo/wpf-includes/functions.php file.

WOW!ย  I Like the QUOTES!!ย  Thank you @Robert for posting the patch.ย ย 

I would like to add that issues with dates were also noticed in non-English WP - for some WordPress Translations.ย 

More info here:ย 

https://wordpress.org/support/topic/date-format-not-displaying-correctly/

https://wordpress.org/support/topic/wp-5-does-not-recognize-the-date-format-l-j-f-y/

As Wordpress is open-source, the translations are also done by volunteers.ย  ย  I just thought I'd share that here, too.ย ย 

So in case there are other Community Members here who have non-English Wordpress Installations, they can check their WP translation version in their native language and then maybe they can also help contribute to translate code ๐Ÿ™‚ย 

https://translate.wordpress.org/

Thanks again Robert for everything you and Sofy and Martin and Blackraz do for this FREE wpForo Forum!ย ย 

Spoiler
Suggestion
You guys need to have a donate button, on top of your AddOns Widget.ย  Seriously.ย  ๐Ÿ™‚

ย 

1 Reply
Robert
Admin
(@robert)
Joined: 6 years ago

Support Team
Posts: 9265

Thank you very much CrisW!

Page 1 / 2
Share: