I got it.. I modified my function to the below and here it is for
anyone to use if you need.
function getNextSaturday(date)
{
// define variables
var cMonth;
var cYear;
var cDay;
var dayNum;
var tempDate;
var days;
// set variables
cMonth = (date.getMonth());
cYear = date.getFullYear();
cDay = date.getDate();
dayNum = date.getDay();
// create date object for the next Saturday of the date chosen
tempDate = new Date (cYear,cMonth,cDay + (6 - dayNum));
// set the datefield's value to your date object
daDate.selectedDate = tempDate;
alert(daDate.selectedDate);
}
and you can call it like...
<mx:DateField id="daDate" change="getNextSaturday(event.target.selectedDate)" />
On 9/8/05, Greg Morphis <[EMAIL PROTECTED]> wrote:
> Well, I've gotten this far...
> function displayDate(date)
> {
> var cMonth;
> var cYear;
> var cDay;
> var dayNum;
> var tempDate;
>
> cMonth = (date.getMonth()) + 1;
> cYear = date.getFullYear();
> cDay = date.getDate();
> dayNum = date.getDay();
> if(dayNum != 6) {
> cDay = (date.getDate()) + (6 - dayNum);
> }
> fooDate.text = ("Year:" + cYear + " Month:" + cMonth + "
> Day:" + cDay);
> daDate.selectedDate = new Date(cYear,cMonth,cDay);
>
> }
>
>
> However daDate doesnt show the value of fooDate, it remains showing
> whatever I click on.
> For example; I click on Sept 13th 2005, the label shows the correct
> value of "Year:2005 Month:9 Day:17" or Sept 17th 2005, however the
> datefield value remains Sept 13th 2005.
>
> Livedocs says it accepts a date object, is that not one?
> "daDate.selectedDate = new Date(cYear,cMonth,cDay);" ??
>
> Thanks!
>
>
>
>
>
> On 9/8/05, Greg Morphis <[EMAIL PROTECTED]> wrote:
> > I've found that I can use this to get the date....
> > change="displayDate(event.target.selectedDate)"
> >
> >
> >
> >
> >
> > On 9/8/05, Greg Morphis <[EMAIL PROTECTED]> wrote:
> > > Is it possible to capture/modify the value that shows in the textbox
> > > of the datefield object?
> > > I've tried .value, .text and looked at the livedocs (didnt see .value
> > > or .text or anything usable).
> > > What I'm trying to do is make it to where if someone clicks on a date
> > > (9/20/2005) then the date that shows is that week's Saturday
> > > (9/24/2005).
> > > The easiest way of doing this I found is just using
> > > disabledDays="[0,1,2,3,4,5]" to disable all of the days except
> > > Saturday, which works fine, no overhead, etc.. The user would just
> > > select the Saturday that applies.
> > > But is there a way I can pass that selected value to an actionscript
> > > function, get that week's Saturday and pass it back to the DateField?
> > > From the looks of it it would be difficult, you'd have to parse the
> > > date shown ie 20 Sep 2005 to get the day, month, year and then preform
> > > the fuction to get the following Saturday 9/24/2005 and then parse it
> > > back to the format Flex takes 24 Sep 2005 and lastly populate the text
> > > box with that value.
> > > What are your ideas?
> > >
> > >
> > > --
> > > Auxilium meum a Domino
> > >
> >
> >
> > --
> > Auxilium meum a Domino
> >
>
>
> --
> Auxilium meum a Domino
>
--
Auxilium meum a Domino
------------------------ Yahoo! Groups Sponsor --------------------~-->
Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life.
http://us.click.yahoo.com/A77XvD/vlQLAA/TtwFAA/nhFolB/TM
--------------------------------------------------------------------~->
--
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/
<*> 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/