sparekey
07-17-2011, 01:18 AM
I have a datagrid in Flash Builder 4 that is successfully linked to an xml file. However, I need it to display different data from that same xml file depending of the day of week it is.
The xml is structured as follows.
<database>
<eatery>
<name>UT</name>
<open>
<sunday>1100</sunday>
<monday>1030</monday>
<tuesday>1030</tuesday>
<wednesday>1030</wednesday>
<thursday>1030</thursday>
<friday>1030</friday>
<saturday>1100</saturday>
</open>
<close>
<sunday>2000</sunday>
<monday>2100</monday>
<tuesday>2100</tuesday>
<wednesday>2100</wednesday>
<thursday>2100</thursday>
<friday>2100</friday>
<saturday>2100</saturday>
</close>
</eatery>
</database>
I want my datagrid to display the correct open and close times for only the current day.
I know how to find the date I just don't understand where I would go about writing an if else statement or such, or how to get the open and close data to change in my data grid.
I haven't been able to find an answer to this so if anyone could show me how to do this or point me somewhere that explains this I would greatly appreciate it!
The xml is structured as follows.
<database>
<eatery>
<name>UT</name>
<open>
<sunday>1100</sunday>
<monday>1030</monday>
<tuesday>1030</tuesday>
<wednesday>1030</wednesday>
<thursday>1030</thursday>
<friday>1030</friday>
<saturday>1100</saturday>
</open>
<close>
<sunday>2000</sunday>
<monday>2100</monday>
<tuesday>2100</tuesday>
<wednesday>2100</wednesday>
<thursday>2100</thursday>
<friday>2100</friday>
<saturday>2100</saturday>
</close>
</eatery>
</database>
I want my datagrid to display the correct open and close times for only the current day.
I know how to find the date I just don't understand where I would go about writing an if else statement or such, or how to get the open and close data to change in my data grid.
I haven't been able to find an answer to this so if anyone could show me how to do this or point me somewhere that explains this I would greatly appreciate it!