AppointmentReminders.Web.Domain.AppointmentsNotificationPolicy.NeedsToBeSent C# (CSharp) Method

NeedsToBeSent() public method

public NeedsToBeSent ( System.DateTime currentTime ) : bool
currentTime System.DateTime
return bool
        public bool NeedsToBeSent(DateTime currentTime)
        {
            var reminderLocalTime = GetAppointmentLocalTime()
                .AddMinutes(- Appointment.ReminderTime); // Notify our appointment attendee
                                                         // X minutes before the appointment time

            return currentTime.ToString("MM/dd/yyyy HH:mm") == reminderLocalTime.ToString("MM/dd/yyyy HH:mm");
        }