Last modified: 2014-08-13 20:56:03 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 T47834, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 45834 - Implement mw.Time module for parsing, formatting and "timeago" display of timestamps
Implement mw.Time module for parsing, formatting and "timeago" display of tim...
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
JavaScript (Other open bugs)
1.18.x
All All
: Normal enhancement (vote)
: Future release
Assigned To: Nobody - You can work on this!
: i18n
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-03-07 09:04 UTC by Krinkle
Modified: 2014-08-13 20:56 UTC (History)
9 users (show)

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


Attachments

Description Krinkle 2013-03-07 09:04:16 UTC
Initial attempt in I9f9ca62f0744f0a.

Recommending to integrate http://momentjs.com/ instead.

Via a subclass of module, one could integrate the localisation between mw and momentjs.
Comment 1 Andre Klapper 2013-03-22 14:29:57 UTC
Krinkle: Would that fix bug 30857?
Comment 2 Helder 2014-02-18 13:25:34 UTC
Change 95555 merged by Krinkle:
Add Moment.js library for working with date and time

https://gerrit.wikimedia.org/r/95555
Comment 3 Mark Holmquist 2014-02-18 18:09:44 UTC
I'm marking this as closed (though Krinkle didn't merge it, I did) - we now have a library, and an extension (MultimediaViewer) is already using it. I call that a success.
Comment 4 PRO 2014-08-13 18:36:18 UTC
Until ca. yesterday this code has worked moment.format('YYYY-M-D') but yet not anymore.
Comment 5 PRO 2014-08-13 19:14:09 UTC
Ok it works if the MultimediaViewer is loaded. Could be there a documentation how to load this library / extension  explicit!?
Comment 6 Helder 2014-08-13 20:06:00 UTC
Have you added the module "moment" as a dependency to your script/gadget? That seems to be the ResourceLoader module associated to the files where this function is defined:
https://gerrit.wikimedia.org/r/#/c/95555/3/resources/Resources.php,unified
https://gerrit.wikimedia.org/r/#/c/95555/3/resources/moment/moment.js,unified

If it is a user script, you can use something like
mw.loader.using( 'moment', function(){
    // ...
    moment.format('YYYY-M-D')
    // ...
} )
as documented on
https://www.mediawiki.org/w/index.php?title=ResourceLoader/Default_modules#mw.loader.using
Comment 7 PRO 2014-08-13 20:56:03 UTC
(In reply to Helder from comment #6)
No and thx for clarification, it work now with the module load and moment().format('YYYY-M-D')
-> solved

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


Navigation
Links