Skip to content

Commit

Permalink
Merge branch 'release/v0.1.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
xenor committed Apr 26, 2013
2 parents 4d9fb11 + dff395b commit f00618a
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 5 deletions.
13 changes: 12 additions & 1 deletion README.md
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -24,9 +24,20 @@ Add options:


02.00 AM - 03.30 PM, 15 minutes steps: 02.00 AM - 03.30 PM, 15 minutes steps:
```javascript ```javascript
$("#time2").timePicker({ $("#time").timePicker({
startTime: new Date(0, 0, 0, 2, 00, 0), startTime: new Date(0, 0, 0, 2, 00, 0),
endTime: new Date(0, 0, 0, 15, 30, 0), endTime: new Date(0, 0, 0, 15, 30, 0),
show24Hours: false, show24Hours: false,
step: 15}); step: 15});
``` ```

startTime and endTime can also be string :
```javascript
$("#time2").timePicker({
startTime: "2:00",
endTime: "15:30",
separator: ':', // needs to provide correct seperator
show24Hours: false,
step: 15});
```

1 change: 1 addition & 0 deletions VERSION
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1 @@
v0.1.1
2 changes: 1 addition & 1 deletion package.json
Original file line number Original file line Diff line number Diff line change
@@ -1,7 +1,7 @@
{ {
"name": "ender-timepicker", "name": "ender-timepicker",
"description": "Ender Time picker.", "description": "Ender Time picker.",
"version": "0.1.0", "version": "0.1.1",
"authors": ["tubaxenor"], "authors": ["tubaxenor"],
"homepage": "https://github.com/tubaxenor/ender-timePicker.git", "homepage": "https://github.com/tubaxenor/ender-timePicker.git",
"main": "./timepicker.js", "main": "./timepicker.js",
Expand Down
2 changes: 1 addition & 1 deletion timepicker.css
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ div.time-picker {
margin: 0; margin: 0;
} }
div.time-picker-12hours { div.time-picker-12hours {
width:6em; /* needed for IE */ width: 6em; /* needed for IE */
} }


div.time-picker ul { div.time-picker ul {
Expand Down
11 changes: 9 additions & 2 deletions timepicker.js
Original file line number Original file line Diff line number Diff line change
@@ -1,4 +1,5 @@
!function ($) { !function ($) {
// browser detection
if (!$.browser) { if (!$.browser) {
var userAgent = navigator.userAgent.toLowerCase(); var userAgent = navigator.userAgent.toLowerCase();
$.browser = {}; $.browser = {};
Expand All @@ -14,7 +15,8 @@
startTime: new Date(0, 0, 0, 0, 0, 0), startTime: new Date(0, 0, 0, 0, 0, 0),
endTime: new Date(0, 0, 0, 23, 30, 0), endTime: new Date(0, 0, 0, 23, 30, 0),
separator: ':', separator: ':',
show24Hours: true show24Hours: true,
appendElement: 'body'
} }
} }
var tpOver = false; var tpOver = false;
Expand Down Expand Up @@ -42,7 +44,12 @@
} }
$tpDiv.append($tpList); $tpDiv.append($tpList);
// Append the timPicker to the body and position it. // Append the timPicker to the body and position it.
$tpDiv.appendTo('body').hide(); if(settings.appendElement == undefined){
$tpDiv.appendTo('body').hide();
} else {
$tpDiv.appendTo(settings.appendElement).hide();
}



// Store the mouse state, used by the blur event. Use mouseover instead of // Store the mouse state, used by the blur event. Use mouseover instead of
// mousedown since Opera fires blur before mousedown. // mousedown since Opera fires blur before mousedown.
Expand Down

0 comments on commit f00618a

Please sign in to comment.