{"id":26272118,"url":"https://github.com/vrgsoftua/smdateutilities","last_synced_at":"2025-08-27T09:42:16.431Z","repository":{"id":144224700,"uuid":"187866286","full_name":"VRGsoftUA/SMDateUtilities","owner":"VRGsoftUA","description":"SMDateUtilities","archived":false,"fork":false,"pushed_at":"2019-05-21T15:37:48.000Z","size":9,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-14T07:17:49.613Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/VRGsoftUA.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-05-21T15:33:22.000Z","updated_at":"2019-08-23T03:35:16.000Z","dependencies_parsed_at":null,"dependency_job_id":"fc3c1cd3-8a8e-4c30-bcfa-e5674077ca8c","html_url":"https://github.com/VRGsoftUA/SMDateUtilities","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/VRGsoftUA/SMDateUtilities","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VRGsoftUA%2FSMDateUtilities","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VRGsoftUA%2FSMDateUtilities/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VRGsoftUA%2FSMDateUtilities/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VRGsoftUA%2FSMDateUtilities/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/VRGsoftUA","download_url":"https://codeload.github.com/VRGsoftUA/SMDateUtilities/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VRGsoftUA%2FSMDateUtilities/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272315607,"owners_count":24912609,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-27T02:00:09.397Z","response_time":76,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-14T07:16:56.688Z","updated_at":"2025-08-27T09:42:16.411Z","avatar_url":"https://github.com/VRGsoftUA.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SMDateUtilities\n```swift\n    //MARK: - Relative dates from the current date\n    \n    static var dateTomorrow: Date? { get }\n    static var dateYesterday: Date? { get }\n    \n    // for getting past date need to pass a negative value\n    static func nowByAddingYears(_ distance: Int) -\u003e Date?\n    static func nowByAddingMonths(_ distance: Int) -\u003e Date?\n    static func nowByAddingWeeks(_ distance: Int) -\u003e Date?\n    static func nowByAddingDays(_ distance: Int) -\u003e Date?\n    static func nowByAddingHours(_ distance: Int) -\u003e Date?\n    static func nowByAddingMinutes(_ distance: Int) -\u003e Date?\n    \n    static func dateFromNow(byAdding component: Calendar.Component, distance: Int) -\u003e Date?\n    \n    \n    //MARK: - Comparing dates\n    \n    func isEqualToDateIgnoringTime(_ date: Date) -\u003e Bool\n    var isToday: Bool { get }\n    var isTomorrow: Bool { get }\n    var isYesterday: Bool { get }\n    func isSameWeekAsDate(_ date: Date) -\u003e Bool\n    var isThisWeek: Bool { get }\n    var isNextWeek: Bool { get }\n    var isLastWeek: Bool { get }\n    func isSameYearAsDate(_ date: Date) -\u003e Bool\n    var isThisYear: Bool { get }\n    var isNextYear: Bool { get }\n    var isLastYear: Bool { get }\n    func isEarlierThanDate(_ date: Date) -\u003e Bool\n    func isLaterThanDate(_ date: Date) -\u003e Bool\n    func isSameYearAndMonthAsDate(_ date: Date) -\u003e Bool\n    \n    \n    //MARK: - Adjusting dates\n    \n    // for getting past date need to pass a negative value\n    func dateByAddingYears(_ distance: Int) -\u003e Date?\n    func dateByAddingMonths(_ distance: Int) -\u003e Date?\n    func dateByAddingWeeks(_ distance: Int) -\u003e Date?\n    func dateByAddingDays(_ distance: Int) -\u003e Date?\n    func dateByAddingHours(_ distance: Int) -\u003e Date?\n    func dateByAddingMinutes(_ distance: Int) -\u003e Date?\n    \n    func dateByAdding(component: Calendar.Component, distance: Int) -\u003e Date?\n    \n    var dateAtStartOfDay: Date { get }\n    \n    \n    //MARK: - Retrieving intervals\n    \n    // returning negative value in the case of past date\n    static func yearsToNowFrom(_ date: Date) -\u003e Int?\n    static func monthsToNowFrom(_ date: Date) -\u003e Int?\n    static func weeksToNowFrom(_ date: Date) -\u003e Int?\n    static func daysToNowFrom(_ date: Date) -\u003e Int?\n    static func hoursToNowFrom(_ date: Date) -\u003e Int?\n    static func minutesToNowFrom(_ date: Date) -\u003e Int?\n    \n    static func distanceFromNow(to date: Date, with component: Calendar.Component) -\u003e Int?\n    \n    // can returning negative value\n    func yearsTo(_ date: Date) -\u003e Int?\n    func monthsTo(_ date: Date) -\u003e Int?\n    func weeksTo(_ date: Date) -\u003e Int?\n    func daysTo(_ date: Date) -\u003e Int?\n    func hoursTo(_ date: Date) -\u003e Int?\n    func minutesTo(_ date: Date) -\u003e Int?\n    \n    func distanceTo(_ date: Date, with component: Calendar.Component) -\u003e Int?\n    \n    \n    //MARK: - Decomposing dates\n    \n    var nearestHour: Int { get }\n    var hour: Int { get }\n    var minute: Int { get }\n    var seconds: Int { get }\n    var day: Int { get }\n    var month: Int { get }\n    var weekOfYear: Int { get }\n    var weekOfMonth: Int { get }\n    var weekday: Int { get }\n    var weekdayOrdinal: Int { get } // e.g. 2nd Tuesday of the month == 2\n    var year: Int { get }\n    \n    \n    //MARK: - Converting\n    \n    static func convertString(_ dateStr: String, toDateWithFormat format: String, locale: Locale, timeZone: TimeZone) -\u003e Date?\n    static func convertDate(_ date: Date, toStringWithFormat format: String, locale: Locale, timeZone: TimeZone) -\u003e String\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvrgsoftua%2Fsmdateutilities","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvrgsoftua%2Fsmdateutilities","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvrgsoftua%2Fsmdateutilities/lists"}