Last modified: 2013-09-15 16:53:59 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T51007, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 49007 - #time function returns incorrect value if asked for previous month
#time function returns incorrect value if asked for previous month
Status: RESOLVED WONTFIX
Product: MediaWiki extensions
Classification: Unclassified
ParserFunctions (Other open bugs)
unspecified
All All
: Low minor (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-05-31 08:27 UTC by vssun
Modified: 2013-09-15 16:53 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
The function {{#time:F|-1 months}} returns current month's name in place of previous month. (22.46 KB, image/png)
2013-05-31 08:27 UTC, vssun
Details

Description vssun 2013-05-31 08:27:35 UTC
Created attachment 12432 [details]
The function {{#time:F|-1 months}} returns current month's name in place of previous month.

Please see the screenshot. The function {{#time:F|-1 months}} returns current month's name in place of previous month.
Comment 1 vssun 2013-05-31 08:29:19 UTC
The screenshot was taken from English Wikipedia.
Comment 2 Michael M. 2013-05-31 09:25:32 UTC
I'm not sure this is a bug: "May 31 - 1 months" is "April 31", which is "May 1".

Just some examples (with format c, to show the whole date):

    {{#time:c}}           = 2013-05-31T09:24:00+00:00
    {{#time:c|-1 months}} = 2013-05-01T09:24:00+00:00
    {{#time:c|-2 months}} = 2013-03-31T09:24:00+00:00
    {{#time:c|-3 months}} = 2013-03-03T09:24:00+00:00

So {{#time:F|-1 months}} = May is strange, but consistent.
Comment 3 Michael M. 2013-05-31 09:33:20 UTC
http://www.gnu.org/software/tar/manual/html_node/Relative-items-in-date-strings.html#SEC125:

"The fuzz in units can cause problems with relative items. For example, ‘2003-07-31 -1 month’ might evaluate to 2003-07-01, because 2003-06-31 is an invalid date. To determine the previous month more reliably, you can ask for the month before the 15th of the current month."
Comment 4 Liangent 2013-05-31 09:56:16 UTC
Maybe {{#time:F|2000-{{#expr:{{#time:m}}-1}}-1}}?
Comment 5 vssun 2013-05-31 11:03:41 UTC
Lowering the priority to minor. If it is not at all a bug, it may please be closed.
Comment 6 Bartosz Dziewoński 2013-09-15 16:53:59 UTC
I don't think this is fixable – as Michael explained, it's a quirky, but expected behavior. Closing.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links