you are comparing objects, so you are asking in the firstone are these two
references the same no they are not. its two different objects
the you are asking is this reference smaller than equal to that refrence,
flash then goes huh wtf a refrence that you are doing <= on this object, ok
lets conver
Don't know why I haven't come across this before, but can anyone confirm this
for me (and maybe give an explanation)?
var d1:Date = new Date( 1970, 0 );
var d2:Date = new Date( 1970, 0 );
trace( d1 == d2 ); // false
trace( d1 <= d2 ); // true
trace( d1 >= d2 ); // TRUE?!
Umm… If something is b
Good to know. Thanks Francis.
Scott
-Original Message-
From: [EMAIL PROTECTED] on behalf of Francis Cheng
Sent: Thu 3/23/2006 7:27 PM
To: Flashcoders mailing list
Cc:
Subject:RE: [Flashcoders] Simple date comparison bug?
This is due to the ECMAScript algorithm for
g list'
> Subject: [Flashcoders] Simple date comparison bug?
>
> Don't know why I haven't come across this before, but can anyone confirm
> this for me (and maybe give an explanation)?
>
>
> var d1:Date = new Date( 1970, 0 );
> var d2:Date = new Date( 1970, 0 );
Well, it depends how the comparisons work. When you check equivalence
"==" it is checking whether the two Date instances are the same object,
which of course they aren't. When you check greater than or less than,
it can only check their value, and that is the same.
So it comes down to how the
var d1:Date = new Date( 1970, 0 );
var d2:Date = new Date( 1970, 0 );
trace( d1.toString() == d2.toString() ); // true
trace( d1 = d2 ); // Thu Jan 1 00:00:00 GMT-0700 1970
On 3/23/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> Don't know why I haven't come across this before, but can anyone
Don't know why I haven't come across this before, but can anyone confirm this
for me (and maybe give an explanation)?
var d1:Date = new Date( 1970, 0 );
var d2:Date = new Date( 1970, 0 );
trace( d1 == d2 ); // false
trace( d1 <= d2 ); // true
trace( d1 >= d2 ); // TRUE?!
Umm… If something is b
7 matches
Mail list logo