How can I use local notifications with If statements/conditions?


#1

If I use this code:

let notification = {
id: day.dayCode,
title: ‘Hey!’,
text: ‘You just got notified :)’,
at: firstNotificationTime,
every: ‘week’
};
this.notifications.push(notification);

OK, now if I use for my variable firstNotificationTime If statement. I mean, if I use that statement like I want to get true or false, to check if two other strings is equal, so if they are equal then notification should appear with new date and time (variable mynewDate).

if(string1===string2){
firstNotificationTime = mynewDate;
}

So my question is: can I use “if” statement like this and will notification appear this way that I explained here?
If I understand all of this properly, local notification plugin should know if that two strings are equal so my app should automatically execute notification at custom time.

Please if anyone can help me, I will appreciate It. Thanks