{"id":2529,"url":"https://github.com/WenchaoD/FSCalendar","last_synced_at":"2025-08-03T00:31:52.709Z","repository":{"id":27347259,"uuid":"30822337","full_name":"WenchaoD/FSCalendar","owner":"WenchaoD","description":"A fully customizable iOS calendar library, compatible with Objective-C and Swift","archived":false,"fork":false,"pushed_at":"2024-08-10T13:44:15.000Z","size":2513,"stargazers_count":10602,"open_issues_count":497,"forks_count":1938,"subscribers_count":212,"default_branch":"master","last_synced_at":"2024-11-09T04:03:31.970Z","etag":null,"topics":["calendar","carthage","cocoapods","ios","library","objective-c","swift"],"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/WenchaoD.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2015-02-15T08:43:09.000Z","updated_at":"2024-11-05T13:59:23.000Z","dependencies_parsed_at":"2022-07-12T16:09:04.606Z","dependency_job_id":"12c83811-d7c9-4635-aa3d-460bc85de272","html_url":"https://github.com/WenchaoD/FSCalendar","commit_stats":{"total_commits":736,"total_committers":37,"mean_commits":19.89189189189189,"dds":"0.32065217391304346","last_synced_commit":"2a1bdab38bd4c90caaa4b593e0608c05f4173160"},"previous_names":["wenchaoios/fscalendar"],"tags_count":50,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WenchaoD%2FFSCalendar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WenchaoD%2FFSCalendar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WenchaoD%2FFSCalendar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WenchaoD%2FFSCalendar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WenchaoD","download_url":"https://codeload.github.com/WenchaoD/FSCalendar/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227212051,"owners_count":17748808,"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","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","cocoapods","ios","library","objective-c","swift"],"created_at":"2024-01-05T20:16:16.026Z","updated_at":"2024-12-06T18:30:31.333Z","avatar_url":"https://github.com/WenchaoD.png","language":"Objective-C","funding_links":["https://www.paypal.me/WenchaoD"],"categories":["UI","Objective-C","Objective-C  Stars 1000以内排名整理","UI Components","OOM-Leaks-Crash"],"sub_categories":["Calendar","Other free courses","Picker"],"readme":"\n![logo](https://cloud.githubusercontent.com/assets/5186464/16540124/efc51f72-408b-11e6-934a-4e750b8b55bb.png)\n\u003cbr/\u003e\u003cbr/\u003e\n[![Apps Using](https://img.shields.io/badge/Apps%20Using-%3E%2010,000-00BFFF.svg?style=plastic)](https://cocoapods.org/pods/FSCalendar)\n[![Total Downloads](https://img.shields.io/badge/Total%20Downloads-%3E%20500,000-00BFFF.svg?style=plastic)](https://cocoapods.org/pods/FSCalendar)\n\u003cbr\u003e\n[![Travis](https://travis-ci.org/WenchaoD/FSCalendar.svg?branch=master)](https://travis-ci.org/WenchaoD/FSCalendar)\n[![Version](https://img.shields.io/cocoapods/v/FSCalendar.svg?style=flat)](http://cocoadocs.org/docsets/FSCalendar)\n[![Platform](https://img.shields.io/badge/platform-iOS%207%2B-blue.svg?style=flat)](http://cocoadocs.org/docsets/FSCalendar)\n[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)\n[![SwiftPM](https://img.shields.io/badge/SPM-supported-DE5C43.svg?style=flat)](https://swift.org/package-manager/)\n\u003cbr\u003e\n[![Languages](https://img.shields.io/badge/language-objc%20|%20swift-FF69B4.svg?style=plastic)](#)\n\n# Table of contents\n* [Screenshots](#screenshots)\n* [Installation](#installation)\n* [Pre-knowledge](#pre-knowledge)\n* [Support](#support)\n* [Contact](#contact)\n\n## \u003ca id=\"screenshots\"\u003e\u003c/a\u003eScreenshots \n\n### iPhone\n![fscalendar](https://cloud.githubusercontent.com/assets/5186464/10262249/4fabae40-69f2-11e5-97ab-afbacd0a3da2.jpg)\n\n### iPad\n![fscalendar-ipad](https://cloud.githubusercontent.com/assets/5186464/10927681/d2448cb6-82dc-11e5-9d11-f664a06698a7.jpg)\n\n### Safe Orientation\n![fscalendar-scope-orientation-autolayout](https://cloud.githubusercontent.com/assets/5186464/20325758/ea125e1e-abc0-11e6-9e29-491acbcb0d07.gif)\n\n### Today Extension\n|    iOS8/9    |    iOS10    |\n|--------------|-------------|\n|![today1](https://cloud.githubusercontent.com/assets/5186464/20288375/ed3fba0e-ab0d-11e6-8b15-43d3dc656f22.gif)|![today2](https://cloud.githubusercontent.com/assets/5186464/20288378/f11e318c-ab0d-11e6-8d1d-9d89b563e9d7.gif)|\n\n### Interactive Scope Gesture\n| ![1](https://cloud.githubusercontent.com/assets/5186464/21559640/e92a9ccc-ce8a-11e6-8c60-e52204f33249.gif) |\n| ---- |\n\n### DIY support\n|  ![1](https://cloud.githubusercontent.com/assets/5186464/20026983/22354a0e-a342-11e6-8ae6-0614ea7f35ae.gif)    |\n| -------------  |\n\u003e To customize your own cell, view DIY Example in `Example-Swift` or `Example-Objc`\n\n\n### Swipe-To-Choose\n\n|Single-Selection\u003cbr/\u003eSwipe-To-Choose|Multiple-Selection\u003cbr/\u003eSwipe-To-Choose|DIY\u003cbr/\u003eSwipe-To-Choose|\n|----------|--------|--------|\n|![1](https://cloud.githubusercontent.com/assets/5186464/20257768/cb1905d4-aa86-11e6-9ef7-af76f9caa024.gif)|![2](https://cloud.githubusercontent.com/assets/5186464/20257826/254070ec-aa87-11e6-81b1-1815453fd464.gif)|![3](https://cloud.githubusercontent.com/assets/5186464/20257836/2ffa3252-aa87-11e6-8ff9-3b40f5b2307b.gif)|\n\n## Achievement of Users \u003ca id=\"achievement\"\u003e\u003c/a\u003e\n\n|  ![1](https://cloud.githubusercontent.com/assets/5186464/21747193/3111e4ee-d59a-11e6-8e4d-ca695b53e421.png)    |  ![2](https://cloud.githubusercontent.com/assets/5186464/21747393/42a753fa-d5a0-11e6-9cb2-de7cc642e69e.png)  |  ![3](https://cloud.githubusercontent.com/assets/5186464/21897255/ff78fcdc-d923-11e6-9d59-62119bc4343f.png)  |  ![4](https://cloud.githubusercontent.com/assets/5186464/21747192/3111cacc-d59a-11e6-8626-44cd75ebd794.png)  |\n| ------------- | ------------- | ------------- | ------------- |\n\n#### [***More Achievements***](https://github.com/WenchaoD/FSCalendar/wiki/) are available in [***FSCalendar Gallery***](https://github.com/WenchaoD/FSCalendar/wiki/)  \n\n# \u003ca id=\"installation\"\u003e\u003c/a\u003eInstallation\n\n## CocoaPods:\n\n* For iOS8+: 👍\n\n```ruby\nuse_frameworks!\ntarget '\u003cYour Target Name\u003e' do\n    pod 'FSCalendar'\nend\n```\n\n* For iOS7+:\n\n```ruby\ntarget '\u003cYour Target Name\u003e' do\n\tpod 'FSCalendar'\nend\n```\n\n\u003e [NSCalendarExtension](https://github.com/WenchaoD/NSCalendarExtension) is required to get iOS7 compatibility.\n\n## Carthage: \n* For iOS8+\n\n```ruby\ngithub \"WenchaoD/FSCalendar\"\n```\n\n## SPM:\n\nAdd dependency:\n```swift\n.package(url: \"https://github.com/WenchaoD/FSCalendar.git\", from: \"2.8.4\")\n```\n\n## Manually:\n* Drag all files under `FSCalendar` folder into your project. 👍\n\n\u003e Alternatively to give it a test run, simply press `command+u` in `Example-Objc` or `Example-Swift` and launch the ***UITest Target***. \u003cbr\u003e\n\u003e Only the methods marked \"👍\" support IBInspectable / IBDesignable feature. [Have fun with Interface builder](#roll_with_interface_builder)\n\n\n# Setup\n\n## Use Interface Builder\n\n1、 Drag an UIView object to ViewController Scene\n2、 Change the `Custom Class` to `FSCalendar`\u003cbr/\u003e\n3、 Link `dataSource` and `delegate` to the ViewController \u003cbr/\u003e\n\n![fscalendar-ib](https://cloud.githubusercontent.com/assets/5186464/9488580/a360297e-4c0d-11e5-8548-ee9274e7c4af.jpg)\n\n4、 Finally, implement `FSCalendarDataSource` and `FSCalendarDelegate` in your `ViewController`\n\n## Or use code\n\n```objc\n@property (weak , nonatomic) FSCalendar *calendar;\n```\n```objc\n// In loadView(Recommended) or viewDidLoad\nFSCalendar *calendar = [[FSCalendar alloc] initWithFrame:CGRectMake(0, 0, 320, 300)];\ncalendar.dataSource = self;\ncalendar.delegate = self;\n[self.view addSubview:calendar];\nself.calendar = calendar;\n```\n\u003cbr/\u003e\n\n## Or swift\n\n* To use `FSCalendar` in swift, you need to [Create Bridge Header](https://developer.apple.com/library/ios/documentation/Swift/Conceptual/BuildingCocoaApps/MixandMatch.html) first.\n\n\n```swift\nfileprivate weak var calendar: FSCalendar!\n```\n```swift\n// In loadView or viewDidLoad\nlet calendar = FSCalendar(frame: CGRect(x: 0, y: 0, width: 320, height: 300))\ncalendar.dataSource = self\ncalendar.delegate = self\nview.addSubview(calendar)\nself.calendar = calendar\n```\n\n\u003e To use **FSCalendar** in Swift3, see `Example-Swift` for details.\n\n\n## \u003ca id='adjusts_frame_dynamicly' /\u003e\u003c/a\u003eWarning \n`FSCalendar` ***doesn't*** update frame by itself, Please implement\n\n* For ***AutoLayout***\n\n```objc\n- (void)calendar:(FSCalendar *)calendar boundingRectWillChange:(CGRect)bounds animated:(BOOL)animated\n{\n    self.calendarHeightConstraint.constant = CGRectGetHeight(bounds);\n    // Do other updates here\n    [self.view layoutIfNeeded];\n}\n```\n\n* For ***Manual Layout***\n\n```objc\n- (void)calendar:(FSCalendar *)calendar boundingRectWillChange:(CGRect)bounds animated:(BOOL)animated\n{\n    calendar.frame = (CGRect){calendar.frame.origin,bounds.size};\n    // Do other updates here\n}\n```\n\n* If you are using ***Masonry***\n\n```objc\n- (void)calendar:(FSCalendar *)calendar boundingRectWillChange:(CGRect)bounds animated:(BOOL)animated\n{\n    [calendar mas_updateConstraints:^(MASConstraintMaker *make) {\n        make.height.equalTo(@(bounds.size.height));\n        // Do other updates\n    }];\n    [self.view layoutIfNeeded];\n}\n```\n\n* If you are using ***SnapKit***\n\n```swift\nfunc calendar(_ calendar: FSCalendar, boundingRectWillChange bounds: CGRect, animated: Bool) {\n    calendar.snp.updateConstraints { (make) in\n        make.height.equalTo(bounds.height)\n        // Do other updates\n    }\n    self.view.layoutIfNeeded()\n}\n```\n\n### \u003ca id=\"roll_with_interface_builder\"\u003e\u003c/a\u003e Roll with Interface Builder\n![fscalendar - ibdesignable](https://cloud.githubusercontent.com/assets/5186464/9301716/2e76a2ca-4503-11e5-8450-1fa7aa93e9fd.gif)\n\n# \u003ca id=\"pre-knowledge\"\u003e\u003c/a\u003ePre-knowledge\n\n\u003e In `Swift3`, `NSDate` and `NSDateFormatter` have been renamed to ***Date*** and ***DateFormatter*** , see `Example-Swift` for details.\n\n## How to create NSDate object\n\n* By **NSCalendar**.\n\n```objc\nself.gregorian = [NSCalendar calendarWithIdentifier:NSCalendarIdentifierGregorian];\n```\n\nThen:\n\n```objc\nNSDate *date = [gregorian dateWithEra:1 year:2016 month:9 day:10 hour:0 minute:0 second:0 nanosecond:0];\n// 2016-09-10 00:00:00\n```\n\n\n* Or by **NSDateFormatter**\n\n```objc\nself.formatter = [[NSDateFormatter alloc] init];\nself.formatter.dateFormat = @\"yyyy-MM-dd\";\n```\n\nThen:\n\n```objc\nNSDate *date = [self.formatter dateFromString:@\"2016-09-10\"];\n```\n\n## How to print out NSDate object\n\n* Use **NSDateFormatter**\n\n```objc\nself.formatter = [[NSDateFormatter alloc] init];\nself.formatter.dateFormat = @\"yyyy/MM/dd\";\n```\n\n```objc\nNSString *string = [self.formatter stringFromDate:date];\nNSLog(@\"Date is %@\", string);\n```\n\n## How to manipulate NSDate with NSCalendar\n\n```objc\nself.gregorian = [NSCalendar calendarWithIdentifier:NSCalendarIdentifierGregorian];\n```\n* Get component of NSDate\n\n```objc\nNSInteger era = [self.gregorian component:NSCalendarUnitEra fromDate:date];\nNSInteger year = [self.gregorian component:NSCalendarUnitYear fromDate:date];\nNSInteger month = [self.gregorian component:NSCalendarUnitMonth fromDate:date];\nNSInteger day = [self.gregorian component:NSCalendarUnitDay fromDate:date];\nNSInteger hour = [self.gregorian component:NSCalendarUnitHour fromDate:date];\nNSInteger minute = [self.gregorian component:NSCalendarUnitMinute fromDate:date];\n...\n\n```\n\n* Get next **month**\n\n```objc\nNSDate *nextMonth = [self.gregorain dateByAddingUnit:NSCalendarUnitMonth value:1 toDate:date options:0];\n```\n\n* Get next **day**\n\n```objc\nNSDate *nextDay = [self.gregorain dateByAddingUnit:NSCalendarUnitDay value:1 toDate:date options:0];\n```\n\n* Is date in today/tomorrow/yesterday/weekend\n\n```objc\nBOOL isToday = [self.gregorian isDateInToday:date];\nBOOL isYesterday = [self.gregorian isDateInYesterday:date];\nBOOL isTomorrow = [self.gregorian isDateInTomorrow:date];\nBOOL isWeekend = [self.gregorian isDateInWeekend:date];\n```\n\n* Compare two dates\n\n```objc\n\nBOOL sameDay = [self.gregorian isDate:date1 inSameDayAsDate:date2];\n// Yes if the date1 and date2 are in same day\n\n\n[self.gregorian compareDate:date1 toDate:date2 toUnitGranularity:unit];\n// compare the era/year/month/day/hour/minute .etc ...\n// return NSOrderAscending/NSOrderSame/NSOrderDecending\n\nBOOL inSameUnit = [self.gregorian isDate:date1 equalToDate:date2 toUnitGranularity:unit];\n// if the given unit (era/year/month/day/hour/minute .etc) are the same\n\n\n```\n\n\n## \u003ca id=\"support\"\u003e\u003c/a\u003eSupport this repo\n* [**★Star**](#) this repo \n\u003cbr/\u003e\n* Support with \u0026nbsp; \u003ca href=\"https://www.paypal.me/WenchaoD\" target=\"_blank\"\u003e\u003cimg src=\"https://www.paypalobjects.com/webstatic/i/logo/rebrand/ppcom.svg\" width=\"100\" height=\"40\" style=\"margin-bottom:-15px;\"\u003e\u003c/a\u003e\n\u003cbr/\u003e\n* Support with \u003ca href=\"https://user-images.githubusercontent.com/5186464/45949944-46960480-c030-11e8-9e90-30b015698cf6.png\" target=\"_blank\"\u003e\u003cimg src=\"http://a1.mzstatic.com/us/r30/Purple49/v4/50/16/b3/5016b341-39c1-b47b-2994-d7e23823baed/icon175x175.png\" width=\"40\" height=\"40\" style=\"margin-bottom:-15px;-webkit-border-radius:10px;border:1px solid rgba(30, 154, 236, 1);\"\u003e\u003c/a\u003e or\n\u003ca href=\"https://cloud.githubusercontent.com/assets/5186464/15096872/b06f3a3a-153c-11e6-89f9-2e9c7b88ef42.png\" target=\"_blank\"\u003e\u003cimg src=\"http://a4.mzstatic.com/us/r30/Purple49/v4/23/31/14/233114f8-2e8d-7b63-8dc5-85d29893061e/icon175x175.jpeg\" height=\"40\" width=\"40\" style=\"margin-bottom:-15px; -webkit-border-radius: 10px;border:1px solid rgba(43, 177, 0, 1)\"\u003e\u003c/a\u003e\n\n\n\u003cbr/\u003e\n\n\n## \u003ca id='contact'/\u003e\u003c/a\u003e Contact\n* 微博： [**@WenchaoD**](http://weibo.com/WenchaoD)\n* Twitter：[**@WenchaoD**](https://twitter.com/WenchaoD)\n* \u003ca id='qq_group'/\u003e\u003c/a\u003eQQ支持群: \u003cbr\u003e\u003cbr\u003e\n\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\n![fscalendar](https://cloud.githubusercontent.com/assets/5186464/18407011/8e4b6e48-7738-11e6-9fad-0e23cc881516.JPG)\n\n\u003e If your made a beautiful calendar with this library in your app, please take a screen shot and [@me](https://twitter.com/WenchaoD) in twitter. Your help really means a lot to me! \u003cbr/\u003e\n\n\n# License\nFSCalendar is available under the MIT license. See the LICENSE file for more info.\n\n### [Documentation](http://cocoadocs.org/docsets/FSCalendar/) | [More Usage](https://github.com/WenchaoD/FSCalendar/blob/master/MOREUSAGE.md) | [简书](http://www.jianshu.com/notebooks/4276521/latest)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FWenchaoD%2FFSCalendar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FWenchaoD%2FFSCalendar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FWenchaoD%2FFSCalendar/lists"}