Skip to content

Instantly share code, notes, and snippets.

View sethi-ishmeet's full-sized avatar

Ishmeet Singh Sethi sethi-ishmeet

View GitHub Profile
@sethi-ishmeet
sethi-ishmeet / RepeatRuleCalculator.swift
Last active August 6, 2020 15:28
Swift repeat rule date calculator
// based on: http://stackoverflow.com/a/31598663/234609
// Original gist: https://gist.github.com/jim-rhoades/ea0c5b241ec77a37f86b
// (paste this into an Xcode playground for testing)
import UIKit
let currentCalendar = Calendar.current
var dateComponents = DateComponents()
dateComponents.day = 31
dateComponents.month = 1