I'm writing some code that is in the salesforce apex language that is a derivative of the Java language, which is why I'm posting in this zone.
I'm trying to compare two strings. The strngs are time intervals.
So, I'm looping over the time interval strings and I want to compare against another time interval string to see if the time is less or greater.
I was trying the following (see code below), but it doesn't work.
So, if my time slot value is "10:15 AM" and my start time value is 10:00 AM and my end time value is 11:30 AM
I would want to enter my branch of code because time slot value is greater than the start time and less than the end time, but It is not working correctly?
How can I achieve this?
Thanks for any help.
if (s.Time_Slot__c.CompareTo(ev.Screening_Close_Start_Time__c) > 0 && s.Time_Slot__c.CompareTo(ev.Screening_Close_End_Time__c) < 0)