iOS Calendar Jtcalendar Third party use

Source: Internet
Author: User

About Jtcalendar is a good writing calendar for third parties, we can have http://www.code4app.com/ios/from the calendar/5225b2f96803fa484f000000 URL to the instance code

Let me introduce some code to control the calendar

Events that control the color of a selected date by clicking on the calendar date

[_calendarmanager Setdate:_todaydate];

Events that control dot markers

if ([self haveEventForDay:dayView.date]) {

DayView.dotView.hidden = NO;

}

else{

DayView.dotView.hidden = YES;

}

}

-(BOOL) Haveeventforday: (NSDate *) Date

{

NSString *key = [[self dateformatter] stringfromdate:date];

if (_eventsbydate[key] && [_eventsbydate[key] count] > 0) {

return YES;

}

return NO;

}

Skip current date jump next month

if (![ _calendarmanager.datehelper date:_calendarcontentview.date IsTheSameMonthThan:dayView.date]) {

if ([_calendarcontentview.date compare:dayView.date] = = nsorderedascending) {

[_calendarcontentview loadnextpagewithanimation];

}

else{

[_calendarcontentview loadpreviouspagewithanimation];

}

}

Control click Color and current date color

-(void) Calendar: (Jtcalendarmanager *) calendar Preparedayview: (Jtcalendardayview *) Dayview

Control Click events

-(void) Calendar: (Jtcalendarmanager *) calendar Didtouchdayview: (Jtcalendardayview *) dayview{

Date Turn string

NSDateFormatter *dateformatter = [[NSDateFormatter alloc]init];

[Dateformatter setdateformat:@ "Yyyy-mm-dd"];

NSString *datestr = [Dateformatter stringFromDate:dayView.date];

iOS Calendar Jtcalendar Third party use

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.