Permalink
Browse files

Merge branch 'release/v0.1.1'

  • Loading branch information...
xenor
xenor committed Apr 26, 2013
2 parents 4d9fb11 + dff395b commit f00618a98f0925ee94664a59cfc497f53a472577
Showing with 24 additions and 5 deletions.
  1. +12 −1 README.md
  2. +1 −0 VERSION
  3. +1 −1 package.json
  4. +1 −1 timepicker.css
  5. +9 −2 timepicker.js
View
@@ -24,9 +24,20 @@ Add options:
02.00 AM - 03.30 PM, 15 minutes steps:
```javascript
-$("#time2").timePicker({
+$("#time").timePicker({
startTime: new Date(0, 0, 0, 2, 00, 0),
endTime: new Date(0, 0, 0, 15, 30, 0),
show24Hours: false,
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});
+```
+
View
@@ -0,0 +1 @@
+v0.1.1
View
@@ -1,7 +1,7 @@
{
"name": "ender-timepicker",
"description": "Ender Time picker.",
- "version": "0.1.0",
+ "version": "0.1.1",
"authors": ["tubaxenor"],
"homepage": "https://github.com/tubaxenor/ender-timePicker.git",
"main": "./timepicker.js",
View
@@ -10,7 +10,7 @@ div.time-picker {
margin: 0;
}
div.time-picker-12hours {
- width:6em; /* needed for IE */
+ width: 6em; /* needed for IE */
}
div.time-picker ul {
View
@@ -1,4 +1,5 @@
!function ($) {
+ // browser detection
if (!$.browser) {
var userAgent = navigator.userAgent.toLowerCase();
$.browser = {};
@@ -14,7 +15,8 @@
startTime: new Date(0, 0, 0, 0, 0, 0),
endTime: new Date(0, 0, 0, 23, 30, 0),
separator: ':',
- show24Hours: true
+ show24Hours: true,
+ appendElement: 'body'
}
}
var tpOver = false;
@@ -42,7 +44,12 @@
}
$tpDiv.append($tpList);
// 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
// mousedown since Opera fires blur before mousedown.

0 comments on commit f00618a

Please sign in to comment.