GithubHelp home page GithubHelp logo

ckcalendar's People

Contributors

amosel avatar fastred avatar jaykz52 avatar jrnk avatar macfanatic avatar oziee avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ckcalendar's Issues

Expose -setDateBorderColor:(UIColor *)color;

I added - (void)setDateBorderColor:(UIColor *)color; to the header file so I can change the background color of the calendar container. Any reason this was not exposed already?

Crash in getDaysOfTheWeek

If the calendar's firstWeekday is zero (which it is on my system), getDaysOfTheWeek crashes with an array out-of-bounds error:

2012-08-17 11:10:01.604 orderoso-dev[60836:c07] Unhandled Exception: *** -[NSArray subarrayWithRange:]: range {4294967295, 8} extends beyond bounds [0 .. 6]

0   CoreFoundation                      0x015df03e __exceptionPreprocess + 206
1   libobjc.A.dylib                     0x012d4cd6 objc_exception_throw + 44
2   CoreFoundation                      0x0155c061 -[NSArray subarrayWithRange:] + 273
3   orderoso-dev                        0x0005ee9d -[CKCalendarView getDaysOfTheWeek] + 285
4   orderoso-dev                        0x00059fd8 -[CKCalendarView initWithFrame:] + 4040

I put in a local fix that seems to take care of it in -getDaysOfTheWeek

-    NSUInteger firstWeekdayIndex = [self.calendar firstWeekday] -1;
+    NSUInteger firstWeekdayIndex = ([self.calendar firstWeekday] + 6) % 7;

This prevents a "negative" unsigned integer when firstWeekday is zero.

How to make multiple selection on GUI

I know you have suggested to keep record of selected dates a user click on, but I want to have multiple dates selected on GUI as it does currently for a single date. And deselect same as it does now by clicking over the selected one. I know it's not a issue but I had to ask for my concern Thanks

On button Tap open specific month

As i have to hide and show calendar. What i need is whenever i show calendar it opens with specific month what i pass ?Any idea

thanks
Baibhav

Default styling causes poor frame rate.

Animating into a view with the Calendar on it or animating the Calendar (Tested on iPhone 4) results in terrible frame rates/choppyness however after removing the code below (with little visual loss) it becomes butter smooth. I suggest that you either use a .png for the opacity/shadow or ditch it all together because otherwise you get just awful performance.

self.layer.cornerRadius = 6.0f;
self.layer.shadowOffset = CGSizeMake(2, 2);
self.layer.shadowRadius = 2.0f;
self.layer.shadowOpacity = 0.4f;
self.layer.borderColor = [UIColor blackColor].CGColor;
self.layer.borderWidth = 1.0f;

previous month

i added ckcalendar view in my view controller but previous month and next month not coming

Curate some alternative 'themes' for the calendar

In order to show the range of possible styles for CKCalendar, we need to put together a number of themes that are both attractive and show the diversity of what is possible with the provided "theme extension points."

Screenshots of these themed CKCalendar's could be featured on the homepage or in the wiki.

"Back-filling" previous / next months' dates

The calendar currently leaves blank spots open when a month begins on a day other than the start of the week, or ends on a day other than the end of the week.

The remaining spots in the first and last row should be filled with the previous and next months' dates up. The styling of these "Non-current month" date cells should be configurable so that they can be distinguished against dates that fall in the currently selected month.

Date overlapping/missing on changing Timezone to London, England

img_8415

When we change the timezone to London, England the date starts overlapping of March month. All other months are OK but dates of march month only overlap. Date from left corner of March month shifts to above row and bottom left corner date gets blanked.
Please see attached screenshot.

configureDateItem:forDate: is not displaying anychanges

I have looked previous issues and found out that to be able to mark some dates I need to call 'configureDateItem:forDate:' , but somehow when I call that function, according to breakpoints it is working but it doesn't update display of calendar.

here is my sample code:

-(void) chooseDisabledDates :(EKEvent *)event
{

NSDate *startDate = event.startDate; // your start date
NSDate *endDate = event.endDate; // your end date
NSDateComponents *dayDifference = [[NSDateComponents alloc] init];

NSMutableArray *dates = [[NSMutableArray alloc] init];
NSUInteger dayOffset = 1;
NSDate *nextDate = startDate;
do {
    [dates addObject:nextDate];

    [dayDifference setDay:dayOffset++];
    NSDate *d = [[NSCalendar currentCalendar] dateByAddingComponents:dayDifference toDate:startDate options:0];
    nextDate = d;
} while([nextDate compare:endDate] == NSOrderedAscending);

self.disabledDates = nil;
self.disabledDates=[NSArray arrayWithArray:dates];

for (NSDate *disabledDate in self.disabledDates) {
    CKDateItem *item=[[CKDateItem alloc] init];
    item.backgroundColor=[UIColor redColor];
    item.textColor = [UIColor whiteColor];
    [self.ckCal.delegate calendar:self.ckCal configureDateItem:item forDate:disabledDate];
    //[self calendar:self.ckCal configureDateItem:item forDate:disabledDate];
}

//[self.ckCal setNeedsDisplay];
//[self.ckCal reloadData];

}

Rtl leyout

hey,
i'm having hard time changing the calendar layout to rtl.
can someone help me with this?
Thank

Year choice.....

Hello,
Thanks for your nice tool.....
I would like to propose a possible enhancement...
Can you add the possibility to change and choose year?

Thank you again....
George Gerardis

text in date buttons is blurred

CKCalendarView method calculateDayCellFrame: calculates frame with float origin and size, as result text in button is blurred

2013-04-11 11:40:50.645 Calendar[1012:f803] dateButton.frame = {{0, 23}, {43.2857, 43.2857}}
2013-04-11 11:40:50.646 Calendar[1012:f803] dateButton.frame = {{44.2857, 23}, {43.2857, 43.2857}}
2013-04-11 11:40:50.646 Calendar[1012:f803] dateButton.frame = {{88.5714, 23}, {43.2857, 43.2857}}

ckcalendar arabic days formatting issue

Im using ckcalendar(https://github.com/jaykz52/CKCalendar) in one of my application. In arabic locale i need a different layout of days, currently it is showing as following:

screen shot 2016-02-08 at 10 16 17 am

but i need its format as follow:

الأحد الأثنين الثلاثاء الأربعاء الخميس الجمعة السبت

the difference between both the format is that after changing its locale, ckcalendar days are still Right to left.

can any one let me know what should i need to do to fix this. as i try different things but i still get desired results.

Date layout bug

There seems to be a layout bug in the code, if you set the adaptHeightToNumberOfWeeksInMonth to NO, then move to October 2013 or March 2014, there is a layout issue with the cells of post months.

Only make dates pulled from a XML feed selectable

I'm using CKCalendarView for an events app. I'm parsing dates of event via a XML (RSS feed) into an array, anyone have any idea how I can put those dates into the calendar, so only them dates are selectable?

Thanks in advance

Wrong position in the days of the month

I have found that when it recognizes a month starts the first day mid-week schedule is set incorrectly.
Maybe this can be a solution to the problem of managing the day in the week:

Declare a variable in CKCalendarView.h BOOL (Ej. BOOL moveFirstRow).

And change this lines of code:

(CGRect)calculateDayCellFrame:(NSDate *)date {
int row = [self weekNumberInMonthForDate:date] - 1;
int placeInWeek = (([self dayOfWeekForDate:date] - 1) - self.calendar.firstWeekday + 8) % 7;

if (row == -1)
moveFirstRow = YES;

if (moveFirstRow == YES)
return CGRectMake(placeInWeek * (self.cellWidth + CELL_BORDER_WIDTH), (row * (self.cellWidth + CELL_BORDER_WIDTH)) + CGRectGetMaxY(self.daysHeader.frame) + CELL_BORDER_WIDTH + (self.cellWidth + CELL_BORDER_WIDTH), self.cellWidth, self.cellWidth);
else
return CGRectMake(placeInWeek * (self.cellWidth + CELL_BORDER_WIDTH), (row * (self.cellWidth + CELL_BORDER_WIDTH)) + CGRectGetMaxY(self.daysHeader.frame) + CELL_BORDER_WIDTH, self.cellWidth, self.cellWidth);

}

(void)moveCalendarToNextMonth {
moveFirstRow = NO;
NSDateComponents* comps = [[NSDateComponents alloc]init];
[comps setMonth:1];
self.monthShowing = [self.calendar dateByAddingComponents:comps toDate:self.monthShowing options:0];
}

(void)moveCalendarToPreviousMonth {
moveFirstRow = NO;
self.monthShowing = [[self firstDayOfMonthContainingDate:self.monthShowing] dateByAddingTimeInterval:-100000];
}

With this solution when it finds that the row = -1, add the cell size and the separator, adjusting correctly.
On the other hand this function checks each time it changes from month.

It may not be the right solution, but it works :)

Initializing calendar with a selected date on another month

It seems that the calendar always displays the current month on init even when a date in a previous month is specified with the selectedDate property.

For instance:

_calendarView = [[CKCalendarView alloc] initWithStartDay:startSunday];
_calendarView.delegate = self;
_calendarView.selectedDate = _theDate; //_theDate is last month
[self.view addSubview:_calendarView];

When _theDate is in the previous month, the calendar will display today's month and when navigation to last month, it will properly have the selected date colored.

Change width

Hi, can I modify frame of calendar? I need reduce width because I want render calendar into my popup.

Thanks

Improve documentation

Currently, the README doesn't describe what's stylable, what options are available on the calendar, or even what callbacks are available on the delegate. Document this so developers know what they're working with.

Time period

Is there a snippet available how to select from:till date? Like, multiple days?
The api read me says its possible with this calendar.

Thanks!

How to show a dot on an event date?

CKCalendar is the most simple and easy to use iOS calendar that I found. But I have a question regarding it.
I want to show a dot on a specific date on which there is an event, how can I do this?
How CKCalendar can interact with the system calendar for showing the events?

Current Day/Date

Hi guys, how are you? This is my favorite objective c calendar class, and the collaboration here is so cool.

I need some help of you. In my project, I have a View controller with a UIView and a UIButton. This UIView receives the CKCalendar and the UIButton in the view controller is a button to go back in the current day/date. I'm trying several ways but I can not do this.

Some one help me please.
Regards.

Guilherme Rosa

NSString formatting warning when compiling for 64-bit

When I compile for a 64-bit binary I get the following warning

Pods/CKCalendar/Source/CKCalendarView.m:81:54: Values of type 'NSInteger' should not be used as format arguments; add an explicit cast to 'long' instead

Disable last days and futurs

Hello,

First, thank you for this amazing calendar.

I need to disable the last dates and those in after 2 months for example.
How can I make this?

Thank you

CGContextSetBlendMode: invalid on iOS 7

I'm getting this error when running an app on iOS that uses the Pod for your component:

CGContextSetBlendMode: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.

Is this a known issue?

Several selected days

I would like to suggest the creation of a function that allows to show several selected days in the calendar like, for example: sundays and saturdays, or holidays.
Is that possible?
Thanks and congrats for the code.
Cassio

Overlapping the january date to february.

ios simulator screen shot 29-jan-2015 11 32 31 am
Please look at the screen shot for more detail.

After select the january 30 and change it to feb it shown me attachted ui, it not looking good,
Please suggest me if i am doing some mistake.

Selected date is wrong (One day before)

In demo application, when I select a date, it is shown in a UILabel I guess at the bottom of the page but it is wrong. For example when I select August 16th 2012, the output is always the one day before; August 15th 2012.

Modifying DateButton to create an event

I added the following code to CKCalendarView to create an event for a specific date.

-(void)setEventForDate:(NSDate *)date isHoliday:(BOOL)holiday withTitle:(NSString *)title{

   // NSLog(@"Date received for event %@", date);

    for (DateButton *dateButton in self.dateButtons) {
        if (dateButton.date) {
            NSLog(@"%@", dateButton.date);

            if ([date isEqualToDate:dateButton.date]) {
                NSLog(@"Matched date %@", dateButton.date);

                UIColor *eventColor;
                UIColor *textColor;

                if (holiday) {
                    eventColor = [UIColor grayColor];
                    textColor = [UIColor whiteColor];
                } else {
                    eventColor =[UIColor colorWithRed:0.557 green:0.137 blue:0.267 alpha:1];
                    textColor = [UIColor whiteColor];
                }

                UILabel *eventTitle = [[UILabel alloc] initWithFrame:CGRectMake(0, dateButton.frame.size.height - 15, dateButton.frame.size.width, 15)];

                [eventTitle setNumberOfLines:0];
                [eventTitle setText:title];
                [eventTitle setTextColor: textColor];
                [eventTitle setBackgroundColor:eventColor];
                [eventTitle setAdjustsFontSizeToFitWidth:YES];
                [eventTitle setTextAlignment:NSTextAlignmentCenter];

                [dateButton addSubview:eventTitle];
            }

        }
    }
}

The trouble I am having is that the the view shows in the cell the day before the correct date.

For example, if date passed in is 10/20/2013, the UILabel appears in the cell for 10/19, even though the debugger shows that the dateButton is 10/20.

I've narrowed it down to onlyShowCurrentMonth. If set to YES, the view appears in the correct cell otherwise it shows up in the day before.

Layout update for popover use

I used it in a popover. Very good work m8! really liked it.

I added another delegate method, so the popoverview size will keep track with the calendar size.
the method didchangemonth could not be used for this, as the calendar layout was only updated afterward.

put the hook in layoutsubviews.

-(void)calendar:(CKCalendarView *)calendar didLayoutCalendar:(CGRect)rect{
self.contentSizeForViewInPopover=calendar.frame.size;
}

Get Selected Date cell and modify it.

I'm trying to modify the cell/box of the selected item and change its properties, like changing its font-size or border. The delegate method I'm using is

- (void)calendar:(CKCalendarView *)calendar didSelectDate:(NSDate *)date {
}

but there is no object to use to access the cell.

I'm just new to iOS , sorry for my newbie question.

Setting calender backgound transparent

Really nice and customizable calender.

I am trying to have a transparent background color for calender. But I always end up with a gray ting to the background.
I am not sure what to be changed.
Attached is the final image.

Screen Shot 2013-03-15 at 12 26 37 PM

-[__NSCFCalendar components:fromDate:]: date cannot be nil

Hello,
I use in my App your Calendar. This morning I build my Project again and since I get following Error:
-[__NSCFCalendar components:fromDate:]: date cannot be nil
I mean really, what do you think that operation is supposed to mean with a nil date?
An exception has been avoided for now.
A few of these errors are going to be reported with this complaint, then further violations will simply silently do whatever random thing results from the nil.
Here is the backtrace where this occurred this time (some frames may be missing due to compiler optimizations):

This Error comes by following line:
CKCalendarView *calendarSubView = [[CKCalendarView alloc] init];[/code]
Is this a Issue or is it because iOS 7 on my Test Device?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.