A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: [AS2] Date Field selectableRange starting "yesterday"

  1. #1
    Junior Member
    Join Date
    Jul 2009
    Posts
    7

    [AS2] Date Field selectableRange starting "yesterday"

    Hello.

    Im using a DateField component and i would like to set the selectableRange so that the rangeStart is set for yesterday (the day before today). I have another DateField where the rangeStart is "today" and im using this:
    Code:
    selectableRange = {rangeStart:new Date(now)};
    Is there any similar solution for "yesterday".

    Regards.

  2. #2
    Senior Member
    Join Date
    Aug 2000
    Location
    Montréal
    Posts
    14,141
    would be now minus 24 hours?

    gparis

  3. #3
    Junior Member
    Join Date
    Jul 2009
    Posts
    7
    Solved by changing the way I was getting the "today" Date, using a var instead of using now, which is predefined:

    Code:
    var today:Date = new Date();
    form.chegada_mc.selectableRange = {rangeStart:new Date(today.getFullYear(), today.getMonth(), today.getDate())};
    form.saida_mc.selectableRange = {rangeStart:new Date(today.getFullYear(), today.getMonth(), today.getDate()+1)};
    Thanks anyway.

Tags for this Thread

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center