Currently, I am in the process of developing a web application using AngularJS and Rails. One of the features involves creating bookings through a bookings function. In the dashboard section of the app, I aim to have two tabs - one for Current Bookings and another for Previous Bookings. The booking model contains a function_date attribute which is retrieved from an API and stored in a $scope.bookings array.
I would like to know how I can compare dates by running an if statement to check if function_data is greater than today's date. If it is, I want to store it in the CurrentBookings array; otherwise, it should be stored in the PreviousBookings array.
I hope this explanation is clear enough.
P.S. I am still learning how to code on my own, so please bear with me if this question seems simple to some.