GithubHelp home page GithubHelp logo

jtcalendar's People

Contributors

bigbengao avatar chrismeats avatar cptn-solo avatar ilaszlo avatar johnvuko avatar kenji21 avatar mosabelagha avatar patoroco avatar revolter avatar rrulin avatar seonghun23 avatar sguillope avatar vangeli-globant 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  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

jtcalendar's Issues

Calendar on navigationController

Hi! Thank you for this great control.

When you use this Calendar inside a Navigation controller and you try to return to previous view, the Calendar, just go to previous month too, and it keeps visible for a second over the previous view.

Any thoughts to solve this?

Thanks SO much!

Calendar ReloadData issue

I am having an issue with the calendar reloading after the view is presented. For example, right now it shows October then scrolls to the current month of December. I don't see this issue with the example app, but I also don't see any differences in my code from the example.

Hour View

In your second example screen shot your show what looks like an Hour view below the calendar. But I could not find the functionality for this. Is this something that is available and if so how is it turned on?

JTCalendar doesn't display current month, instead shows 2 months ago by default

Looking through the source, the only way I could find to select the current month when first loading was to perform these in sequence:

[calendar loadNextMonth];
[calendar loadNextMonth];
[calendar reloadData];

This is due to the way it's loading two months either side of the current month, and doesn't scroll to the current month, but shows currentMonth - 2 months as the default calendar.

It seems to me that setCurrentDate should automatically scroll to the current month.

Swiping on MenuView in Week mode causes inconsistency.

Hi Jonathan,

Thanks for sharing such a great library. This is really awesome.

While trying your example app I noticed that when you switch it to Week mode, you can swipe on the Month names and changes the month but not the days below. Swipe on MonthView is disabled initially but once you start swiping on the days it will get enabled.

Compiling the library?

Hi I just downloaded your library and sample, but I can't run it since the library is not precompiled.
Can I have a little help compiling the pods library ?

I installed cocoa pods, but I have no idea how to work with it.

expensive for ReloadData, expensive for iphone Memory

when I need to reload current MonthView, I must reload [self.contentView reloadData]; There isn't a convenient way to reload current MonthView,it cost much to reload the whole ContentView(#define NUMBER_PAGES_LOADED 5 // Must be the same in JTCalendarView, JTCalendarMenuView, JTCalendarContentView). NUMBER_PAGES_LOADED MonthViews will reload at the same time.

NUMBER_PAGES_LOADED change 5 to 3. the total Memory reduce about 10MB,and it become light.
But it much easier to load a white view .
Memory 30MB
Unexpected UI

hope new source File and effective Source File come out.

btw: I like JTCalendar very much, i learned a lot from you.thanks for sharing.
best regards!

Navigate to today's date

I was wondering if there is an efficient method to navigate to the current date in case you are viewing some other month ?

  • (IBAction)todayButtonTapped:(id)sender
    {
    self.calendar.currentDateSelected = [NSDate date];
    [self.calendar reloadAppearance];
    ......
    }

I have this, it selects the current date but does not go to the right month

Edit, figured it out, nvm. Had to do -
self.calendar.currentDate = [NSDate date];

Displaying my calendar events

I'm new to calendars in iOS, so this is probably just an newbie thing. Can you give me a hint about how to read my calendar events into the calendar view? I'm sure they need to be supplied to the datasource, but in what kind of object?

Thanks,
Jeff

Message to a deallocated JTCalendar Object

I have a navigation controller with 3 VC, one of them has a button that goes to the VC where the calendar is displayed. Once there, if I go back it crashes.
The reason is that is sending a message to the calendar (JTCalendar object), that was deallocated. The message is “scrollViewDidScroll:” and it is a UIScrollViewDelegate method.

I have been trying a lot of things, but nothing works. I was wondering if you know if there is somewhere in your code where I can prevent calling it when the calendar is deallocated.

Here you have the Zombie message:
-[JTCalendar scrollViewDidScroll:]: message sent to deallocated instance 0x1740933d0

Would like to know how to add this component without using xib ?

Wonderful calendar component , but would like to add this to my view controller without using xib

Tried the below Code but its of no use

Could you please provide me some suggestions pls ?

self.calendar = [JTCalendar new];
self.calendarMenuView = [[JTCalendarMenuView alloc]initWithFrame:CGRectMake(0, 0, self.view.bounds.size.width, 50)];
self.calendarContentView = [[JTCalendarContentView alloc]initWithFrame:CGRectMake(0, self.calendarMenuView.bottom, self.view.bounds.size.width, 500)];

// All modifications on calendarAppearance have to be done before setMenuMonthsView and setContentView
// Or you will have to call reloadAppearance
{
    self.calendar.calendarAppearance.calendar.firstWeekday = 2; // Sunday == 1, Saturday == 7
    self.calendar.calendarAppearance.dayCircleRatio = 9. / 10.;
    self.calendar.calendarAppearance.ratioContentMenu = 1.;
}

[self.calendar setMenuMonthsView:self.calendarMenuView];
[self.calendar setContentView:self.calendarContentView];
[self.calendar setDataSource:self];

Fetch events into calendar

Hi Jonathan,
This calendar looks awesome. I am new in ios programming and I would to use this calendar in to my application. The only issue that I have is that I want to fetch some events from a website in to this calendar. Where/How can I do this?
Thank you.

Pods issue

When trying to run pod install on the Example folder this error arises

[!] Unable to satisfy the following requirements:

- `JTCalendar (from `../`)` required by `Podfile`

Calendar Header - Display Month and Year

JTCalendarMenuView.h

- (void)setMonthIndex:(NSInteger)monthIndex withYear:(NSInteger) year;

JTCalendarMenuView.m

- (void)setCurrentDate:(NSDate *)currentDate
{
    self->_currentDate = currentDate;

    NSCalendar *calendar = self.calendarManager.calendarAppearance.calendar;
    NSDateComponents *comps = [calendar components:NSCalendarUnitMonth | NSCalendarUnitYear fromDate:currentDate];
    NSInteger currentMonthIndex = comps.month;
    NSInteger currentYear = comps.year;

    for(int i = 0; i < NUMBER_PAGES_LOADED; ++i){
        JTCalendarMenuMonthView *monthView = monthsViews[i];
        NSInteger monthIndex = currentMonthIndex - (NUMBER_PAGES_LOADED / 2) + i;
        monthIndex = monthIndex % 12;

        [monthView setMonthIndex:monthIndex withYear:currentYear];
    }

    [self.calendarManager.dataSource calendarDidChangeMonth:self.calendarManager date:currentDate];
}

JTCalendarMenuMonthView.h

- (void)setMonthIndex:(NSInteger)monthIndex withYear:(NSInteger) year
{
    static NSDateFormatter *dateFormatter;
    if(!dateFormatter){
        dateFormatter = [NSDateFormatter new];
        dateFormatter.timeZone = self.calendarManager.calendarAppearance.calendar.timeZone;
    }

    while(monthIndex <= 0){
        monthIndex += 12;
    }

    NSString *month = [[dateFormatter standaloneMonthSymbols][monthIndex - 1] capitalizedString];
    textLabel.text = [NSString stringWithFormat:@"%@ - %ld", month, (long)year];
}

Tapping 'today' button doesn't change the day dot to current date if you are in same month

I have a today button at the top of my calendar and I am using the provided delegates. If i select the 'today' button in a different month, it works as expected, it changes the selected day to the current date and theres only one day dot.

However, lets say I select a date in the same month and then i click the today button, the app doesn't do anything, but it should change the day dot to the current date and remove the second day dot. But it still shows two day selected dots.

Memory issues

While using the calendar I've met issues with memory usage. Actually, it takes more than 11 MB on my iPhone 5 which doesn't make the best performance. I didn't make much code exploring but from the first sight it has some optimization work to be done, especially in case of loading pages with dates. It'd be really nice if you could improve that stuff.

Agenda view?

In the second screenshot is an agenda view for the day below the calendar. Is that included or was that from another app/library?

Duplicated code in JTCalendarContentView

row 147:

  • (void)setCalendarManager:(JTCalendar *)calendarManager
    {
    self->_calendarManager = calendarManager;

    for(JTCalendarMonthView *view in monthsViews){
    [view setCalendarManager:calendarManager];
    }

    for(JTCalendarMonthView *view in monthsViews){
    [view setCalendarManager:calendarManager];
    }
    }

add alpha animation for menu month view

Hi, @jonathantribouharet
I add a alpha animation effect on the month menu view. The more the menu is close to the center of the screen, the greater the alpha is. I also leave a interface for setting the max alpha value and the min.This is the effect
PR #52

jtcalendar-alpha

JTCalendarDayView selection API

Hello Jonathan,

Thank you for such a nice calendar. It might be even better, if there was an explicit way of selecting a date (simple adding a CircleView onto the day one). I hope you find this feature useful to work on.

Thank you and happy coding time! 👍

dynamically change scrollview height

Hello,

i want to calculate dynamically change scrollview height.

suppose, i am in November month that month view and scrollview is big and then i go to February month that month view is small but scroll view is not changes dynamically...

How to create event with NSDate

Hi developer;
I'm a developer as well, and I'm trying to implement inside JTCalendar some event taken from NsDate*dateSelected

In it I've some date in "dd/MM/yyyy HH:mm":

NSLog(@"%@",dateselected)
"2014-12-09 00:05:41.908 Database Demo[1348:31927] 2014-12-09 09:39:37 +0000
2014-12-09 00:05:41.911 Database Demo[1348:31927] 2014-12-14 09:32:26 +0000
2014-12-09 00:05:41.913 Database Demo[1348:31927] 2014-12-20 08:08:09 +0000"

When I try to implement the date of "dateSelected" in the eventsByDate[key], it makes just one event (the last one that I've insert in the dateSelected).

Here the code:

  • (void)createEvents
    {
    eventsByDate = [NSMutableDictionary new];

    NSDate *myDate = dateSelected;
    
    NSString *key = [[self dateFormatter] stringFromDate:myDate];
    
    if(!eventsByDate[key]){
        eventsByDate[key] = [NSMutableArray new];
    }
    
    [eventsByDate[key] addObject:myDate];
    }
    

    }

Can you help me ???

Have a nice day......;)

How to show that there is an event using array

First of all, thank you for this great library. It is awesome.

But I amb getting a problem.. I have an array with a huge number of EKEvents, and in order to add the dot at the bottom on the month view, I am doing this:

  • (BOOL)calendarHaveEvent:(JTCalendar *)calendar date:(NSDate *)date
    {
    NSArray *eventsArray = [self.eventManager getAllEventsForSelectedCalendars];

    for (EKEvent *event in eventsArray) {
    if (event.startDate == date) {
    return YES;
    }
    }
    return NO;
    }

And yes, it works. But it takes too much time to repaint the view, so the user cannot change smoothly more than one month at once.

Do you have another way to do it?

Thanks in advance

Architecture issue running on iPad

Getting armv architecture errors on compiling code for iPad device.

ld: warning: ignoring file      /Users/vaibhavs/Documents/vaibhavsprojects/Samples/JTCalendar/Example/libPods-JTCalendar.a, file was built for archive which is not the architecture being linked (armv7):      /Users/vaibhavs/Documents/vaibhavsprojects/Samples/JTCalendar/Example/libPods-JTCalendar.a
ld: warning: ignoring file  /Users/vaibhavs/Documents/vaibhavsprojects/Samples/JTCalendar/Example/libPods.a, file was built for archive which is not the architecture being linked (armv7): /Users/vaibhavs/Documents/vaibhavsprojects/Samples/JTCalendar/Example/libPods.a
Undefined symbols for architecture armv7:
"_OBJC_CLASS_$_JTCalendar", referenced from:
objc-class-ref in ViewController.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Please describe how to compile static library for an universal application.

the date selected doesn't match

I have this problem where the date i click on and displayed is not the same date. For example, if i clicked on 7th May, the console will display 6th May instead.
problem

Add Delegate

Hi there, in some cases the calendar day view should not be allowed to select, I think it's better to have a delegate with a method whether we should select the date. The datasource didn't work as a datasource but as a delegate.Can we change the data source to delegate too?

timezone not work

Hi,
I try to set timezone after create JTCalendar,but seems not work,here is my code:
_calendar = [JTCalendar new];
[_calendar.calendarAppearance.calendar setTimeZone:[[NSTimeZone alloc] initWithName:@"Asia/Shanghai"]];
NSLog("%@", [NSDate date]); //output: 2014-12-17 05:33:29
My local time is 2014-12-17 13:33:29
How to set the right timezone?
Thanks for your help.

Some useful features

Hi, Jonathan!
Thank You for your work! I use your calendar - it looks excellent.
But i can not understand, how to skip selection programmatically.
And how to get selected month. Could You help me?
Thank You!

Issue with week mode

First of all thank you so much for this control. It's a great control. I am just having one issue that when i am in a week mode and i change month from menuView at that time the week is not getting changed.

Thank you once again for the control

Language Support

Is there a way to change the calendar language to Spanish, even if the iphone has been set to spanish, the calendar keeps showing the month's name in english.

Incorrect week displayed in week mode

First of all, kudos for your great work. I noticed a weird behavior though when changing mode from month view to week view. Indeed, the week displayed is not the one with the selected day. For example if I select January 1st in month view and switch to week view it will show the week of January 12th to 18th. How can we change that? Thanks

Incorrect start date

Hi, amazing repo.

Using the code from the Example project, my calendar starts in October 2014.
Any Idea why this is happening and how I can fix it?

Code below;

// Calendar Setup
self.calendar = [JTCalendar new];
// All modifications on calendarAppearance have to be done before setMenuMonthsView and setContentView
// Or you will have to call reloadAppearance
{
    self.calendar.calendarAppearance.calendar.firstWeekday = 2; // Sunday == 1, Saturday == 7
    self.calendar.calendarAppearance.dayCircleRatio = 9. / 10.;
    self.calendar.calendarAppearance.ratioContentMenu = 2.;

    self.calendar.calendarAppearance.monthBlock = ^NSString *(NSDate *date, JTCalendar *jt_calendar){
        NSCalendar *calendar = jt_calendar.calendarAppearance.calendar;
        NSDateComponents *comps = [calendar components:NSCalendarUnitYear|NSCalendarUnitMonth fromDate:date];
        NSInteger currentMonthIndex = comps.month;

        static NSDateFormatter *dateFormatter;
        if(!dateFormatter){
            dateFormatter = [NSDateFormatter new];
            dateFormatter.timeZone = jt_calendar.calendarAppearance.calendar.timeZone;
        }

        while(currentMonthIndex <= 0){
            currentMonthIndex += 12;
        }

        NSString *monthText = [[dateFormatter standaloneMonthSymbols][currentMonthIndex - 1] capitalizedString];

        return [NSString stringWithFormat:@"%ld\n%@", (long)comps.year, monthText];
    };
}

[self.calendar setMenuMonthsView:self.calendarMenuView];
[self.calendar setContentView:self.calendarContentView];
[self.calendar setDataSource:self];

Show one month at a time but still make it scrollable

Hello,

I am trying to design my app to show the current month by itself:

       December 

but right now it looks like this:
vember December Janua

I have tried looking throughout the code and I can't figure it out. Its obviously possible because the example screenshot (the blue one) shows it.

I tried doing NUMBER_PAGES_LOADED 1 and it shows the single month just like I want, but it doesn't scroll to the next months.

Any help would be much appreciated.

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.