Skip to:
Content

bbPress.org

Opened 16 years ago

Closed 15 years ago

#1280 closed defect (bug) (fixed)

_bb_time_function_return() ignores GMT offset

Reported by: mr_pelle's profile mr_pelle Owned by:
Milestone: 1.1 Priority: normal
Severity: normal Version: 1.1-alpha
Component: Locale - i18n/l10n Keywords:
Cc:

Description

As title says, _bb_time_function_return() does not consider bbPress gmt_offset.

According to this page, _bb_time_function_return() is referenced 7 times in bbPress source: are we going to replace all those instances with bb_datetime_format_i18n() (or similar gmt_offset-aware) or just change _bb_time_function_return()'s behavior?

Attachments (3)

1280.diff (404 bytes) - added by mr_pelle 16 years ago.
1280.2.diff (1.5 KB) - added by GautamGupta 16 years ago.
Fixes everything everywhere (related to time), also fixes implausible date feed error
1280.3.diff (598 bytes) - added by mr_pelle 16 years ago.

Download all attachments as: .zip

Change History (21)

#1 @mr_pelle
16 years ago

Sorry, the correct page is this, the other is bb_datetime_format_i18n()'s.

@mr_pelle
16 years ago

#2 @mr_pelle
16 years ago

  • Keywords has-patch tested added

bb_gmdate_i18n() call at line 3559 in functions.bb-template.php was missing the third arg, gmt: I set it to false and that's it. =)

#3 follow-up: @mr_pelle
16 years ago

  • Keywords has-patch tested removed

Weird.... my last patch setting "gmt" to false fixes search results time but wrecks front-page, forum and view last post time: my GMT is +2 and all last post times got +4 hours instead of -2, making some Freshness values go "-1 years"! :P
How is this possible??

#4 @mr_pelle
16 years ago

Probably the best thing is to filter dates and times with i18n functions...

#5 @chrishajer
16 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [2435]) add false parameter to bb_gmdate_i18n(). Fixes #1280. props mr_pelle

#6 in reply to: ↑ 3 @mr_pelle
16 years ago

Quoting myself:

Weird.... my last patch setting "gmt" to false fixes search results time but wrecks front-page, forum and view last post time: my GMT is +2 and all last post times got +4 hours instead of -2, making some Freshness values go "-1 years"! :P
How is this possible??

The patch wrecks all other last post links, I warned you!

#7 @GautamGupta
16 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

@GautamGupta
16 years ago

Fixes everything everywhere (related to time), also fixes implausible date feed error

#8 follow-up: @GautamGupta
16 years ago

I have attached another patch. Though I have tested it many times with different time zones, more testing would be appreciated.

#9 in reply to: ↑ 8 @mr_pelle
16 years ago

Replying to GautamGupta:

I have attached another patch. Though I have tested it many times with different time zones, more testing would be appreciated.

I've just finished testing it and works great!

#10 @chrishajer
16 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

(In [2437]) Honor gmt_offset. Fixes #1280. Props GautamGupta, mr_pelle

#11 follow-up: @mdawaffe
16 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

The localize parameter has nothing to do with gmt offset. It's purpose is to tell bbPress weather or not to localize the time into the current language or not.

For a Japanese install, for example:
localize=false: Fri, 03 Sep 2010 20:33:40 +0000
localize=true: 金, 03 9 月 2010 20:33:40 +0000

This changeset breaks feeds. Reverting, reopening.

We need a new arg for this. gmt=true/false with false being the default? Note, though, that bb_since() requires a GMT time be based, so if format=since, we have to force gmt=true.

#12 @mdawaffe
16 years ago

(In [2539]) Do not localize times in feeds: restore [2132]. Fixes #1092. See #1280.

@mr_pelle
16 years ago

#13 in reply to: ↑ 11 ; follow-up: @mr_pelle
16 years ago

  • Keywords has-patch added
  • Milestone changed from 1.0.3 to 1.1

Attached a patch based on mdawaffe's comment. Hope I understood it correctly...

#14 @mr_pelle
16 years ago

Is there anything wrong with my last patch?

#15 @mr_pelle
16 years ago

  • Version changed from 1.0.2 to 1.1-alpha

Any news?

#16 in reply to: ↑ 13 @GautamGupta
15 years ago

  • Keywords needs-patch added; gmt has-patch removed

Replying to mr_pelle:

Attached a patch based on mdawaffe's comment. Hope I understood it correctly...

The patch doesn't work for me. It shows me -1 years in the freshness column of topics table.

#17 @mr_pelle
15 years ago

  • Keywords needs-patch removed

It seems to work now, thank you [2132] revert! =)

#18 @mr_pelle
15 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

It works now, thanks to the reverting.

Note: See TracTickets for help on using tickets.