renamed calendar to datePicker (date-picker)

This commit is contained in:
g00fy
2013-06-08 10:33:08 +02:00
parent 9c7a37a58c
commit 96ef60bb79
2 changed files with 16 additions and 16 deletions

View File

@@ -24,23 +24,23 @@
<h3>views</h3>
<h5>default</h5>
<pre>&lt;div calendar="start"&gt;&lt;/div&gt; </pre>
<div calendar="start" class="datetimepicker"></div>
<pre>&lt;div date-picker="start"&gt;&lt;/div&gt; </pre>
<div date-picker="start" class="datetimepicker"></div>
<!--<h5>year</h5>-->
<!--<pre>&lt;div calendar="start" <strong>year</strong>&gt;&lt;/div&gt; </pre>-->
<!--<div calendar="start" class="datetimepicker" year></div>-->
<!--<pre>&lt;div date-picker="start" <strong>year</strong>&gt;&lt;/div&gt; </pre>-->
<!--<div date-picker="start" class="datetimepicker" year></div>-->
<!--<h5>month</h5>-->
<!--<pre>&lt;div calendar="start <strong>month</strong>&gt;&lt;/div&gt; </pre>-->
<!--<div calendar="start" class="datetimepicker" month></div>-->
<!--<pre>&lt;div date-picker="start <strong>month</strong>&gt;&lt;/div&gt; </pre>-->
<!--<div date-picker="start" class="datetimepicker" month></div>-->
<!--<h5>date</h5>-->
<!--<pre>&lt;div calendar="start" <strong>date</strong>&gt;&lt;/div&gt; </pre>-->
<!--<div calendar="start" class="datetimepicker" date></div>-->
<!--<pre>&lt;div date-picker="start" <strong>date</strong>&gt;&lt;/div&gt; </pre>-->
<!--<div date-picker="start" class="datetimepicker" date></div>-->
<!--<h5>hours</h5>-->
<!--<pre>&lt;div calendar="start" <strong>hours</strong>&gt;&lt;/div&gt; </pre>-->
<!--<div calendar="start" class="datetimepicker" hours></div>-->
<!--<pre>&lt;div date-picker="start" <strong>hours</strong>&gt;&lt;/div&gt; </pre>-->
<!--<div date-picker="start" class="datetimepicker" hours></div>-->
<!--<h5>minutes</h5>-->
<!--<pre>&lt;div calendar="start" <strong>minutes</strong>&gt;&lt;/div&gt; </pre>-->
<!--<div calendar="start" class="datetimepicker" minutes></div>-->
<!--<pre>&lt;div date-picker="start" <strong>minutes</strong>&gt;&lt;/div&gt; </pre>-->
<!--<div date-picker="start" class="datetimepicker" minutes></div>-->
<!--</div>-->
<!--<div class="span6">-->
<!--<h3>Input</h3>-->

View File

@@ -2,7 +2,7 @@
var Module = angular.module('dateInput', []);
Module.directive('calendar', function () {
Module.directive('datePicker', function () {
var viewOptions = ['month', 'date', 'year', 'month', 'hours', 'minutes'];
function isValidDate(date) {
@@ -113,7 +113,7 @@
return {
scope : {
date : '=calendar',
date : '=datePicker',
after : '=?',
before: '=?'
},
@@ -382,7 +382,7 @@
element.bind('focus', function () {
if (!picker) {
picker = $compile('<div calendar="' + attrs.ngModel + '" class="datetimepicker datetimepicker-dropdown-bottom-left dropdown-menu" format="' + format + '" ' + views.join(' ') + '></div>')(scope);
picker = $compile('<div date-picker="' + attrs.ngModel + '" class="datetimepicker datetimepicker-dropdown-bottom-left dropdown-menu" format="' + format + '" ' + views.join(' ') + '></div>')(scope);
body.append(picker);
picker.bind('mousedown', function () {
return false;
@@ -405,7 +405,7 @@
Module.directive('dateRange', function () {
return {
template: '<div class="dropdown-menu" style="display: block">\n <table >\n <tr>\n <td valign="top"><div calendar="start" class="datetimepicker" date after="start" before="end"></div></td>\n <td valign="top"><div calendar="end" class="datetimepicker" date after="start" before="end"></div></td>\n </tr>\n </table>\n \n \n</div>',
template: '<div class="dropdown-menu" style="display: block">\n <table >\n <tr>\n <td valign="top"><div date-picker="start" class="datetimepicker" date after="start" before="end"></div></td>\n <td valign="top"><div date-picker="end" class="datetimepicker" date after="start" before="end"></div></td>\n </tr>\n </table>\n \n \n</div>',
scope : {
start: '=',
end : '='