Last modified: 2014-06-26 22:40:31 UTC
Opening https://commons.wikimedia.org/w/index.php?title=File:Daemonicus_LOGO.jpg#mediaviewer/File:Daemonicus_LOGO.jpg logs to the console: > Deprecation warning: moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release. Please refer to https://github.com/moment/moment/issues/1407 for more info.
We use moment to try to format the date string consistently but fall back to showing the original string if it that fails, so changes in how moment's date parsing is implemented do not matter much. As for the warning itself, there doesn't seem to be a way to suppress it when you we handing an unknown string to moment. So as far as I can see this is a WONTFIX.
(In reply to Tisza Gergő from comment #1) > As for the warning itself, > there doesn't seem to be a way to suppress it when you we handing an unknown > string to moment. So as far as I can see this is a WONTFIX. The documented [1] way to parse a date string with a user-defined fallback when the string is not properly ISO-formatted, is to override moment.createFromInputFallback. The current functionality allowing to do moment('4 3 2000') and expecting a “useful” result is deprecated and possibly will be removed in a future version, so I don’t see how WONTFIXing this could work. [1] https://github.com/moment/moment/issues/1407#issuecomment-41620885
(In reply to Mormegil from comment #2) > The current functionality allowing to do moment('4 3 2000') and expecting a > “useful” result is deprecated and possibly will be removed in a future > version, so I don’t see how WONTFIXing this could work. As I said, when moment cannot parse the string, we just show it as-is, so changes in what formats moment exactly accepts don't really affect MediaViewer. Users will see dates formatted in non-standard ways more often, on the other hand false positives (e.g. dd/mm/yyyy parsed as mm/dd/yyyy) and issues like bug 56794 will go away. On the whole I'm not sure this will be a bad thing.
Closing per above. If the presence of the warning itself is a problem, please reopen and we'll figure out some workaround.