-
Notifications
You must be signed in to change notification settings - Fork 299
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: #5022 - don't show date differences on 32 bit systems)
- Loading branch information
1 parent
e6cfb3e
commit 8eeae41
Showing
1 changed file
with
3 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8eeae41
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The condition is not correct. It's not that the anniversary date of the event happened more than 100 years ago (which from now on would be 1924, 1925, etc.), but rather that the minimum representable date (timestamp) in 32-bits is 13 DEC 1901 20:45:54 UTC.
8eeae41
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please consider something like the following so that 32-bit folks don't get less details:
<?php if (PHP_INT_SIZE >= 8 || $fact->date()->gregorianYear() > 1901) : ?>
(<?= Registry::timestampFactory()->now()->subtractYears($fact->anniv)->diffForHumans() ?>)
<?php else : ?>
(<?= I18N::plural('%s year', '%s years', $fact->anniv, I18N::number($fact->anniv)) ?>)
<?php endif ?>
8eeae41
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure. I don't have access to a 32 bit system, so couldn't test anything.