If you need to handle timezones in your code, consider using moment-timezone library available at this link. You can adjust the date offset based on the timezone, such as adding +01:00 for France.
<script type="text/javascript" src="./moment-timezone-with-data.js"></script>
let offsetFrance = moment().tz("Europe/Paris").format('Z'); //+01:00
let eventWithOffset = moment().format('YYYY-MM-DDTHH:mm:ss[' + offsetFrance + ']');
let eventGmt = moment.tz(eventWithOffset, 'Europe/Paris').toISOString();
Alternatively, for AngularJS apps, you can use moment library by following these steps:
Link to angular-momentjs script
Include the script in your project:
<script type="text/javascript" src="./angular-momentjs.js"></script>
Inject the dependency in your app module and controller:
var app = angular.module('myApp', ['angular-momentjs']);
app.controller('myCtrl', function($scope, $moment) {
let now = $moment().toISOString();
let myEvent = $moment('02/05/2021 13:30', 'DD/MM/YYYY HH:mm').toISOString();
if($moment(now).isAfter(myEvent)) alert('Time to event');
else alert('ok');
});