php / php/doc-en

Update DateInterval for better understanding of Properties

Open
#3,157 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement Extension: date
Dominant language
XML
Stars
596
Forks
890
Avg merge
1d 15h
Merged PRs (30d)
55

Description

From manual page: https://php.net/class.dateinterval


Please add the value ranges to the properties where applicable.
In my case the reading of the documentation caused a bug as I was comparing the dates "2023-12-31" with "2024-01-31" which caused the d-Property to become 0 instead of 31 (what I expected). When investigating the issue I only realized that I should use the days-Property instead.

Adding the value ranges helps to realize that on the first sight.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Open the DateInterval class page at https://php.net/class.dateinterval and review its property descriptions and documented ranges. Add value ranges where they apply, including clarifying the distinction between the d and days properties. Done means the relevant properties explain their ranges clearly enough to avoid the reported comparison mistake.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.