UNPKG

1.03 kBJavaScriptView Raw
1/**
2 * @class Alloy.builtins.moment
3 * Moment.js is a freely distributable, third-party JavaScript date library
4 * for parsing, validating, manipulating, and formatting dates.
5 *
6 * To use the moment.js library in Alloy,
7 * require it with the `alloy` root directory in your `require` call. For example:
8 *
9 * var moment = require('/alloy/moment');
10 * var day = moment("12-25-1995", "MM-DD-YYYY");
11 * Ti.API.info("Date:" + day.format("dddd, MMMM Do YYYY, h:mm:ss a")); // --> Monday, December 25th 1995, 12:00:00 am
12 *
13 * To change the locale globally, the application calls the moment.locale() function, passing it the new language code.
14 *
15 * var moment = require('/alloy/moment');
16 * require('/alloy/moment/lang/de');
17 * require('/alloy/moment/lang/fr');
18 * moment.locale(Ti.Locale.currentLocale); // Set current system locale, as a combination of ISO 2-letter language and country codes.
19 *
20 * For documentation, usage examples and more information, see [http://momentjs.com/](http://momentjs.com).
21 */