A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: comapreing a datefield selected date to current date

  1. #1
    Senior Member
    Join Date
    Mar 2004
    Posts
    120

    comapreing a datefield selected date to current date

    i have a made a small swf which checks the seleted date on the datefield component is passed current date or not...

    i have a function get the day associated with it...

    stop();
    function getDayName(num) {
    switch (num) {
    case 0 :
    return "Sunday";
    break;
    case 1 :
    return "Monday";
    break;
    case 2 :
    return "Tuesday";
    break;
    case 3 :
    return "Wednesday";
    break;
    case 4 :
    return "Thursday";
    break;
    case 5 :
    return "Friday";
    break;
    case 6 :
    return "Saturday";
    break;
    }
    }
    today = new Date();
    today = getDayName(today.getDay())+" "+today.getMonth()+" "+today.getDate()+" 00:00:00 GMT+06000 "+today.getFullYear();

    on relese event of the button...

    dateField is named - arr_date

    on (release) {

    _global.selday = _root.arr_date.selectedDate;


    _global.selday2 = getDayName(_global.selday.getDay())+" "+_global.selday.getMonth()+" "+_global.selday.getDate()+" 00:00:00 GMT+06000 "+_global.selday.getFullYear();

    res = (selday2<today);
    _root.dis = res;
    }

    the thing is sometimes res says "TRUE" for future dates also.

    download fla here
    can anyone help on this.

    Thanks
    Last edited by nameez; 03-01-2006 at 06:45 AM.

  2. #2
    Senior Member
    Join Date
    Mar 2004
    Posts
    120
    RESOLEVD....

    in case somebodys having same problem...

    i have taken off the "getDayName(_global.selday.getDay())" part of onRelease

    Nameez

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