As it stands, WatchedItem class would accept and store any string on the expiry field. As a result ::getExpiry() is unpredictable and for a client to reliably use it they need to normalize it. A few bugs have surfaced because of this. E.g. T253937
Also, I'm not sure but this work might solve T260009(?)
Notes from Eng-meeting
- Use ExpiryDef::normalizeExpiry() in WatchedItem constructor, throw exception if invalid
- Store expiry as MWTimestamp or CovertibleTimestamp to ensure we compare dates in UTC (WatchedItem::isExpired())
- getExpiry() to return formatted as TS_MW
Acceptance criteria
- Expiry should be normalized and store as either MWTimestamp or CovertibleTimestamp (whatever makes more sense)
- Creating a WatchedItem with an unsupported string should fail
- getExpiry() to return formatted as TS_MW or whatever makes more sense
- Confirm that the $wgLocaltimezone > UTC bug detailed in T260009 is resolved with the changes implemented in this ticket