Skip to content

Incorrect calculation in "RemindMeLater" code #134

@jeromeDefReputation

Description

@jeromeDefReputation
// If the user wanted to be reminded later, has enough time passed?
        let timeIntervalOfReminder = userDefaultsObject?.doubleForKey(keyForArmchairKeyType(ArmchairKey.ReminderRequestDate))
        if let timeInterval = timeIntervalOfReminder {
            let reminderRequestDate = Date(timeIntervalSince1970: timeInterval)
            let timeSinceReminderRequest = Date().timeIntervalSince(reminderRequestDate)
            let timeUntilReminder: TimeInterval = 60 * 60 * 24 * Double(daysBeforeReminding)
            if timeSinceReminderRequest < timeUntilReminder {
                return false
            }
        } else {
            return false
        }

If the amount of time since the current timestamp and the request timestamp is greater than 0, return true if by 'true' is we can show prompt.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions