Page MenuHomePhabricator

Add new parameter tod DPL dateformat=<blah> to format dates
Closed, ResolvedPublic

Description

The DynamicPageList (aka Intersection) extension used on several wikimedia wikis, has the option to add the date the page was added to the category at the beginning of its entry on the list (addfirstcategorydate=true). The date is formated using the user's preferences. Perhaps it'd be useful to have a parmater dateformat= or userdateformat= (userdateformat is the name of the equivalent feature in DPL2) that takes syntax the same as {{#time:}} which formats the date. If its unspecified, the extension would default to user preferences, like current behavoir. If specified, it would format the date using a format string. For example

<DynamicPageList>
category=published
count=1
addfirstcategorydate=true
dateformat=F
</DynamicPageList>

Would make:
*January: Brain chemical Serotonin behind locusts’ swarming instinct
instead of
*January 30, 2009: Brain chemical Serotonin behind locusts’ swarming instinct

Note: at this time, this feature isn't really needed all that much, as we [at en wikinews] get along fine without it, but I think it might be a cool thing to have. (at the very least it might be useful to polish wikinews, as they currently use JS to accomplish this)

Note. related to bug 12787


Version: unspecified
Severity: enhancement

Details

Reference
bz17264

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 10:27 PM
bzimport set Reference to bz17264.
bzimport added a subscriber: Unknown Object (MLST).

Ok, now that i learned php, I made a patch for this. Filed under Bug 21963 as it fixes a bunch of other things as well.

Marking this FIXED as of r60800.