|
Rank: Newbie Groups: Member
Joined: 9/25/2007 Posts: 8
|
Hi,
I am using the calendar control with out a date picker, and I need to select a date for the calendar by javascript
First I try with calendar.setSelectedDate, I convert the date with the eo_stringToDate function, but it does not work.
Then I try with calendar.setSelectedDates, and it doesn't work.
How can I select a date on a calendar by javascript? (I have the date in string type).
Thanks!
Julieta
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi Julieta,
It takes a date type. Not string type. For example:
setSelectedDate(new Date());
I am not sure why eo_stringToDate doesn't work though. It supposes to work. So if you can post your code, we might be able to spot something.
Thanks
|
|
Rank: Newbie Groups: Member
Joined: 9/25/2007 Posts: 8
|
Hi, This is a snippet from my javascript code
var fechaDesde = eo_StringToDate("09/21/2007"); calendario.setSelectedDate(fechaDesde);
eo_ShowPopupCalendar("popUpCalendario", control);
After execute the first line,the value for var:fechaDesde is NaN.
I don't know where is my bug... this code does not result in an error... but it just don't select the date that I want.
Thanks for any comment!
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
eo_StringToDate does not take that format. It should be:
var fechaDesde = eo_StringToDate("2007-09-21");
Thanks
|
|
Rank: Newbie Groups: Member
Joined: 9/25/2007 Posts: 8
|
Thanks!! It works!!
But, If I select a day from a another month (2007-08-11), when the calendar is open, it doesn't show the selected date. If I navigate to august moth, the date is selected. Is there any way to tell to the calendar control that it shows the moth where the selection date is?
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
|
|
Rank: Newbie Groups: Member
Joined: 9/25/2007 Posts: 8
|
It works just like I need!! Thanks!!
|
|