Notifications
Clear all

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

9 Posts
5 Users
6 Reactions
2,743 Views
Posts: 112
Topic starter
(@veganostomy)
Estimable Member
Joined: 7 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: 10549
Admin
(@robert)
Support Team
Joined: 8 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.
Posts: 1163
(@percysgrowroom)
Noble Member
Joined: 5 years ago

Its better this way, just leave it as it is 😉 

1 Reply
(@dronebot-workshop)
Joined: 5 years ago

Trusted Member
Posts: 37
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: 10549
Admin
(@robert)
Support Team
Joined: 8 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;
}
Posts: 281
(@crisw)
Reputable Member
Joined: 6 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: 8 years ago

Support Team
Posts: 10549

Thank you very much CrisW!

Page 1 / 2