[Laszlo-user] Date issue (convertion from string)

P T Withington ptw at openlaszlo.org
Mon Jul 23 11:39:50 PDT 2007


Looks like a bug with the SWF compiler.  Please file at http:// 
jira.openlaszlo.org.

As a work-around, try:

   thisYear =(new Date).getFullYear()

which I just tested and appears to work correctly.

On 2007-07-23, at 14:31 EDT, Jean-Baptiste BRIAUD wrote:

> Hi the list !
>
> Any idea why that code produce NaN ?
> I'm not sure about the OL version since I tried that snipset online  
> with
> http://www.openlaszlo.org/lps/laszlo-explorer/index.jsp? 
> navset=nav10.xml&bookmark=Introduction
>
> When I try my full code with 4.0.2 I got this error :
> WARNING: pet-create-1.lzx:329: reference to undefined property  
> 'getFullYear'
> ERROR: Compiler.substitute:-1: undefined object does not have a  
> property 'make'
>
> Are there known issue with JavaScript Date Object ?
>
> --------------------------------------
> <canvas width="200" >
> <simplelayout axis="y" spacing="5"/>
> <text id="pouette"/>
> <button text="OK">
> <handler name="onclick">
>  var date_birth = new Date("1/1/2006");
>  var thisYear = new Date().getFullYear();
>  var age = thisYear - date_birth.getFullYear();
>  pouette.setText(age);
> </handler>
> </button>
> </canvas>
>



More information about the Laszlo-user mailing list