var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope, $filter) {
// {{shop.MondayOpenTime}} to {{shop.MondayCloseTime}}
$scope.shop = [{
"name": "Monday",
"OpenTime": new Date("2019-03-25"),
"CloseTime": new Date("2020-03-25"),
"check": false
}, {
"name": "Tuesday",
"OpenTime": new Date(1585008000000),
"CloseTime": new Date(1585094400000),
"check": false
}];
// formats to use (in DOM):
// {{ date_expression | date : format : timezone}}
// or (in controller):
// $filter('date')(date, format, timezone)
});
table {
font-family: arial, sans-serif;
border-collapse: collapse;
width: 100%;
}
td,
th {
border: 1px solid #dddddd;
text-align: left;
padding: 8px;
}
tr:nth-child(even) {
background-color: #dddddd;
}
<!DOCTYPE html>
<html>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js"></script>
<body>
<div ng-app="myApp" ng-controller="myCtrl">
<table>
<tr>
<th>Name</th>
<th>Open time</th>
<th>Close time</th>
<th>Checkmark</th>
</tr>
<tr ng-repeat="item in shop">
<td>{{item.name}}</td>
<td>{{item.OpenTime | date : 'short'}}</td>
<td>{{item.CloseTime | date : 'short'}}</td>
<td><input type="checkbox" ng-model="item.check"></td>
</tr>
</table>
<pre>{{shop | json}}</pre>
</div>
</body>
</html>