WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 6 years ago

#34602 closed enhancement (fixed)

Use the new MONTH_IN_SECONDS constant in human_time_diff()

Reported by: tyxla Owned by: SergeyBiryukov
Milestone: 4.4 Priority: normal
Severity: normal Version: 4.4
Component: Formatting Keywords: has-patch
Focuses: Cc:

Description

#33397 introduces a new constant MONTH_IN_SECONDS, which is defined as 30 * DAY_IN_SECONDS.

The human_time_diff() function uses the month time in its logic as well, and it is also currently using a hardcoded 30 * DAY_IN_SECONDS value for months.

So for consistency we should replace all occurrences of 30 * DAY_IN_SECONDS to MONTH_IN_SECONDS in human_time_diff().

Attachments (1)

34602.patch (994 bytes) - added by tyxla 6 years ago.
Use the new MONTH_IN_SECONDS constant for the month representation in the human_time_diff() logic.

Download all attachments as: .zip

Change History (5)

@tyxla
6 years ago

Use the new MONTH_IN_SECONDS constant for the month representation in the human_time_diff() logic.

#1 @tyxla
6 years ago

  • Keywords has-patch added

#3 @SergeyBiryukov
6 years ago

  • Milestone changed from Awaiting Review to 4.4
  • Owner set to SergeyBiryukov
  • Status changed from new to reviewing

#4 @SergeyBiryukov
6 years ago

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

In 35555:

Use the MONTH_IN_SECONDS constant added in [33698] for the month representation in human_time_diff() logic.

Props tyxla.
Fixes #34602.

Note: See TracTickets for help on using tickets.