WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 4 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:
PR Number:

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 4 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
4 years ago

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

#1 @tyxla
4 years ago

  • Keywords has-patch added

#3 @SergeyBiryukov
4 years ago

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

#4 @SergeyBiryukov
4 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.