{"id":2528,"url":"https://github.com/maximbilan/Calendar-iOS","last_synced_at":"2025-08-03T00:31:54.988Z","repository":{"id":12887591,"uuid":"15564260","full_name":"maximbilan/Calendar-iOS","owner":"maximbilan","description":"Calendar View","archived":false,"fork":false,"pushed_at":"2018-09-19T12:56:16.000Z","size":1989,"stargazers_count":162,"open_issues_count":3,"forks_count":22,"subscribers_count":10,"default_branch":"master","last_synced_at":"2024-05-21T06:11:02.204Z","etag":null,"topics":["calendar","calendar-component","calendar-view","calendarview","ios","ios-calendar","objective-c","ui","ui-components","uikit"],"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/maximbilan.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}},"created_at":"2014-01-01T13:02:21.000Z","updated_at":"2024-04-25T03:20:39.000Z","dependencies_parsed_at":"2022-08-27T10:40:34.934Z","dependency_job_id":null,"html_url":"https://github.com/maximbilan/Calendar-iOS","commit_stats":null,"previous_names":["maximbilan/ios_calendar"],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maximbilan%2FCalendar-iOS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maximbilan%2FCalendar-iOS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maximbilan%2FCalendar-iOS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maximbilan%2FCalendar-iOS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maximbilan","download_url":"https://codeload.github.com/maximbilan/Calendar-iOS/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228510720,"owners_count":17931757,"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","calendar-component","calendar-view","calendarview","ios","ios-calendar","objective-c","ui","ui-components","uikit"],"created_at":"2024-01-05T20:16:15.994Z","updated_at":"2024-12-06T18:30:33.118Z","avatar_url":"https://github.com/maximbilan.png","language":"Objective-C","funding_links":[],"categories":["UI"],"sub_categories":["Calendar"],"readme":"iOS Calendar\n============\n\n[![Version](https://img.shields.io/cocoapods/v/Calendar-iOS.svg?style=flat)](http://cocoadocs.org/docsets/Calendar-iOS)\n[![License](https://img.shields.io/cocoapods/l/Calendar-iOS.svg?style=flat)](http://cocoadocs.org/docsets/Calendar-iOS)\n[![Platform](https://img.shields.io/cocoapods/p/Calendar-iOS.svg?style=flat)](http://cocoadocs.org/docsets/Calendar-iOS)\n[![CocoaPods](https://img.shields.io/cocoapods/dt/Calendar-iOS.svg)](https://cocoapods.org/pods/Calendar-iOS)\n[![CocoaPods](https://img.shields.io/cocoapods/dm/Calendar-iOS.svg)](https://cocoapods.org/pods/Calendar-iOS)\n\nIt's lightweight and simple control with supporting \u003ci\u003eLocale\u003c/i\u003e and \u003ci\u003eCalendarIdentifier\u003c/i\u003e. There're samples for iPhone and iPad, and also with using a popover.\u003cbr\u003e\n![alt tag](https://raw.github.com/maximbilan/ios_calendar/master/img/img4.png)\n![alt tag](http://uupload.ir/files/71zl_img10.png)\n\u003cbr\u003e\nUsing popover:\n\u003cbr\u003e\u003cbr\u003e\n![alt tag](https://raw.github.com/maximbilan/ios_calendar/master/img/img5.png)\n\u003cbr\u003e\n## How to install\n\u003cb\u003eManual:\u003c/b\u003e\u003cbr\u003e\u003cbr\u003e\nAdd to your project the next source files: \u003cbr\u003e\n\u003cpre\u003e\nCalendarView.h\nCalendarView.m\nNSDate+CalendarView.h\nNSDate+CalendarView.m\nNSString+CalendarView.h\nNSString+CalendarView.m\n\u003c/pre\u003e\n\u003cb\u003eCocoaPods:\u003c/b\u003e\n\u003cpre\u003e\npod 'Calendar-iOS'\n\u003c/pre\u003e\n## How to use\nYou can add view in the Interface Builder and set class to \u003ci\u003eCalendarView\u003c/i\u003e or create in the code: \u003cbr\u003e\n\u003cpre\u003e\nCalendarView *calendarView = [[CalendarView alloc] initWithPosition:10.0 y:10.0];\n[self.view addSubview:calendarView];\n\u003c/pre\u003e\nSo, it's all, you should see the calendar view. \u003cbr\u003e\nThis component was created for iPhone/iPod resolution, for iPad its works, but it looks really small, if it's necessary, you can play with static constants in the \u003ci\u003eCalendarView.m\u003c/i\u003e, and maybe in future, will be done the scaling.\n\u003cbr\u003e\nThis calendar has some modes: \u003cbr\u003e\n\u003cpre\u003e\ntypedef NS_ENUM(NSInteger, CalendarMode)\n{\n    CalendarModeDefault,\n    CalendarModeMonthsAndYears,\n    CalendarModeYears\n};\n\u003c/pre\u003e\n\u003ci\u003eDefault\u003c/i\u003e - there're days, months and years, the user can change months with help swipe gesture or pinch gesture for transitions in the calendar \u003cbr\u003e\n\u003ci\u003eMonthsAndYears\u003c/i\u003e - available months and years \u003cbr\u003e\n\u003ci\u003eYears\u003c/i\u003e - only years \u003cbr\u003e\n\u003cbr\u003e\nThere are external methods to mimic the swiping behavior in case a different UI is desired. However, these events will be logged with a different event type than swiping. \u003cbr\u003e\n\u003cbr\u003e\nThere are also some options for display: \u003cbr\u003e\n\u003cpre\u003e\n// Whether the currently selected date should be marked\n@property (nonatomic, assign) BOOL shouldMarkSelectedDate;\n// Whether today's date should be marked\n@property (nonatomic, assign) BOOL shouldMarkToday;\n// Whether the month and year headers should be shown\n@property (nonatomic, assign) BOOL shouldShowHeaders;\n// Preferred weekday start\n- (void)setPreferredWeekStartIndex:(NSInteger)index;\n\u003c/pre\u003e\n\u003ci\u003eDate Markers\u003c/i\u003e - Default behavior is to mark the currently selected date and not today, but this can be customized to suit your needs. If both are marked and coincide on the same day, it will show up with the current selection color, not today's color.\u003cbr\u003e\n\u003ci\u003eHeaders\u003c/i\u003e - Default behavior is to show the headers, but they can also be hidden, in which case everything else will get shifted up accordingly (after a set needs display call). \u003cbr\u003e\n\u003ci\u003ePreferred Week Start\u003c/i\u003e - Default behavior behavior is Monday. Determines what day of the week is in the leftmost column.\n## How to use Locale and CalendarIdentifier\nIt's very simple and useful to create calendar base on your locale and of course your country. \n\u003cpre\u003e\nNSLocale *persianLocale = [NSLocale alloc]initWithLocaleIdentifier:@\"fa-IR\"];\n[self.calendarView setLocale:persianLocale];\n\u003c/pre\u003e\nAnd for using \u003ci\u003eCalendarIdentifier\u003c/i\u003e use this property :\n\u003cpre\u003e\n[self.calendarView setCalendarIdentifier:NSCalendarIdentifierPersian];\n\u003c/pre\u003e\nif you set \u003ci\u003euseVeryShortWeekdaySymbols property\u003c/i\u003e to `YES`, use days of week name very short\n\n\u003cpre\u003e\nself.calendarView.useVeryShortWeekdaySymbols = YES;\n\u003c/pre\u003e\n\n## How to select range of date\n![English range selection](https://raw.githubusercontent.com/Husseinhj/ios_calendar/feat/range_selection/img/@2x-English%20selection.png)\n![Persian range selection](https://raw.githubusercontent.com/Husseinhj/ios_calendar/feat/range_selection/img/@2x-Persian%20selection.png)\nIf user Long press on items, can select date and for select end of range, Long press on end date.\nFor get range date use `didSelectRangeForStartDate:endDate` delegate method like this :\n\u003cpre\u003e\n- (void) didSelectRangeForStartDate:(NSDate *)startDate andEndDate:(NSDate *)endDate{ \n    NSLog(@\"%s: start date :%@ \\n end date : %@\",__PRETTY_FUNCTION__,startDate,endDate); \n} \n\u003c/pre\u003e\n\n## How to handle changing date event\nFor this you should use \u003ci\u003eCalendarViewDelegate\u003c/i\u003e protocol:\n\u003cpre\u003e\n@interface ViewController : UIViewController \u0026#60;CalendarViewDelegate\u0026#62;\n\n@end\n\u003c/pre\u003e\nAnd setup delegate: \u003cbr\u003e\n\u003cpre\u003e\nself.calendarView.calendarDelegate = self;\n\u003c/pre\u003e\n\nAfter that you should implement required method \u003ci\u003edidChangeCalendarDate\u003c/i\u003e:\n\u003cpre\u003e\n- (void)didChangeCalendarDate:(NSDate *)date\n{\n    NSLog(@\"didChangeCalendarDate:%@\", date);\n}\n\u003c/pre\u003e\n\nFor more details there're optional methods for other things: \u003cbr\u003e\n\u003cpre\u003e\n@optional\n- (void)didChangeCalendarDate:(NSDate *)date withType:(NSInteger)type withEvent:(NSInteger)event;\n- (void)didDoubleTapCalendar:(NSDate *)date withType:(NSInteger)type;\n\u003c/pre\u003e\n## How to customize colors\nFor customization of colors you can use the following properties:\n\u003cpre\u003e\n// Main color of numbers\n@property (nonatomic, strong) UIColor *fontColor;\n// Color of the headers (Year and month)\n@property (nonatomic, strong) UIColor *fontHeaderColor;\n// Color of selected numbers\n@property (nonatomic, strong) UIColor *fontSelectedColor;\n// Color of selection\n@property (nonatomic, strong) UIColor *selectionColor;\n// Color of today\n@property (nonatomic, strong) UIColor *todayColor;\n\u003c/pre\u003e\nFor example:\n\u003cpre\u003e\nself.calendarView.selectionColor = [UIColor colorWithRed:0.203 green:0.666 blue:0.862 alpha:1.000];\nself.calendarView.fontHeaderColor = [UIColor colorWithRed:0.203 green:0.666 blue:0.862 alpha:1.000];\n\u003c/pre\u003e\nAnd you can see the result:\u003cbr\u003e\n![alt tag](https://raw.github.com/maximbilan/ios_calendar/master/img/img6.png)\u003cbr\u003e\nIt's free for using, feel free. And I hope it will be helpful.\u003cbr\u003e\n\n## License\n\niOS Calendar is available under the MIT license. See the LICENSE file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaximbilan%2FCalendar-iOS","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaximbilan%2FCalendar-iOS","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaximbilan%2FCalendar-iOS/lists"}