Last modified: 2013-11-02 00:58:08 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 T21464, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 19464 - #time should ignore newlines.
#time should ignore newlines.
Status: RESOLVED WONTFIX
Product: MediaWiki extensions
Classification: Unclassified
ParserFunctions (Other open bugs)
unspecified
All All
: Low enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
http://www.wikia.com/wiki/Forum:Templ...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-07-01 14:56 UTC by Chris
Modified: 2013-11-02 00:58 UTC (History)
3 users (show)

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


Attachments
minimal testcase (245 bytes, text/plain)
2009-07-04 20:08 UTC, Chris
Details

Description Chris 2009-07-01 14:56:49 UTC
As is shown at the bottom of the given page, the #time parser function ignores all characters beyond the first newline.  If it could instead treat them like spaces, that would be fantastic.  Some other functions may also benefit from such a modification, but I'm not sure what they would be.

Thanks.
Comment 1 Chris 2009-07-04 20:08:25 UTC
Created attachment 6300 [details]
minimal testcase

I just remembered that I didn't post the test case from the given URL.  I don't want this bug to be ignored just because of that.  The expected result is that all three lines output the same thing (middle line should be the same as others); the actual result is in the comments.
Comment 2 Niklas Laxström 2009-07-05 08:41:25 UTC
It is not ignored, but it is parsed as a time instead (hey, I didn't design this function). Doing something magic here could produce unexpected results for inputs <date>\n<time>, if the time was parsed as part of date.
Comment 3 Chris 2009-07-05 21:55:55 UTC
That's not documented that I can find; in fact, 'H:i:s' is always included on the same line as 'Y m d' at [ http://www.mediawiki.org/wiki/Help:Extension:ParserFunctions#.23time: ].  So it seems that an ignored newline would leave interpretation of date-time strings unaltered.  Is there a discrepancy there, or am I not thinking of some special case that the source allows for?
Comment 4 Niklas Laxström 2009-07-06 06:22:32 UTC
It is:
*{{#time: Y m d H:i:s | 1959 }} → 2009 07 05 19:59:00 Input is treated as a time rather than a year.

Compare:
*{{#time:Y-m-d H:i:s|January 1 2008}}
*{{#time:Y-m-d H:i:s|January 1
2008}}
Comment 5 Chris 2009-07-06 16:15:30 UTC
So the purpose is to work around an ambiguity between formats for years and a 24-hour clock.  I wonder if an optional input format could be specified as an overriding clarification?  But that might require its own bug...

Thanks for your time.
Comment 6 Ryan Kaldari 2013-11-02 00:58:08 UTC
Doesn't seem like the benefit of changing this outweighs the risk. Marking WONTFIX.

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


Navigation
Links