Skip to content

Commit

Permalink
add Date() function
Browse files Browse the repository at this point in the history
  • Loading branch information
berenjian committed Dec 22, 2015
1 parent 57c1e07 commit 523186f
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 3 deletions.
4 changes: 4 additions & 0 deletions ionic.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"name": "AbsenceChecker-",
"app_id": ""
}
5 changes: 5 additions & 0 deletions www/css/style.css
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
/* Empty. Add your own CSS if you like */

.user-entered .item-content{
background-color: lightgreen;

}
6 changes: 6 additions & 0 deletions www/js/controllers.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,11 @@ angular

.controller('UserListCtrl', function($scope, UserStrorage) {
$scope.userList = UserStrorage.getUserList();

$scope.enter = function (user){
var date = new Date();
user.TimeString = date.toLocaleTimeString();

}
})
;
2 changes: 1 addition & 1 deletion www/js/services.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ angular
userList = [
{
id: 0,
name: 'Ben Sparrow',
name: 'Ali Mihandoost',
lastText: 'You on your way?',
face: 'img/ben.png'
},
Expand Down
5 changes: 3 additions & 2 deletions www/templates/userlist.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<ion-view view-title="User List">
<ion-content>
<ion-list>
<ion-item class="item-remove-animate item-avatar item-icon-right" ng-repeat="user in userList" type="item-text-wrap">

<ion-item class="item-remove-animate item-avatar item-icon-right" ng-repeat="user in userList" type="item-text-wrap" ng-click="enter(user)" ng-class="{'user-entered': user.TimeString}">
<img ng-src="{{user.face}}" />
<h2 ng-bind="user.name"></h2>
<p></p>
<p ng-show="user.TimeString" ng-bind-template="Enter : {{user.TimeString}}"></p>
<i class="icon ion-chevron-right icon-accessory"></i>

<ion-option-button class="button-assertive">
Expand Down

0 comments on commit 523186f

Please sign in to comment.