I have successfully implemented the functionality to display the system time and date. Additionally, I have set up textboxes for users to input the time they want to set as their first alarm.
My current goal is to trigger a particular action once the system time reaches the set 1st alarm time. At the moment, I am merely using a text label for this purpose but it is not the main focus.
The HTML section includes:
<input type="text" placeholder="Enter Time Start Here" ng-model="firstAlert"/>{{firstAlert}}
<button type="button" ng-click="Check()">Submit</button>
In the JavaScript part:
$scope.Check=function(){
if(Date.now() == $scope.firstAlert)
{
$scope.info = "They're the same!";
}
}
I am looking for guidance on the best approach to achieve this functionality. My initial idea does not seem to be efficient. While searching for examples, I primarily found timer implementations which are not what I require. Ideally, I would like the user to enter the date and time in a specific format (mm/dd/yy hh:mm PM or AM) or in a shorter date format.