Skip to content
This repository was archived by the owner on Feb 18, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added assets/.DS_Store
Binary file not shown.
Binary file added assets/js/.DS_Store
Binary file not shown.
2 changes: 1 addition & 1 deletion config/csslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"text-indent": false,
"unique-headings": false,
"universal-selector": false,
"unqualified-attributes": true,
"unqualified-attributes": false,
"vendor-prefix": true,
"zero-units": true
}
22 changes: 14 additions & 8 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,28 @@
<body>
<div class="separator50"></div>
<div class="col6 offset-left2">
<div class="col5">
<datepicker
<div class="col3">
<div datepicker>
<input ng-model="date1" type="text" class="angular-datepicker-input"/>
</div>
Date 1 is: {{date1}}
</div>
<div class="col3">
<div class="datepicker"
date-format="MMMM d, y"
date-min-limit="2014/09/07"
date-max-limit="2018/09/07"
button-prev='<i class="fa fa-arrow-circle-left"></i>'
button-next='<i class="fa fa-arrow-circle-right"></i>'>
<input ng-model="date1" type="text" class="angular-datepicker-input"/>
</datepicker>
Date 1 is: {{date1}}
<input ng-model="date2" type="text" class="angular-datepicker-input"/>
</div>
Date 2 is: {{date2}}
</div>
<div class="col5">
<div class="col3">
<datepicker>
<input ng-model="date2" type="text" class="angular-datepicker-input"/>
<input ng-model="date3" type="text" class="angular-datepicker-input"/>
</datepicker>
Date 2 is: {{date2}}
Date 3 is: {{date3}}
</div>
</div>
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.4/angular.min.js"></script>
Expand Down
10 changes: 6 additions & 4 deletions src/css/angular-datepicker.css
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
datepicker a{
datepicker a, [datepicker] a, .datepicker a{
color:inherit;
text-decoration:none;
}
datepicker a:hover{
datepicker a:hover, [datepicker] a:hover, .datepicker a:hover{
text-decoration:none;
}
datepicker select,datepicker select:focus,datepicker select:hover{
datepicker select, datepicker select:focus, datepicker select:hover,
.datepicker select, .datepicker select:focus, .datepicker select:hover
[datepicker] select, [datepicker] select:focus, [datepicker] select:hover{
width:100%;
overflow: hidden;
background:none;
Expand All @@ -15,7 +17,7 @@ datepicker select,datepicker select:focus,datepicker select:hover{
height: 30px;
border-radius:2px;
}
datepicker,
datepicker, .datepicker, [datepicker],
._720kb-datepicker-calendar-header,
._720kb-datepicker-calendar-body,
._720kb-datepicker-calendar-days-header,
Expand Down
2 changes: 1 addition & 1 deletion src/js/angular-datepicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

var A_DAY_IN_MILLISECONDS = 86400000;
return {
'restrict': 'E',
'restrict': 'AEC',
'scope': {
'dateSet': '@',
'dateMinLimit': '@',
Expand Down
Binary file added ui-bootstrap/.DS_Store
Binary file not shown.
Binary file added ui-bootstrap/assets/.DS_Store
Binary file not shown.
Binary file added ui-bootstrap/assets/js/.DS_Store
Binary file not shown.
11 changes: 11 additions & 0 deletions ui-bootstrap/assets/js/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*global angular*/

(function (angular) {
'use strict';

angular.module('720kb', [
'ngRoute',
'ui.bootstrap',
'720kb.datepicker'
]);
}(angular));
46 changes: 46 additions & 0 deletions ui-bootstrap/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<!doctype html>
<html ng-app="720kb">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0,user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, target-densitydpi=device-dpi" />
<link rel="stylesheet" type="text/css" href="//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.1.0/css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="http://720kb.github.io/csshelper/assets/ext/src/helper.css">
<link rel="stylesheet" type="text/css" href="../src/css/angular-datepicker.css">
<style>
input[type="text"] {
border: 2px solid grey;
}
*:focus{
outline:4px solid red;
}
</style>
<title>Angularjs Datepicker</title>
</head>
<body>
<div class="separator50"></div>
<div class="col6 offset-left2">
<div class="col5">
<div class="datepicker"
date-format="MMMM d, y"
date-min-limit="2014/09/07"
date-max-limit="2018/09/07"
button-prev='<i class="fa fa-arrow-circle-left"></i>'
button-next='<i class="fa fa-arrow-circle-right"></i>'>
<input ng-model="date1" type="text" class="angular-datepicker-input"/>
</div>
Date 1 is: {{date1}}
</div>
<div class="col5">
<div class="datepicker">
<input ng-model="date2" type="text" class="angular-datepicker-input"/>
</div>
Date 2 is: {{date2}}
</div>
</div>
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.4/angular.min.js"></script>
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.4/angular-route.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/angular-ui-bootstrap/0.12.0/ui-bootstrap-tpls.js"></script>
<script type="text/javascript" src="../src/js/angular-datepicker.js"></script>
<script type="text/javascript" src="assets/js/index.js"></script>
</body>
</html>
Binary file added ui-bootstrap/template/.DS_Store
Binary file not shown.
Binary file added ui-bootstrap/template/datepicker/.DS_Store
Binary file not shown.
5 changes: 5 additions & 0 deletions ui-bootstrap/template/datepicker/datepicker.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<div ng-switch="datepickerMode" role="application" ng-keydown="keydown($event)">
<daypicker ng-switch-when="day" tabindex="0"></daypicker>
<monthpicker ng-switch-when="month" tabindex="0"></monthpicker>
<yearpicker ng-switch-when="year" tabindex="0"></yearpicker>
</div>
21 changes: 21 additions & 0 deletions ui-bootstrap/template/datepicker/day.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<table role="grid" aria-labelledby="{{uniqueId}}-title" aria-activedescendant="{{activeDateId}}">
<thead>
<tr>
<th><button type="button" class="btn btn-default btn-sm pull-left" ng-click="move(-1)" tabindex="-1"><i class="glyphicon glyphicon-chevron-left"></i></button></th>
<th colspan="{{5 + showWeeks}}"><button id="{{uniqueId}}-title" role="heading" aria-live="assertive" aria-atomic="true" type="button" class="btn btn-default btn-sm" ng-click="toggleMode()" tabindex="-1" style="width:100%;"><strong>{{title}}</strong></button></th>
<th><button type="button" class="btn btn-default btn-sm pull-right" ng-click="move(1)" tabindex="-1"><i class="glyphicon glyphicon-chevron-right"></i></button></th>
</tr>
<tr>
<th ng-show="showWeeks" class="text-center"></th>
<th ng-repeat="label in labels track by $index" class="text-center"><small aria-label="{{label.full}}">{{label.abbr}}</small></th>
</tr>
</thead>
<tbody>
<tr ng-repeat="row in rows track by $index">
<td ng-show="showWeeks" class="text-center h6"><em>{{ weekNumbers[$index] }}</em></td>
<td ng-repeat="dt in row track by dt.date" class="text-center" role="gridcell" id="{{dt.uid}}" aria-disabled="{{!!dt.disabled}}">
<button type="button" style="width:100%;" class="btn btn-default btn-sm" ng-class="{'btn-info': dt.selected, active: isActive(dt)}" ng-click="select(dt.date)" ng-disabled="dt.disabled" tabindex="-1"><span ng-class="{'text-muted': dt.secondary, 'text-info': dt.current}">{{dt.label}}</span></button>
</td>
</tr>
</tbody>
</table>
16 changes: 16 additions & 0 deletions ui-bootstrap/template/datepicker/month.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<table role="grid" aria-labelledby="{{uniqueId}}-title" aria-activedescendant="{{activeDateId}}">
<thead>
<tr>
<th><button type="button" class="btn btn-default btn-sm pull-left" ng-click="move(-1)" tabindex="-1"><i class="glyphicon glyphicon-chevron-left"></i></button></th>
<th><button id="{{uniqueId}}-title" role="heading" aria-live="assertive" aria-atomic="true" type="button" class="btn btn-default btn-sm" ng-click="toggleMode()" tabindex="-1" style="width:100%;"><strong>{{title}}</strong></button></th>
<th><button type="button" class="btn btn-default btn-sm pull-right" ng-click="move(1)" tabindex="-1"><i class="glyphicon glyphicon-chevron-right"></i></button></th>
</tr>
</thead>
<tbody>
<tr ng-repeat="row in rows track by $index">
<td ng-repeat="dt in row track by dt.date" class="text-center" role="gridcell" id="{{dt.uid}}" aria-disabled="{{!!dt.disabled}}">
<button type="button" style="width:100%;" class="btn btn-default" ng-class="{'btn-info': dt.selected, active: isActive(dt)}" ng-click="select(dt.date)" ng-disabled="dt.disabled" tabindex="-1"><span ng-class="{'text-info': dt.current}">{{dt.label}}</span></button>
</td>
</tr>
</tbody>
</table>
10 changes: 10 additions & 0 deletions ui-bootstrap/template/datepicker/popup.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<ul class="dropdown-menu" ng-style="{display: (isOpen && 'block') || 'none', top: position.top+'px', left: position.left+'px'}" ng-keydown="keydown($event)">
<li ng-transclude></li>
<li ng-if="showButtonBar" style="padding:10px 9px 2px">
<span class="btn-group pull-left">
<button type="button" class="btn btn-sm btn-info" ng-click="select('today')">{{ getText('current') }}</button>
<button type="button" class="btn btn-sm btn-danger" ng-click="select(null)">{{ getText('clear') }}</button>
</span>
<button type="button" class="btn btn-sm btn-success pull-right" ng-click="close()">{{ getText('close') }}</button>
</li>
</ul>
16 changes: 16 additions & 0 deletions ui-bootstrap/template/datepicker/year.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<table role="grid" aria-labelledby="{{uniqueId}}-title" aria-activedescendant="{{activeDateId}}">
<thead>
<tr>
<th><button type="button" class="btn btn-default btn-sm pull-left" ng-click="move(-1)" tabindex="-1"><i class="glyphicon glyphicon-chevron-left"></i></button></th>
<th colspan="3"><button id="{{uniqueId}}-title" role="heading" aria-live="assertive" aria-atomic="true" type="button" class="btn btn-default btn-sm" ng-click="toggleMode()" tabindex="-1" style="width:100%;"><strong>{{title}}</strong></button></th>
<th><button type="button" class="btn btn-default btn-sm pull-right" ng-click="move(1)" tabindex="-1"><i class="glyphicon glyphicon-chevron-right"></i></button></th>
</tr>
</thead>
<tbody>
<tr ng-repeat="row in rows track by $index">
<td ng-repeat="dt in row track by dt.date" class="text-center" role="gridcell" id="{{dt.uid}}" aria-disabled="{{!!dt.disabled}}">
<button type="button" style="width:100%;" class="btn btn-default" ng-class="{'btn-info': dt.selected, active: isActive(dt)}" ng-click="select(dt.date)" ng-disabled="dt.disabled" tabindex="-1"><span ng-class="{'text-info': dt.current}">{{dt.label}}</span></button>
</td>
</tr>
</tbody>
</table>