Re: [flexcoders] date substraction problem

2008-02-12 Thread Tom Chiverton
On Monday 11 Feb 2008, Ralf Bokelberg wrote:
 or date.setMonth( date.getMonth() - 1 ) if you want to change the date
 object itself

What happens if you setMonth(-1) ?

-- 
Tom Chiverton
Helping to authoritatively lead performance-oriented niches
on: http://thefalken.livejournal.com



This email is sent for and on behalf of Halliwells LLP.

Halliwells LLP is a limited liability partnership registered in England and 
Wales under registered number OC307980 whose registered office address is at 
Halliwells LLP, 3 Hardman Square, Spinningfields, Manchester, M3 3EB.  A list 
of members is available for inspection at the registered office. Any reference 
to a partner in relation to Halliwells LLP means a member of Halliwells LLP.  
Regulated by The Solicitors Regulation Authority.

CONFIDENTIALITY

This email is intended only for the use of the addressee named above and may be 
confidential or legally privileged.  If you are not the addressee you must not 
read it and must not use any information contained in nor copy it nor inform 
any person other than Halliwells LLP or the addressee of its existence or 
contents.  If you have received this email in error please delete it and notify 
Halliwells LLP IT Department on 0870 365 2500.

For more information about Halliwells LLP visit www.halliwells.com.


--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* Your email settings:
Individual Email | Traditional

* To change settings online go to:
http://groups.yahoo.com/group/flexcoders/join
(Yahoo! ID required)

* To change settings via email:
mailto:[EMAIL PROTECTED] 
mailto:[EMAIL PROTECTED]

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 


Re: [flexcoders] date substraction problem

2008-02-11 Thread Ralf Bokelberg
newDate = new Date( oldDate.getYear(), oldDate.getMonth() - 1,
oldDate.getDate());

Cheers
Ralf.


On Mon, Feb 11, 2008 at 5:08 PM, M.Javed [EMAIL PROTECTED] wrote:







 Hi,
 I have to substract 1 Month from the Date object, iam currently using the
 SetTime() method of date object as follows, but its giving some abnormal
 result by adding few days instead of substracting.
 ---
  var date:Date = new Date();
  var monthSpan:int = 1000 * 60 * 60 * 24 * 30;

  this.esView.toDateE.text = date.toDateString();
  date.setTime(date.getTime() - monthSpan);
  this.esView.fromDateE.text = date.toDateString();
 

 the result in the fromDate TextBox should be one month previous date as
 compared to the current date. but it doesnt, any idea?
  
 Never miss a thing. Make Yahoo your homepage. 



-- 
Ralf Bokelberg [EMAIL PROTECTED]
Flex  Flash Consultant based in Cologne/Germany


[flexcoders] date substraction problem

2008-02-11 Thread M.Javed
Hi,
I have to substract 1 Month from the Date object, iam currently using the 
SetTime() method of date object as follows, but its giving some abnormal result 
by adding few days instead of substracting.
---
 var date:Date = new Date();
 var monthSpan:int = 1000 * 60 * 60 * 24 * 30;
  
 this.esView.toDateE.text = date.toDateString();
 date.setTime(date.getTime() - monthSpan);
 this.esView.fromDateE.text = date.toDateString();


the result in the fromDate TextBox should be one month previous date as 
compared to the current date. but it doesnt, any idea?


  

Never miss a thing.  Make Yahoo your home page. 
http://www.yahoo.com/r/hs

Re: [flexcoders] date substraction problem

2008-02-11 Thread Ralf Bokelberg
or date.setMonth( date.getMonth() - 1 ) if you want to change the date
object itself

Cheers
Ralf.

On Mon, Feb 11, 2008 at 6:22 PM, Ralf Bokelberg
[EMAIL PROTECTED] wrote:
 newDate = new Date( oldDate.getYear(), oldDate.getMonth() - 1,
  oldDate.getDate());

  Cheers
  Ralf.




  On Mon, Feb 11, 2008 at 5:08 PM, M.Javed [EMAIL PROTECTED] wrote:
  
  
  
  
  
  
  
   Hi,
   I have to substract 1 Month from the Date object, iam currently using the
   SetTime() method of date object as follows, but its giving some abnormal
   result by adding few days instead of substracting.
   ---
var date:Date = new Date();
var monthSpan:int = 1000 * 60 * 60 * 24 * 30;
  
this.esView.toDateE.text = date.toDateString();
date.setTime(date.getTime() - monthSpan);
this.esView.fromDateE.text = date.toDateString();
   
  
   the result in the fromDate TextBox should be one month previous date as
   compared to the current date. but it doesnt, any idea?

   Never miss a thing. Make Yahoo your homepage. 



  --
  Ralf Bokelberg [EMAIL PROTECTED]
  Flex  Flash Consultant based in Cologne/Germany




-- 
Ralf Bokelberg [EMAIL PROTECTED]
Flex  Flash Consultant based in Cologne/Germany


Re: [flexcoders] date substraction problem

2008-02-11 Thread M.Javed
Thanks a zillion Ralf ... its working :)

regards
-Javed


- Original Message 
From: Ralf Bokelberg [EMAIL PROTECTED]
To: flexcoders@yahoogroups.com
Sent: Monday, February 11, 2008 9:22:54 PM
Subject: Re: [flexcoders] date substraction problem

newDate = new Date( oldDate.getYear( ), oldDate.getMonth( ) - 1,
oldDate.getDate( ));

Cheers
Ralf.

On Mon, Feb 11, 2008 at 5:08 PM, M.Javed mjavedhussain@ yahoo.com wrote:







 Hi,
 I have to substract 1 Month from the Date object, iam currently using the
 SetTime() method of date object as follows, but its giving some abnormal
 result by adding few days instead of substracting.
  - - - - ---
 var date:Date = new Date();
 var monthSpan:int = 1000 * 60 * 60 * 24 * 30;

 this.esView. toDateE.text = date.toDateString( );
 date.setTime( date.getTime( ) - monthSpan);
 this.esView. fromDateE. text = date.toDateString( );
  - - - - 

 the result in the fromDate TextBox should be one month previous date as
 compared to the current date. but it doesnt, any idea?
  _ _ __
 Never miss a thing. Make Yahoo your homepage. 

-- 
Ralf Bokelberg ralf.bokelberg@ gmail.com
Flex  Flash Consultant based in Cologne/Germany




  

Looking for last minute shopping deals?  
Find them fast with Yahoo! Search.  
http://tools.search.yahoo.com/newsearch/category.php?category=shopping