Skip to content

Commit

Permalink
README and fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick Spacek committed Oct 9, 2009
1 parent 97d8492 commit 09c7907
Show file tree
Hide file tree
Showing 8 changed files with 581 additions and 17 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*~$
20 changes: 20 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Copyright (c) 2009 Nick Spacek

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Empty file removed README
Empty file.
51 changes: 51 additions & 0 deletions README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
jQuery DateSpanPicker
=====================

This plugin is meant to offer a date span widget similar to the widget used in
Google's Calendar application.

Requirements
---------------
jQuery 1.3.2 (maybe not, but haven't tested with other versions)
jQuery.date_input.js: http://jonathanleighton.com/projects/date-input

Features
---------------
* Calendar widget using jQuery.date_input.js for selecting a date.
* Select time in 30 minute intervals
* End date/time automatically adjusted when the start date/time adjusted to
maintain a consistent interval.
** End date/time not adjusted if less than start date/time
* If end date and start date are the same (day), end time selector requires the
end time to be greater than the start time, and displays the difference.
* "All day" checkbox hides the start/end time.

Usage
---------------
Note: The included stylesheet pretties it up, but shouldn't be strictly
required. That said, it will look like junk if you don't use any. ;D

Given this HTML (style and script tags not shown):

<div id="picker">

<input type="text" class="picker-start-date" name="start_date" />
<input type="text" class="picker-start-time" name="start_time" />

<input type="text" class="picker-end-date" name="end_date" />
<input type="text" class="picker-end-time" name="end_time" />

<input type="checkbox" id="all_day" name="all_day" />
<label for="all_day">All day</label>

</div>

You can apply the plugin like this: $( '#picker' ).dateSpanPicker()

Issues
---------------
* Need to autocorrect bad entries
* Create elements if they don't exist (optional?)
* Better style for time picker
* jquery.date_input.js should allow custom classes

104 changes: 104 additions & 0 deletions example/example.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@

.date_selector {
background: #C3D9FF;
border: 1px solid #C3D9FF;
position: absolute;
z-index: 100000;
display: none;
line-height: 1em;
font-family: Arial, sans-serif;
font-size: 70%;
width: 12.45em;
}
.date_selector_ieframe {
position: absolute;
z-index: 99999;
display: none;
}
.date_selector .nav {
}
.date_selector .month_nav, .date_selector .year_nav {
margin: 0 0 3px 0;
padding: 0;
display: block;
position: relative;
text-align: center;
font-weight: bold;
}
.date_selector .month_nav {
}
.date_selector .year_nav {
display: none;
}
.date_selector .month_name, .date_selector .year_name {
display: block;
margin-top: 2px;
}
.date_selector .button {
position: absolute;
top: 0;
margin: 0 12px;
}
.date_selector .button:hover, .date_selector .button.hover {
background: none;
color: #003C78;
cursor: pointer;
border-color: #ccc;
}
.date_selector .prev {
left: 0;
}
.date_selector .next {
right: 0;
}
.date_selector table {
border-spacing: 0;
border-collapse: collapse;
width: 100%;
}

.date_selector th, .date_selector td {
font-family: Verdana, sans-serif;
padding: 2px;

text-align: center;
font-size: 65%;
}
.date_selector th {
font-weight: normal;
}
.date_selector td {
background: white;
}
.date_selector td.today {
background: #FFFEB3;
}
.date_selector td.unselected_month {
color: #ccc;
}
.date_selector td.selectable_day {
cursor: pointer;
}
.date_selector td.selected {
background: #D8DFE5;
font-weight: bold;
}
.date_selector td.selectable_day:hover, .date_selector td.selectable_day.hover {
background: #003C78;
color: white;
}

.picker-time-chooser {
height: 10em;
list-style: none;
overflow-x: hidden;
overflow-y: auto;
padding: 0;
width: 6em;
}

.picker-sameday {
width: 11em;
}


35 changes: 35 additions & 0 deletions example/example.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<html>
<head>
<title>jQuery DateSpanPicker</title>

<link rel="stylesheet" type="text/css" href="example.css" />

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript" src="jquery.date_input.js"></script>
<script type="text/javascript" src="../jquery.datespan-picker.js"></script>

<script type="text/javascript">
$( function () {
$( '#picker' ).dateSpanPicker();
});
</script>

</head>

<body>

<div id="picker">

<input type="text" class="picker-start-date" name="start_date" />
<input type="text" class="picker-start-time" name="start_time" />

<input type="text" class="picker-end-date" name="end_date" />
<input type="text" class="picker-end-time" name="end_time" />

<input type="checkbox" id="all_day" name="all_day" />
<label for="all_day">All day</label>

</div>

</body>
</html>
Loading

0 comments on commit 09c7907

Please sign in to comment.