# Help getting Day of Week from DateField Component

**URL:** <https://forum.kirupa.com/t/help-getting-day-of-week-from-datefield-component/257194>\
**Category:** flash\
**Created:** [April 11, 2008, 2:17am UTC](https://forum.kirupa.com/t/help-getting-day-of-week-from-datefield-component/257194 "2008-04-11T02:17:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![RichGags](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/richgags/32/685_2.png) [@RichGags](https://forum.kirupa.com/u/RichGags)\
**Post date:** [April 11, 2008, 2:17am UTC](https://forum.kirupa.com/t/help-getting-day-of-week-from-datefield-component/257194/1 "2008-04-11T02:17:14Z")

</div>

Hi again,  
So I making a flash contact form for reservations. I dragged the DateField component onto the stage, gave it an instance name of rDate\_txt and it works great in picking a date and sending to my php emailer. Its formatted like 10 Apr 2008.

Now, Im trying to calculate the day of the week based on the date. I can calculate todays date with…

```auto
 myDate = new Date();
    daytext = myDate.getDay();
    switch (daytext)
    {
        case 0:
        {
            daytext = "SUNDAY";
            break;
        } 
        case 1:
        {
            daytext = "MONDAY";
            break;
        } 
        case 2:
        {
            daytext = "TUESDAY";
            break;
        } 
        case 3:
        {
            daytext = "WEDNESDAY";
            break;
        } 
        case 4:
        {
            daytext = "THURSDAY";
            break;
        } 
        case 5:
        {
            daytext = "FRIDAY";
            break;
        } 
        case 6:
        {
            daytext = "SATURDAY";
            break;
        } 
    } // End of switch

```

Can anyone help me get the date chosen from the DateField component?

Once I get the day of the week, I need to make a different ComboBox visible if its a Friday or Saturday. So I would think I need to set up an onchange listener?

Thanks In Advance!  
Rich
