{"id":31569155,"url":"https://github.com/3a4ot/datetoolsobjc","last_synced_at":"2025-10-30T20:49:40.265Z","repository":{"id":55671879,"uuid":"102537251","full_name":"3a4oT/DateToolsObjC","owner":"3a4oT","description":"Package for Objective-C DateTools library. Parse, validate, manipulate, and display dates, time and timezones","archived":false,"fork":false,"pushed_at":"2020-12-13T22:11:10.000Z","size":155,"stargazers_count":3,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-10-18T09:40:26.198Z","etag":null,"topics":["calendar","carthage","cast","date","datetools","ios","nsdate","objective-c","swift","timezone"],"latest_commit_sha":null,"homepage":"","language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/3a4oT.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-09-05T22:51:31.000Z","updated_at":"2025-01-19T11:28:38.000Z","dependencies_parsed_at":"2022-08-15T06:10:14.642Z","dependency_job_id":null,"html_url":"https://github.com/3a4oT/DateToolsObjC","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/3a4oT/DateToolsObjC","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/3a4oT%2FDateToolsObjC","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/3a4oT%2FDateToolsObjC/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/3a4oT%2FDateToolsObjC/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/3a4oT%2FDateToolsObjC/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/3a4oT","download_url":"https://codeload.github.com/3a4oT/DateToolsObjC/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/3a4oT%2FDateToolsObjC/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281881921,"owners_count":26577705,"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-10-30T02:00:06.501Z","response_time":61,"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":["calendar","carthage","cast","date","datetools","ios","nsdate","objective-c","swift","timezone"],"created_at":"2025-10-05T11:43:51.690Z","updated_at":"2025-10-30T20:49:40.258Z","avatar_url":"https://github.com/3a4oT.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n[![Build Status](https://travis-ci.org/3a4oT/DateToolsObjC.svg?branch=master)](https://travis-ci.org/3a4oT/DateToolsObjC) [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) [![Swift Package Manager compatible](https://img.shields.io/badge/Swift%20Package%20Manager%20-compatible-brightgreen)](https://swift.org/package-manager/)\n\nThank you, **[Matthew York](https://github.com/MatthewYork) and [community](https://github.com/3a4oT/DateToolsObjC/blob/master/CREDITS.md)** for awesome library. You can find  original [repo/docs here](https://github.com/MatthewYork/DateTools). This package was created because I need *Carthage* support and distinguish between Swift and Objective-C implementation. Swift ABI not stable (yet) and I do not want to spend time to recompile binaries every time new Swift version come. Objective-C API works perfectly fine.\n\n\nThis is hard fork of original repo. This means there is no guarantee that codebase will fully reflect original repo.\n\n* DateTools removes the boilerplate required to access date components, handles more nuanced date comparisons, and serves as the foundation for entirely new concepts like Time Periods and their collections.\n\n### How to check if two date ranges overlaps in Objective-C? With *DateTools* it's really easy.\n```objective-C\n// Just example.\nDTTimePeriod *periodA = [[DTTimePeriod alloc] initWithStartDate:request.startDate endDate:request.endDate];\nDTTimePeriod *periodB = [[DTTimePeriod alloc] initWithStartDate:requestB.startDate endDate:requestB.endDate];\n//Magic here\nif ([periodA overlapsWith:periodB]) {\n    NSLog(@\"Is it cool?\");\n}\n```  \n\n## Use with Swift Package Manager\n\n```swift\n\n.package(url: \"https://github.com/3a4oT/DateToolsObjC\", .upToNextMajor(from: \"1.0.5\"))\n\n```\n\n## [How to use with Carthage](https://github.com/Carthage/Carthage#adding-frameworks-to-an-application):\n\n * Add to your *Cartfile*  ```github \"3a4oT/DateToolsObjC\"```\n * Run ```carthage build 3a4oT/DateToolsObjC```\n * Add ```DateToolsObjC.framework``` to your target\n * In your ```*.h/*.m``` just ```@import DateToolsObjC;```\n\n\n## Can I use it from Swift?\nWell, technically yes. But...=) it will work for **NSDate** and not for **Date** out the box. You will ask why? Shorty - *NSDate* and *Date* are two **different types** ([some more food](https://github.com/apple/swift-evolution/blob/master/proposals/0069-swift-mutability-for-foundation.md#new-value-types)). Don't be confused about [other thing you may hear](https://github.com/apple/swift-evolution/blob/master/proposals/0086-drop-foundation-ns.md) that's different. So far you have *3 option to go with*\n\n1. Checkout original repo and use Swift API.\n2. Cast Date to NSDate and back:\n      ```swift\n      import DateToolsObjC\n\n      let today: NSDate = Date() as NSDate\n      //usage in DateToolsAPI return NSDate cast back if you need.\n      let result: Date = today.timeAgo() as Date\n      ```\n3. My favorite - just make *Swift Extension* under needed `DateToolsObjC API` which will cast *NSDate* to *Date* for you.\n\n#### MIT License\n\nCopyright (c) 2017 Petro Rovenskyi\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F3a4ot%2Fdatetoolsobjc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F3a4ot%2Fdatetoolsobjc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F3a4ot%2Fdatetoolsobjc/lists"}