0

actionContext.intl.formatDate problem

I'm running Mojito in OS X 10.7.3.
Going through the code examples, ac.intl.formatDate yields different results for me.
With the generating_urls app, currentTime is always undefined,
but in the locale_i18n app, today gets a correct date value.
Any idea what the difference might be between the two usages that could account for the results I'm getting?

For currentTime, Y.log(new Date()) gives me a correct date time value, but Y.log(ac.intl.formatDate(new Date())) always yields an undefined value.
Anything else I should check or vary to get more diagnostics?

Thanks for any help!

by
3 Replies
  • when i created a "dummy" resource bundle for the generating_urls app, the problem disappeared.
    the instructions for the generating_urls app should mention this!  :-)
    0
  • john what lang value are you using? is it possible that the datatype-format-date resource does not exist and is not doing the fallback, I noticed that, too.
    0
  • hi lucas,

    one important difference between the generating_urls and the locale_i18n apps was the existence of the mojits/<mojit>/lang folder and the various mojit_<BCP47>.js files underneath it, so I just created the folder and adapted one of the mojit_<BCP47>.js files without digging any deeper. in my case, i adapted the mojit_en-US.js file and when it worked, i moved on.

    i don't really know how the i18n stuff works yet.  i thought it would have reasonable fallbacks as a default (say, browser's lang setting? -- mine was already set to en)  but apparently that wasn't enough at least for now ...
    0

Recent Posts

in Yahoo! Mojito