Hi Folks.
I have seen a few posts re the DatePicker from Codecharge. Its a really nice design but it does lack.. Time capabilities.
I have a client who needs time entry and I have been pressed to try and provide a nice solution. Sure I can grab a non CCS one but it looks different from CCS's.
Anyay - I decided to look at the CCS one and see what I could do to make it work, and still work within the CCS environment.
When we declare a DatePickerObject CCS puts the following code into the HTML
var job_DatePicker_job_received_date = new Object();
job_DatePicker_job_received_date.format = "dd/mm/yyyy";
job_DatePicker_job_received_date.style = "Styles/Tranzblast/Style.css";
job_DatePicker_job_received_date.relativePathPart = "";
job_DatePicker_job_received_date.themeVersion = "3.0";
So I had to work out a way add new parameters for the functionality
So that I did not cause CCS's generated HTML to have issues I moved to a boick of JS further down the page where CCS did not have it's checksums, and added my own calling parameters.
I'm explaining this so that people can modify my work further
I then added these lines (the lines are optional depending on what you require)
job_DatePicker_job_received_date.showtimes =12
job_DatePicker_job_received_date.showseconds =1
job_DatePicker_job_received_date.resetbutton=1
job_DatePicker_job_received_date.format = "dd/mm/yyyy hh:nn AM/PM"
.
Ok - what do these do...
ShowTimes can be 0 (for no time entry), 12 for 12 hour, and 24 for 24 hour
ShowSeconds can be 0 for no Second input, or 1 for Seconds entry
Resetbutton can be 0 for no button, or 1 to display a button that when pressed will CLEAR the date field. Sorry - i could not find a Clear button icon but I could find Reset.
Format is the date formmating string. This is what will overide the CCS;s one and allow you to format the fate as you want.
i.e.
dd/mm/yyyy HH:nn:ss is the full 24 hour time with seconds
dd/mm/yyyy hh:nn AM/PM is the 12 hour with AM/PM display
You get the general idea.
Now - to enable the text field to handle this you will need to increase it's length in the FORMAT tab, and to enable CCS to process it correctly it is best to change the format in the DATA tab to 'GeneralDate'
And that is all there is to it.
I have included a link to the JS file and some instructions.
Please let me know how you go. And remeber - CCS will overwrite this code so keep it in a safe place.
http://public.change-flow-pro.com/datetimeobject.zip
Take Care and Enjoy
Dave