Page MenuHomePhabricator

OnThisDay endpoint skips AD years
Closed, ResolvedPublic

Description

The first entry on https://en.wikipedia.org/api/rest_v1/page/html/June_26 is from the year "4 AD". The onthisday endpoint skips this since "4 AD" is not recognized as a year based on the regex:

yearListElementRegEx : /^\s*(\d+)\s*(bce?)?\s*–\s(.+)/i

Complicating this is that (bce?) in the regex (the 2nd group is used the determine if the year is negative, and the third group is used to get the remaining text (in all languages). In the AD case the year should still be positive.

Expected result

The entry for the year 4 AD is included.

Actual result

The entry for the year 4 AD is not included.

Event Timeline

Change 364361 had a related patch set uploaded (by BearND; owner: BearND):
[mediawiki/services/mobileapps@master] onthisday: Recognize 4 AD as a year on enwiki

https://gerrit.wikimedia.org/r/364361

Change 364361 merged by jenkins-bot:
[mediawiki/services/mobileapps@master] onthisday: Recognize 4 AD as a year on enwiki

https://gerrit.wikimedia.org/r/364361

Stashbot subscribed.

Mentioned in SAL (#wikimedia-operations) [2017-07-12T20:11:00Z] <bsitzmann@tin> Started deploy [mobileapps/deploy@3f90bf1]: Update mobileapps to d30dae2 (T169930, T170225)

Mentioned in SAL (#wikimedia-operations) [2017-07-12T20:16:00Z] <bsitzmann@tin> Finished deploy [mobileapps/deploy@3f90bf1]: Update mobileapps to d30dae2 (T169930, T170225) (duration: 05m 00s)