![]() ![]() |
|||||||||||||||
|
|||||||||||||||
![]() |
|||||||||||||||
|
|||||||||||||||
Questions List
Answers Is it possible to use caledar with European dates? The examples code is set with MM/dd/yyyy format, I would like to use DDDD, MMMM DD, YYYY. You should change the "dtype" property of calendar configuration. For example you can use "dtype:'dd/MM/yyyy'," Here is the full sample configuration for the calendar with european dates: var caldef2 = { firstday : 0, dtype : 'dd/MM/yyyy', width : 250, windoww : 300, windowh : 170, border_width : 1, border_color : '#ffffff', dn_css : 'clsDayName', cd_css : 'clsCurrentDay', wd_css : 'clsWorkDay', tw_css : 'clsWorkDay', we_css : 'clsWeekEnd', wdom_css : 'clsWorkDayOtherMonth', weom_css : 'clsWeekEndOtherMonth', headerstyle : { type : "comboboxes", css : 'clsWorkDayOtherMonth', yearrange : [1987, 2005] }, monthnames : ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], daynames : ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"] }; I tried to place the nescessary files (codethatcalendarstd.js, scroller_ex.js and codethatcalendar.html) in a special folder because my intention was to reuse these files for all the webpages containing html-forms with date fields. But I could not get this to work. So my question is: Do these 3 files have to exist in all folders in which I want to use the calendar? 1. The thing is that you didn't change the <script> tags in your html files. Look for the strings that look like this in your html file: <script language="javascript" src="../Scripts/codethatcalendarstd.js"></script> <script language="javascript" src="scroller_ex.js"></script> The "src" attribute should point to the paths of the scripts Also don't forget to change the "src" attribute of <script> tag in codethatcalendar.html 2.You have to use the forward slash (/) in case you have your html files running on a webserver. The "/" points to the root directory of a webserver. 3. At line "codethatcalendarstd.js" line 21 char 3210 there is a window.open("codethatcalendar.html") command. Could you post an example of putting the calendar in a layer? How do you set the transparency? You can use the inline functionality for putting calendar in a layer. Here is the sample code: <html><head><title>CodeThatCalendar</title> <link href="ctc.css" rel="stylesheet" type="text/css"> <script language="javascript" src="../Scripts/codethatcalendarstd.js"> </script> <script language="javascript1.2"> <!-- var params = { firstday : 0, dtype : ' MM/dd/yyyy ', width : 275, windoww : 300, windowh : 200, border_width : 0, border_color : ' Black ', dn_css : 'clsDayName', cd_css : 'clsCurrentDay', tw_css : 'clsCurrentWeek', wd_css : 'clsWorkDay', we_css : 'clsWeekEnd', wdom_css : 'clsWorkDayOtherMonth', weom_css : 'clsWeekEndOtherMonth', headerstyle : { type : "buttons", css : 'clsDayName' }, monthnames : ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], daynames : ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"] }; function show(id) { var c1 = new CodeThatCalendar(params); c1.create(document, id); } //--> </script> </head> <body> <form><input name="id3" ></form> <script language="javascript1.2"> <!-- show('id3'); //--> </script> </body></html> Transparency example you can see here. I have the pro version. I purchased for inline capability, but notice there is no navigation (month, year). Can navigation be added to inline mode? You can use iframe mode this functionality. Here's sample code: <html> <head> <META http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <script language="javascript" src="../Scripts/codethatcalendarpro.js"></script> <script language="javascript1.2"> <!-- var caldef1 = { firstday : 0, dtype : 'MM/dd/yyyy', width : 250, windoww : 300, windowh : 200, border_width : 0, border_color : '#0000d3', dn_css : 'clsDayName', cd_css : 'clsCurrentDay', tw_css : 'clsCurrentWeek', wd_css : 'clsWorkDay', we_css : 'clsWeekEnd', wdom_css : 'clsWorkDayOtherMonth', weom_css : 'clsWeekEndOtherMonth', headerstyle : { type : "comboboxes", css : 'clsWorkDayOtherMonth', yearrange : [1987, 2005] }, monthnames : ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], // Array with week day names daynames : ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"] }; var c1 = new CodeThatCalendar(caldef1); //--> </script> <body> <P>Month+year scrollers</P> <form> <input name="id1" type="textarea"/> <input type="button" onClick="c1.innerpopup('id1','calendar_frame');" value="..."/> </form> <script language="javascript1.2"> <!-- // Create iframe if (ua.oldOpera) document.write("<div id=\"calendar_div\">"); document.write("<iframe id=\"calendar_frame\" name=\"calendar_frame\""); document.write(" frameborder=\"0\""); document.write(" scrolling=\"no\""); document.write(" style=\"visibility:hidden;\""); if (ua.oldOpera) document.write(" src=\"codethatcalendar.html\">"); document.write("</iframe>"); if (ua.oldOpera) document.write("</div>"); //--> </script> </body> </html> Is it possible to have only certain days available. i.e just Saturday nights for the whole year. It is possible in pro version to highlight certain items with differnt style. For example: // Add a link to a certain day c1.setLink("12/01/2003", "http://your_site.com"); // Give a special css for the date c1.setStyle("12/01/2003", "clsSuperDay"); Making certain items unavailable is not currently supported. Is it possible to use a small picture instead the ... button? You can use style for the input tag. For example: <input type=button style="width:150px;height:100px;background-image:url(book.gif)"> You can also use an <a> tag with any image inside. See any HTML reference for details. Is it possible to set min/max date on the calendar? An other thing, when you use the dropdown calendar in an iframe the calendar dissapires a couple of seconds after you click on the year/month selector. I guess the calendar looses focus and goes invisible when the mouse is over one of the dropdown boxes. You can use parameter yearrange when your calendar is in combobox style. For example: yearrange : [1987, 2005] Disappearing after loosing focus is behavior by design. I have a calendar, but I want that to choose some days, I can add to one cookie. To save in cookie dates (selected by user) you can use setLink API of CodeThatPro. For example: c1.setLink("12/01/2003", "javascript:SaveToCookie('12/01/2003');"); This code will save date 12/01/2003 to cookie if user has selected it. Please note you have to implement SaveToCookie function. When I click on any of the buttons - nothing happens.....there is no movement nor is the selected date put in the text box - any ideas; Does the .js file need to be in the Scripts folder? Possible cause is missing scripts. It's not nessesory for js to be in Scripts folder. Js file should be visible from html files. See src parameter of the <script> tag in codethatcalndar.html and your html page. Is there a way to assign custom events as a reaction to selecting the particular date? Like user clicks on say Oct 15th and my custom code being executed? Yes, it is possible with CalendarPro. Here's sample // Set custom link, may be js-code c1.setLink("10/15/2003", "javascript:alert(\"My birthday!\");"); // Set custom style c1.setStyle("09/02/2003", "clsSuperDay"); where c1 is an instance of CodeThatCaledar. |
|||||||||||||||
© CodeThat.com, 2003-2005 |