Poll: Would you find these methods helpful in the CodeIgniter 4 Time class? You do not have permission to vote in this poll. |
|||
Yes, this improves readability and simplifies code. | 7 | 87.50% | |
No, the current methods are sufficient. | 1 | 12.50% | |
Total | 8 vote(s) | 100% |
* You voted for this item. | [Show Results] |
Proposal: Add isPast() and isFuture() to CodeIgniter 4 Time Class |
@grimpirate I see your point about isBefore(Time::now()) being explicit, but I still believe isPast() and isFuture() improve readability and developer experience. IMO these methods are intuitive and reduce repetitive code.
Changing the method signature of isBefore() and isAfter() to accept null and assume Time::now() does not improve readability - it actually makes things more confusing. The method name isBefore() without a parameter is not intuitive - it doesn’t clearly convey that it’s comparing against Time::now(). On the other hand, isPast() and isFuture() are IMO immediately clear in meaning. While extending the class is an option, this can be a small yet useful addition that benefits most developers without adding complexity to the framework. |
Messages In This Thread |
Proposal: Add isPast() and isFuture() to CodeIgniter 4 Time Class - by datamweb - 02-19-2025, 05:15 PM
RE: Proposal: Add isPast() and isFuture() to CodeIgniter 4 Time Class - by michalsn - 02-20-2025, 12:00 AM
RE: Proposal: Add isPast() and isFuture() to CodeIgniter 4 Time Class - by grimpirate - 02-20-2025, 03:38 PM
RE: Proposal: Add isPast() and isFuture() to CodeIgniter 4 Time Class - by michalsn - 02-20-2025, 11:17 PM
|