Page MenuHomePhabricator

Allow more granular start and end time of campaigns
Open, Needs TriagePublicFeature

Description

Feature summary (what you would like to be able to do and where):
Start campaign at midnight of local time on day 1, end campaign at 23:59 of local time of last day.

Use case(s) (list the steps that you performed to discover that problem, and describe the actual underlying problem which you want to solve. Do not describe only a solution):
Tested with a testing campaign on Commons
Input 'start' time with '2023-06-12T07:00+08:00' and
Input 'end' time with '2023-07-12T08:00+08:00'
On 12 June 2023, 7:01am GMT +8hrs, the campaign header in testing campaign shows as the campaign has not started. It should reflect as active.
On 12 June 2023, 8:01 am GMT +8hrs, the campaign header in the testing campaign shows as the campaign has ended.
Ideally, between 7.00am to 8:00 am, the campaign should be live.
Technically, keying 'end' time with '2023-06-13T08:00+08:00', the campaign will only be live only on 14 June 2023, until 00:00 hours GMT 0 hours. (i.e. 14 June 2023 GMT +08:00)

Benefits (why should this be implemented?):
Some campaigns may require a start and end time, not just the dates set to certain hours local timezones for reasons. Instructions on the Campaigns documentation states that the parameters accept any UTC time format, which some campaign editors have formatted the time for the campaign to start and end at specific time on their local timezone, as above (as evidently seen through a search on Commons.

Event Timeline

This might be resolvable by changing the second line of the following functions, isActive() and wasActive() in Campaign.php from

$today = strtotime( date( "Y-m-d" ) );

to

$today = strtotime( "now" );

Documentation effectively allows for any start and end time in the configuration, with granularity down to the seconds, but the codes in the extension restricts the granularity to just date level at the server's timezone.

Change #1027230 had a related patch set uploaded (by Chlod Alejandro; author: Chlod Alejandro):

[mediawiki/extensions/UploadWizard@master] Also compare time in campaign start/end

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

Change #1027230 merged by jenkins-bot:

[mediawiki/extensions/UploadWizard@master] Also compare time in campaign start/end

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

I don't have the permission to edit Campaign-namespace pages on Commons. @Robertsky (or anyone with the right perms lurking), can you test if this is still an issue on your end?

Aklapper renamed this task from [Feature Request] Allow more granular start and end time of campaigns to Allow more granular start and end time of campaigns.Thu, May 16, 12:23 PM