Results 1 to 6 of 6

Thread: [2.3.0] Date bug in adobe air

  1. #1
    Sencha User
    Join Date
    Dec 2008
    Posts
    105
    Vote Rating
    0
      0  

    Default [2.3.0] Date bug in adobe air

    hello

    there is a bug in Date.dateFormat this function doesn't work anymore in adobe air gives

    Error: Adobe AIR runtime security violation for JavaScript code in the application security sandbox (Function constructor)

    when u try to format other formats than 'Y-m-d' was working fine in Extjs 2.0, the Fresh application is using it but if u paste the dateFormat code from it to a new project build on 2.3 it doesn't work anymore

    thanx

  2. #2
    Sencha User
    Join Date
    Mar 2007
    Posts
    7,854
    Vote Rating
    3
      0  

    Default

    Please post a test case per this http://extjs.com/forum/showthread.php?p=341947

  3. #3
    Sencha User
    Join Date
    Dec 2008
    Posts
    105
    Vote Rating
    0
      0  

    Default test case

    Ext version tested:

    • Ext 2.3



    Adapter used:

    • ext



    css used:

    • only default ext-all.css





    Browser versions tested against:

    • Webkit / Adobe Air 1.5.1



    Operating System:

    • Windows 7
    • WinXP Pro



    Description:

    • Security errors occurs when you try to format a date like ('y-m') or any other type of format expect ('y-m-d)



    Test Case:

    Code:
        var dt = new Date();
        alert(dt.format('y-m'));
    See this URL : http://


    Steps to reproduce the problem:

    • just run the code



    The result that was expected:

    • 2009-08



    The result that occurs instead:

    • Error: Adobe AIR runtime security violation for JavaScript code in the application security sandbox (Function constructor)



    Screenshot or Video:

    • attached



    Debugging already done:

    • none



    Possible fix:

    • not provided

  4. #4
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    119
      0  

    Default

    The Ext Date methods use the Function constructor.

    According to Adobe (reference) you can only use the Function constructor before page load.

    You'll have to call:
    Code:
    Date.createFormat('y-m'); // if you want to use dateFormat
    Date.createParser('y-m'); // if you want to use parseDate
    before the page loads.

  5. #5
    Sencha User
    Join Date
    Dec 2008
    Posts
    105
    Vote Rating
    0
      0  

    Default

    thanx

    it works but looks like a hack to me if i need to add this before domready event

  6. #6
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    119
      0  

    Default

    You should blame Adobe. IMHO only allowing eval and Function before page load is a strange restriction.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •