Angular: Empty Fiddle
http://angularjs.org/
HTML
<script src="http://code.angularjs.org/1.2.9/angular.js"></script>
<div ng-controller="MyCtrl">
<div ng-repeat="booking in testBookings | orderBy:'sortDate'">
<span>{{booking.bookingDateTime | date:'dd-MMM-yy HH:mm'}}</span>
</div>
</div>
JavaScript
var myApp = angular.module('myApp',[]);
//myApp.directive('myDirective', function() {});
//myApp.factory('myService', function() {});
function MyCtrl($scope) {
var getDateTime = function(date, time) {
var hours = time.substring(0, 2);
var minutes = time.substring(3, 5);
var day = date.substring(0, 2);
var month = date.substring(3,5);
var year = new Date().getFullYear();
return new Date(year, month, day, hours, minutes, 0, 0).toJSON();
};
$scope.testBookings =
[
{
bookingDateTime: getDateTime("01/00", "09:00"),
sortDate: "2014-01-01T09:00:00.000Z"
},
{
bookingDateTime: getDateTime("01/00", "09:20"),
sortDate: "2014-01-01T09:20:00.000Z"
},
{
bookingDateTime: getDateTime("01/00", "09:15"),
sortDate: "2014-01-01T09:15:00.000Z"
},
{
bookingDateTime: getDateTime("01/00", "09:20"),
sortDate: "2014-01-01T09:20:00.000Z"
},
{
bookingDateTime: getDateTime("02/00", "09:00"),
sortDate: "2014-01-02T09:00:00.000Z"
},
{
bookingDateTime: getDateTime("01/00", "17:00"),
sortDate: "2014-01-01T17:00:00.000Z"
}
];
}