Welcome Guest Search | Active Topics | Sign In | Register

Calendar, setSelectedDate Options
Julieta
Posted: Tuesday, September 25, 2007 7:23:42 AM
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
eo_support
Posted: Tuesday, September 25, 2007 8:04:54 AM
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
Julieta
Posted: Tuesday, September 25, 2007 12:32:07 PM
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!
eo_support
Posted: Tuesday, September 25, 2007 12:35:01 PM
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
Julieta
Posted: Tuesday, September 25, 2007 12:50:34 PM
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?
eo_support
Posted: Tuesday, September 25, 2007 12:57:02 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Yes. You need to call goto before you call setSelectedDate:

http://www.essentialobjects.com/ViewDoc.aspx?t=JSDoc.Public.Calendar.goTo.html

Thanks
Julieta
Posted: Tuesday, September 25, 2007 1:06:42 PM
Rank: Newbie
Groups: Member

Joined: 9/25/2007
Posts: 8
It works just like I need!!
Thanks!!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.