Kevin
|
| Posted: 08/10/2002, 2:23 PM |
|
Adding the Calendar Extension to CodeCharge Studio is a 2 step process:
1. Create a folder called Extensions in the CodeChargeStudio\Components\ToolBox folder then in the Extensions folder create icon and JS folders
2. Move the Extensions.xml file to CodeChargeStudio\Components\ToolBox, the Calendar.xml file to the Extensions folder, the Calendar.js to the JS folder, the cal.ico to the icon folder and the ccscalendar.js file to the project folder where your project.ccs file is.(Make sure your Project settings/Publishing is set to All files excluding….)
Using the Extension:
Open a project with Date fields and position the cursor at the right end of the text box of a date field while in Design mode, click on the Extensions tab in your ToolBox then click on the Calendar Icon. Switch to HTML mode and change Calendar1 to the Name for your Date Field. Add <script language="JavaScript" src="ccscalendar.js"></script> in the Head section after the Title line. Note: The Time Stamp function is enabled when the value of the third pramater is 1 like below:
<a href="javascript:show_calendar4x('document.all.date_resolve', document.all.date_resolve.value,1,'./');">
The above line causes the Calendar function to return the current date/time without displaying the pop up calendar.
You can also be in HTML mode and insert the Calendar, position the cursor at the point you want then click on the Calendar Icon. I found that maxlength="19" size="19" works for a date field.
The Extensions.xml file:
<item name="Extensions" number="4" hint="User Created Extensions" folder="Extensions"/>
The Calendar.xml File:
<?xml version="1.0" encoding="ISO-8859-1"?>
<item name="Calendar" number="35" hint="Position cursor then click" script="..\..\..\Components\ToolBox\Extensions\JS\calendar.js" img="..\..\..\Components\ToolBox\Extensions\icon\cal.ico"/>
The Calendar.js file:
var doc = ccPage.HTML;
var name = "Calendar";
var index = 1;
if (doc) for(index=1; doc.all(name+index); index++){}
ccPage.pasteHTML("<a href=\"javascript:show_calendar4x('document.all."+name+index+"', document.all."+name+index+".value,0, './');\"><img height=\"16\" alt=\"Click Here to Pick the date\" src=\"./images/cal.gif\" width=\"16\" border=\"0\"></a>");
A complete project with all the scripts and a database is located at http://acats.com/ccscalendar.zip
A note about the date format:
The object of the pop up calendar is to always return the date/time in a pre-defined format, while the yyyy-mm-dd H:nn:ss or 2002-12-31 23:59:59 may look weird it works when explained as “The largest to the smallest”. Since the users can ‘pick’ a date they should not care about the data entry format. When you create a Grid you can define the display format to be anything you want. Check out the ccscalendar project, the Date Assign field is set with a display format of LongDate and the Date Solve field is set with a format of General. The Date Assign field is defaulted to the current date during an Add function (Insert) and the Date Solve field is set by a Calendar in the Time Stamp mode.
Future: Add a Time pop up to the Calendar pop up
Have fun….. Kevin (kangus@acats.com)
Credit where its due:
CodeCharge Studio Extension: Bill Noble http://www.gotocode.com/art.asp?art_id=176&
Tigra Calendar Project and updates:
Author: Denis Gritcyuk <denis@softcomplex.com>
Version: 1.0.a (Date selector only) reworked by Richard Perry
Version 1.0.b reworked by Eddie May Time + Netscape http://www.softcomplex.com/products/tigra_calendar/
Version:CCSCalendar 1.0.1 Rework by Kevin Angus CCS + Timestamp + dual digit returned values http://acats.com/CCSCalendar.zip
Please note that the current version of Tigra Calendar (08-10-2002) is version 3.1, this version will not work for CodeCharge Studio as the code has been split into two parts, 50% of the logic is HTML and the rest is JavaScript or Calendar.js. This is why I renamed the project to CCSCalendar.
Sorry, following error occured:Uploading file size limit exceeded.
File can be found at http://acats.com/ccscalendar.zip 107kb that is 107,000 bytes !!!!
|
|
|
 |
kangus
|
| Posted: 08/11/2002, 4:42 PM |
|
The ccscalendar.js file has been updated and included in the project. You can download just the javascript file from http://acats.com/ccscalendarjs_update.zip or the updated project from http://acats.com/ccscalendar.zip
The JavaScript ccscalendar code had a formatting issue with the time stamp value.
|
|
|
 |
Bill Noble
|
| Posted: 08/12/2002, 8:14 AM |
|
Thanks Kevin
Your a star
|
|
|
 |
kangus
|
| Posted: 08/12/2002, 8:40 AM |
|
You can see the ccscalendar working at http://acats.com/datetest/index.html
The Date Resolved Grid displays the time and explaines the format
|
|
|
 |
RG
|
| Posted: 09/23/2002, 11:47 AM |
|
Hi there!
I can't get to http://acats.com/...
I miss the ccscalendar.js from the message "CCS Calendar Extension for the ToolBox": http://www.gotocode.com/disc_viewt.asp?mid=13776&s_topic=ccscalendar&
Is that a custom js? can anybody send it to me please. "rghara@sbcglobal.net"
Thanks
|
|
|
 |
Magic
|
| Posted: 10/16/2002, 5:46 PM |
|
I can't find that file....can somebody send it to me by email atmagic@opc.qc.ca
|
|
|
 |
|