Skip to content

Commit

Permalink
Bug Fix : minValue and maxValue
Browse files Browse the repository at this point in the history
Fixed a bug in minValue and maxValue functionality.
Added examples for minValue and maxValue functionality.
  • Loading branch information
nehakadam committed Feb 20, 2016
1 parent 6206acd commit 3a397d0
Show file tree
Hide file tree
Showing 51 changed files with 807 additions and 89 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "anypicker",

"version": "2.0.0",
"version": "2.0.1",

"license" : "See License Information in LICENSE file",

Expand Down
87 changes: 87 additions & 0 deletions demo/AnyPicker-DateTime-Date-MinMax.htm
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
<!DOCTYPE html>

<html>

<head>

<title>Date Picker - AnyPicker</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="msapplication-tap-highlight" content="no" />

<style type="text/css">

body
{
margin: 0px;
}

.input-cont
{
width: 300px;
padding: 20px;
}

input
{
width: 200px;
height: 30px;
padding: 3px 10px;

margin-bottom: 16px;
}

</style>

<link rel="stylesheet" type="text/css" href="../src/anypicker-font.css" />
<link rel="stylesheet" type="text/css" href="../src/anypicker.css" />

<link rel="stylesheet" type="text/css" href="../src/anypicker-ios.css" />
<link rel="stylesheet" type="text/css" href="../src/anypicker-android.css" />
<link rel="stylesheet" type="text/css" href="../src/anypicker-windows.css" />

<script type="text/javascript" src="vendors/jquery-1.11.1.min.js"></script>
<script type="text/javascript" src="../src/anypicker.js"></script>

<script type="text/javascript">

$(document).ready(function()
{
$("#ip-de").AnyPicker(
{
mode: "datetime",

dateTimeFormat: "yyyy-MM-dd",

minValue: new Date(2015, 01, 19),

maxValue: new Date(2017, 01, 19)
});
});

</script>

</head>

<body>

<table class="input-cont">

<tr>

<td>Date : (Default) </td>

</tr>

<tr>

<td>
<input type="text" id="ip-de" readonly>
</td>

</tr>

</table>

</body>

</html>
87 changes: 87 additions & 0 deletions demo/AnyPicker-DateTime-DateTime-MinMax.htm
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
<!DOCTYPE html>

<html>

<head>

<title>DateTime Picker - AnyPicker</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="msapplication-tap-highlight" content="no" />

<style type="text/css">

body
{
margin: 0px;
}

.input-cont
{
width: 300px;
padding: 20px;
}

input
{
width: 200px;
height: 30px;
padding: 3px 10px;

margin-bottom: 16px;
}

</style>

<link rel="stylesheet" type="text/css" href="../src/anypicker-font.css" />
<link rel="stylesheet" type="text/css" href="../src/anypicker.css" />

<link rel="stylesheet" type="text/css" href="../src/anypicker-ios.css" />
<link rel="stylesheet" type="text/css" href="../src/anypicker-android.css" />
<link rel="stylesheet" type="text/css" href="../src/anypicker-windows.css" />

<script type="text/javascript" src="vendors/jquery-1.11.1.min.js"></script>
<script type="text/javascript" src="../src/anypicker.js"></script>

<script type="text/javascript">

$(document).ready(function()
{
$("#ip-de").AnyPicker(
{
mode: "datetime",

dateTimeFormat: "MMM dd,yyyy hh:mm AA",

minValue: new Date(2015, 0, 19, 10, 0, 0, 0),

maxValue: new Date(2016, 0, 19, 19, 0, 0, 0)
});
});

</script>

</head>

<body>

<table class="input-cont">

<tr>

<td>Date : (Default) </td>

</tr>

<tr>

<td>
<input type="text" id="ip-de" readonly>
</td>

</tr>

</table>

</body>

</html>
147 changes: 147 additions & 0 deletions demo/AnyPicker-DateTime-StartEnd-Date.htm
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
<!DOCTYPE html>

<html>

<head>

<title>Start Date and End Date - AnyPicker</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="msapplication-tap-highlight" content="no" />

<style type="text/css">

body
{
margin: 0px;
}

.input-cont
{
width: 300px;
padding: 20px;
}

input
{
width: 200px;
height: 30px;
padding: 3px 10px;

margin-bottom: 16px;
}

</style>

<link rel="stylesheet" type="text/css" href="../src/anypicker-font.css" />
<link rel="stylesheet" type="text/css" href="../src/anypicker.css" />

<link rel="stylesheet" type="text/css" href="../src/anypicker-ios.css" />
<link rel="stylesheet" type="text/css" href="../src/anypicker-android.css" />
<link rel="stylesheet" type="text/css" href="../src/anypicker-windows.css" />

<script type="text/javascript" src="vendors/jquery-1.11.1.min.js"></script>
<script type="text/javascript" src="../src/anypicker.js"></script>

<script type="text/javascript">

var oAP1, oAP2;
var dStartD, dEndD, sStartD, sEndD;

dStartD = new Date(2015, 9, 20, 0, 0, 0, 0);
dEndD = new Date(dStartD.getTime() + (5 * $.AnyPicker.extra.iMS.d));

$(document).ready(function()
{
$("#ip-start-date").AnyPicker(
{
mode: "datetime",

inputDateTimeFormat: "dd/MM/yyyy",
dateTimeFormat: "MMM dd,yyyy",

onInit: function()
{
oAP1 = this;
sEndD = oAP1.formatOutputDates(dEndD, "dd MM yyyy");
oAP1.setMaximumDate(sEndD);
oAP1.setSelectedDate(dStartD);

console.log("maxValue : " + sEndD);
},

onSetOutput: function(sOutput, oSelectedValues)
{
sStartD = sOutput;
oAP2.setMinimumDate(sStartD);
oAP2.setSelectedDate(sStartD);
console.log("minValue : " + oAP2.setting.minValue);
}
});

$("#ip-end-date").AnyPicker(
{
mode: "datetime",

inputDateTimeFormat: "dd/MM/yyyy",
dateTimeFormat: "MMM dd,yyyy",

onInit: function()
{
oAP2 = this;

sStartD = oAP2.formatOutputDates(dStartD);
oAP2.setMinimumDate(sStartD);
oAP2.setSelectedDate(dEndD);
console.log("minValue : " + sStartD);
},

onSetOutput: function(sOutput, oSelectedValues)
{
sEndD = sOutput;
oAP1.setMaximumDate(sEndD);
console.log("maxValue : " + oAP1.setting.maxValue);
}
});
});

</script>

</head>

<body>

<table class="input-cont">

<tr>

<td>Start Date : </td>

</tr>

<tr>

<td>
<input type="text" id="ip-start-date" readonly>
</td>

</tr>

<tr>

<td>End Date : </td>

</tr>

<tr>

<td>
<input type="text" id="ip-end-date" readonly>
</td>

</tr>

</table>

</body>

</html>
Loading

0 comments on commit 3a397d0

Please sign in to comment.