Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
`DateFormatter()` assumes 30 days per month, while February only has 28 days. Causes fails in tests.
Proposed resolution
Adjust `TimestampAgoFormatterTest()` to test the spirit of what is being covered, but make not glitchy because calendar systems are terrible.
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
Comment | File | Size | Author |
---|---|---|---|
#5 | interdiff-02-04.txt | 1.19 KB | mpdonadio |
#5 | 3035318-04.patch | 2.37 KB | mpdonadio |
#2 | 3035318-02.patch | 1.18 KB | mpdonadio |
Comments
Comment #2
mpdonadioThere is no reason to set the granularity to three here. That is not the purpose of the test, which is just to make sure the sample format appears correctly. `TimestampFormatterTest` covers the ago logic.
Comment #3
mpdonadioLong term, I wonder if we should think about using `\DateInterval()` instead of a home-grown algorithm. I don't recall why we didn't do that in the first place.
And this is currently a Critical because HEAD is failing, and probably will for the next few days.
Comment #5
mpdonadioComment #6
BerdirWas wondering if we should have a follow-up to test the granularity again, but per #2, that is already covered in another test.
Comment #7
Krzysztof DomańskiEach test ends with a failure now.
https://www.drupal.org/pift-ci-job/1210027 // probably first time
https://www.drupal.org/pift-ci-job/1210029
https://www.drupal.org/pift-ci-job/1210030
https://www.drupal.org/pift-ci-job/1210035
https://www.drupal.org/pift-ci-job/1210074
https://www.drupal.org/pift-ci-job/1210075
https://www.drupal.org/pift-ci-job/1209483
Comment #8
Krzysztof DomańskiComment #9
alexpottCommitted and pushed bdfafab7fb to 8.7.x and 6f3f6fb3ba to 8.6.x. Thanks!