On Wed, Feb 2, 2011 at 12:03 PM, Stephen De Gabrielle <[email protected]> wrote: > Just sharing a little work I did add date-pickers to fossil. It is easy > mis-type a date, and this provides a littel validation for when I do reports
I found a much lighter weight alternative to jquery. I had to modify the date format and adjust the positioning of the calendar. The positioning code I ended up with does not seem correct, but the result where I work (a mix of FireFox 3.6, Chrome and IE 7) is acceptable, however, I would not be surprised if any of you got wildly different results. YMMV. In my Edit Ticket, I put the targetdate field: <input type="text" name="targetdate" size="12" value="$<targetdate>" onFocus="javascript:GetDate(this)" /> The date picker and its CSS are attached.
semisimpleDatePicker.js
Description: JavaScript source
/**************************************************************************************
htmlDatePicker CSS file
Feel Free to change the fonts, sizes, borders, and colours of any of these elements
htmlDatePicker v0.1
Copyright (c) 2005, Jason Powell
All Rights Reserved
Redistribution and use in source and binary forms, with or without modification, are
permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this list of
conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list
of conditions and the following disclaimer in the documentation and/or other materials
provided with the distribution.
* Neither the name of the product nor the names of its contributors may be used to
endorse or promote products derived from this software without specific prior
written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
OF THE POSSIBILITY OF SUCH DAMAGE.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
***************************************************************************************/
/* The containing DIV element for the Calendar */
#dpCalendar {
display: none; /* Important, do not change */
position: absolute; /* Important, do not change */
background-color: #eeeeee;
color: black;
font-size: xx-small;
font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
width: 150px;
}
/* The table of the Calendar */
#dpCalendar table {
border: 1px solid black;
background-color: #eeeeee;
color: black;
font-size: xx-small;
font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
width: 100%;
}
/* The Next/Previous buttons */
#dpCalendar .cellButton {
background-color: #ddddff;
color: black;
}
/* The Month/Year title cell */
#dpCalendar .cellMonth {
background-color: #ddddff;
color: black;
text-align: center;
}
/* Any regular day of the month cell */
#dpCalendar .cellDay {
background-color: #ddddff;
color: black;
text-align: center;
}
/* The day of the month cell that is selected */
#dpCalendar .cellSelected {
border: 1px solid red;
background-color: #ffdddd;
color: black;
text-align: center;
}
/* The day of the month cell that is Today */
#dpCalendar .cellToday {
background-color: #ddffdd;
color: black;
text-align: center;
}
/* Any cell in a month that is unused (ie: Not a Day in that month) */
#dpCalendar .unused {
background-color: transparent;
color: black;
}
/* The cancel button */
#dpCalendar .cellCancel {
background-color: #cccccc;
color: black;
border: 1px solid black;
text-align: center;
}
/* The clickable text inside the calendar */
#dpCalendar a {
text-decoration: none;
background-color: transparent;
color: blue;
}
_______________________________________________ fossil-users mailing list [email protected] http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users

