Skip to content

Commit

Permalink
build(1.0.2)
Browse files Browse the repository at this point in the history
  • Loading branch information
g00fy- committed Nov 12, 2013
1 parent a65e549 commit f5391dc
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 26 deletions.
35 changes: 24 additions & 11 deletions app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,69 +20,85 @@ <h2>Calendar</h2>
<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>

<div>
<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>
Expand All @@ -94,8 +110,7 @@ <h5>date</h5>
<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>
Expand All @@ -110,7 +125,7 @@ <h5>default</h5>

<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>
Expand All @@ -128,9 +143,8 @@ <h5>A button</h5>
</div>



<h5>Date range</h5>
<pre>&lt;div date-range start="start" end="end" &gt;&lt;/div&gt; </pre>

<div date-range start="a" end="b" style="position: relative; z-index:0"></div>
<h5>Date range button</h5>

Expand All @@ -146,9 +160,8 @@ <h5>Date range button</h5>
</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>
Expand Down
2 changes: 1 addition & 1 deletion app/scripts/datePicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}

Expand Down
20 changes: 7 additions & 13 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}

Expand Down Expand Up @@ -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();
});
}
};
Expand Down
Loading

0 comments on commit f5391dc

Please sign in to comment.