mirror of
https://github.com/HackPlan/angular-datepicker.git
synced 2026-06-19 17:43:21 +08:00
build(1.0.2)
This commit is contained in:
@@ -20,59 +20,73 @@
|
||||
<h3>default views</h3>
|
||||
|
||||
<h5>year</h5>
|
||||
|
||||
<div date-picker="start" view="year"></div>
|
||||
|
||||
<h5>month</h5>
|
||||
|
||||
<div date-picker="start" view="month"></div>
|
||||
|
||||
<h5>date</h5>
|
||||
|
||||
<div date-picker="start" view="date"></div>
|
||||
|
||||
<h5>hours</h5>
|
||||
|
||||
<div date-picker="start" view="hours"></div>
|
||||
|
||||
<h5>minutes</h5>
|
||||
|
||||
<div date-picker="start" view="minutes"></div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div>
|
||||
<h3>min views</h3>
|
||||
|
||||
<h5>year</h5>
|
||||
|
||||
<div date-picker="start" min-view="year"></div>
|
||||
|
||||
<h5>month</h5>
|
||||
|
||||
<div date-picker="start" min-view="month"></div>
|
||||
|
||||
<h5>date</h5>
|
||||
|
||||
<div date-picker="start" min-view="date"></div>
|
||||
|
||||
<h5>hours</h5>
|
||||
|
||||
<div date-picker="start" min-view="hours"></div>
|
||||
|
||||
<h5>minutes</h5>
|
||||
|
||||
<div date-picker="start" min-view="minutes"></div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<div>
|
||||
<h3>max views</h3>
|
||||
|
||||
<h5>year</h5>
|
||||
|
||||
<div date-picker="start" max-view="year"></div>
|
||||
|
||||
<h5>month</h5>
|
||||
|
||||
<div date-picker="start" max-view="month"></div>
|
||||
|
||||
<h5>date</h5>
|
||||
|
||||
<div date-picker="start" max-view="date"></div>
|
||||
|
||||
<h5>hours</h5>
|
||||
|
||||
<div date-picker="start" max-view="hours"></div>
|
||||
|
||||
<h5>maxutes</h5>
|
||||
|
||||
<div date-picker="start" max-view="minutes"></div>
|
||||
</div>
|
||||
|
||||
@@ -80,9 +94,11 @@
|
||||
<h3>max & min views</h3>
|
||||
|
||||
<h5>time</h5>
|
||||
|
||||
<div date-picker="start" max-view="hours" min-view="minutes"></div>
|
||||
|
||||
<h5>date</h5>
|
||||
|
||||
<div date-picker="start" max-view="year" min-view="date"></div>
|
||||
|
||||
</div>
|
||||
@@ -94,8 +110,7 @@
|
||||
<div class="span6">
|
||||
<h3>Input</h3>
|
||||
<h5>default</h5>
|
||||
<pre></pre>
|
||||
<input type="text" date-time ng-model="start" required="true" view="hours" position="absolute">
|
||||
<input type="text" date-time ng-model="start" required="true" view="hours">
|
||||
|
||||
<h3>Input with append</h3>
|
||||
<h5>default</h5>
|
||||
@@ -110,7 +125,7 @@
|
||||
|
||||
<div class="input-prepend" date-time-append>
|
||||
<span class="add-on"><i class="icon-calendar"></i></span>
|
||||
<input type="text" date-time ng-model="start" required="true" view="hours" position="absolute">
|
||||
<input type="text" date-time ng-model="start" required="true" view="hours">
|
||||
</div>
|
||||
|
||||
<h5>Input format</h5>
|
||||
@@ -128,9 +143,8 @@
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<h5>Date range</h5>
|
||||
<pre><div date-range start="start" end="end" ></div> </pre>
|
||||
|
||||
<div date-range start="a" end="b" style="position: relative; z-index:0"></div>
|
||||
<h5>Date range button</h5>
|
||||
|
||||
@@ -146,9 +160,8 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="components/jquery/jquery.js"></script>
|
||||
<script src="components/angular/angular.js"></script>
|
||||
<script src="components/angular-bootstrap/ui-bootstrap.js"></script>
|
||||
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.0/angular.min.js"></script>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/angular-ui-bootstrap/0.6.0/ui-bootstrap-tpls.min.js"></script>
|
||||
<!-- build:js module.min.js -->
|
||||
<script src="scripts/datePicker.js"></script>
|
||||
<script src="scripts/dateRange.js"></script>
|
||||
|
||||
@@ -123,7 +123,7 @@ Module.directive('datePicker', function datePickerDirective(datePickerConfig) {
|
||||
scope.views.indexOf(attrs.minView || 'minutes')+1
|
||||
);
|
||||
|
||||
if (scope.views.length === 1 || scope.views.indexOf(scope.view)==-1) {
|
||||
if (scope.views.length === 1 || scope.views.indexOf(scope.view)===-1) {
|
||||
scope.view = scope.views[0];
|
||||
}
|
||||
|
||||
|
||||
20
dist/index.js
vendored
20
dist/index.js
vendored
@@ -118,20 +118,14 @@ Module.directive('datePicker', function datePickerDirective(datePickerConfig) {
|
||||
scope.template = attrs.template || datePickerConfig.template;
|
||||
|
||||
var step = parseInt(attrs.step || datePickerConfig.step, 10);
|
||||
var index;
|
||||
|
||||
/** @namespace attrs.minView */
|
||||
if (attrs.minView) {
|
||||
index = scope.views.indexOf(attrs.minView);
|
||||
scope.views.splice(0, index);
|
||||
}
|
||||
/** @namespace attrs.maxView */
|
||||
if (attrs.maxView) {
|
||||
index = scope.views.indexOf(attrs.maxView);
|
||||
scope.views.splice(index + 1);
|
||||
}
|
||||
/** @namespace attrs.minView, attrs.maxView */
|
||||
scope.views =scope.views.slice(
|
||||
scope.views.indexOf(attrs.maxView || 'year'),
|
||||
scope.views.indexOf(attrs.minView || 'minutes')+1
|
||||
);
|
||||
|
||||
if (scope.views.length === 1) {
|
||||
if (scope.views.length === 1 || scope.views.indexOf(scope.view)===-1) {
|
||||
scope.view = scope.views[0];
|
||||
}
|
||||
|
||||
@@ -340,7 +334,7 @@ Module.directive('dateTimeAppend', function () {
|
||||
return {
|
||||
link: function (scope, element) {
|
||||
element.bind('click', function () {
|
||||
element.find('input').focus();
|
||||
element.find('input')[0].focus();
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
2
dist/index.min.js
vendored
2
dist/index.min.js
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user