/var/log

Titanium and localize moment.js

Titanium comes with a standard Moment.js library included. If you want to localize it, you have to require the locale you need. This needs to be done statically! So if you need a Dutch moment.js localization, you explicitly need to require it:

require("/alloy/moment/lang/nl");

You cannot require it dynamically, because the compiler needs to include it in the build.

To see the available locales, see:

https://github.com/appcelerator/alloy/tree/master/Alloy/builtins/moment/lang

Tag: | Category: