ilib doesn't works fine

Hello,

my problem is that enyo-ilib submodule not works. You can see the wrong behavior here: http://www.adelberg-online.de/weatherstation/app/

In the browser developer tools exist errors like that:

GET XHR http://www.adelberg-online.de/weatherstation/app/resources/zoneinfo/Europe/Istanbul.json [HTTP/1.1 404 Not Found 46ms] GET XHR http://www.adelberg-online.de/weatherstation/app/resources/und/US/sysres.json [HTTP/1.1 404 Not Found 46ms] GET XHR http://www.adelberg-online.de/weatherstation/app/resources/en/US/sysres.json [HTTP/1.1 404 Not Found 46ms]
The ilibmanifest.json is also not available and I have no resources folder in my project. But I have the missing files after a deploy in deploy/lib/enyo-ilib/ilib/locale folder.

What can I do? The source code can you find here: https://github.com/bjadel/weatherstation-app

Thanks
Björn

Comments

  • I have changed a line in deploy.js to:

    "assets": ["./icon.png", "./index.html", "./assets", "./lib/enyo-ilib/ilib/locale"],

    and after that, the browser looks to a resources folder and can not found files and then the browser looks into lib/enyo-ilib/ilib/locale folder and can find the files.

    Is that the right approach?

    The format doesn't work. I would like to transform and format this timestamp: 2016-01-27 14:30:02

    This is the code:

    var curLocale = new ilib.Locale(); var localeInfo = new ilib.LocaleInfo(curLocale); var fmt = new ilib.DateFmt({type: "datetime", locale: curLocale, timezone: "Europe/Berlin"}); var d = fmt.format(v); return d;
    The result is 00:00 01.06.00. That is wrong! ;-)

    Can anybody help me?

    Cheers
    BJörn
  • Hi BJörn! I believe the issues you're seeing are because you don't have a manifest file in your app. I don't believe you really need to manually add the ilib output files to your app.

    Add a resources/manifest.json file to your app and put this in here:

    { "files": [] }

    As to your date issue, is the date already in a Date object? You don't show what v is. If it's not, you may not be able to do what you want.
  • Hi Roy,
    thanks for your reply. With the manifest.json file I will try later.

    The formatting works now. You can see the solution here: https://jsfiddle.net/bjawebos/atua1k6c/8/#&togetherjs=laK2KyFTMT

    One little problem exist now: The timezone in object localeInfo is Etc/UTC here in Germany, but the new Date().getTimezoneOffet() returns the right value -60.

    Cheers Björn
  • Hi Roy,
    With the manifest.json file works very well. Thanks! Now, I have only the problem with the timezone. See last comment.

    Do you have an idea?

    Cheers
    Björn
  • Hi Roy,

    my problem with the timezone is also available on http://enyojs.com/sampler/latest/ --> iLib (i18n) -> Locale Info

    Cheers Björn
  • Can you reproduce it using the nightly sampler here:

    http://nightly.enyojs.com/latest/sampler/dist/
  • Also, I added a nightly Enyo version of your fiddle: http://jsfiddle.net/atua1k6c/9/
  • I would suggest taking this question to the ilib team here: http://sourceforge.net/projects/i18nlib/ Maybe someone else knows?
  • For documentation: In my fiddle on a browser with german locale it returns:

    14:05 25.01.16 {"info":{"calendar":"gregorian","clock":"24","currency":"USD","delimiter":{"quotationStart":"„","quotationEnd":"“","alternateQuotationStart":"‚","alternateQuotationEnd":"‘"},"firstDayOfWeek":1,"numfmt":{"script":"Latn","decimalChar":",","groupChar":".","prigroupSize":3,"pctFmt":"{n} %","pctChar":"%","roundingMode":"halfdown","exponential":"E","currencyFormats":{"common":"{n} {s}","commonNegative":"{s}-{n}"}},"timezone":"Etc/UTC","units":"metric","weekendEnd":0,"weekendStart":6,"language.name":"German","paperSizes":{"regular":"A4","photo":"4x6"},"scripts":["Latn","Runr"],"locale":"de"},"locale":{"language":"de","spec":"de"}}, TimezoneOffset: -60
    In my fiddle on a browser with US locale it returns:

    1/25/16 9:05am {"info":{"calendar":"gregorian","clock":"12","currency":"USD","delimiter":{"quotationStart":"“","quotationEnd":"”","alternateQuotationStart":"‘","alternateQuotationEnd":"’"},"firstDayOfWeek":0,"numfmt":{"script":"Latn","decimalChar":".","groupChar":",","prigroupSize":3,"pctFmt":"{n}%","pctChar":"%","roundingMode":"halfdown","exponential":"e","currencyFormats":{"common":"{s}{n}","commonNegative":"({s}{n})"}},"timezone":"America/New_York","units":"uscustomary","weekendEnd":0,"weekendStart":6,"language.name":"English","scripts":["Latn","Dsrt","Shaw"],"locale":"US","paperSizes":{"regular":"8x11"},"region.name":"United States"},"locale":{"language":"en","region":"US","spec":"en-US"}}, TimezoneOffset: -60
    Cheers
    Björn
Sign In or Register to comment.