Giter Site home page Giter Site logo

jtcalendar's Introduction

JTCalendar

CI Status Version Carthage compatible License Platform

JTCalendar is an easily customizable calendar control for iOS.

Installation

With CocoaPods, add this line to your Podfile.

pod 'JTCalendar', '~> 2.0'

Carthage

To use this project with Carthage, add this line to your Cartfile.

github "jonathantribouharet/JTCalendar" ~> 2.2

Screenshots

Example Example

Warning

The part below the calendar in the 2nd screenshot is not provided.

Features

  • horizontal and vertical calendar
  • highly customizable either by subclassing default class provided or by creating your own class implementing a protocol
  • support internationalization
  • week view mode
  • limited range, you can define a start and an end to you calendar

Usage

Basic usage

You have to create two views in your UIViewController:

  • The first view is JTCalendarMenuView and it represents the part with the months names. This view is optional.
  • The second view is JTHorizontalCalendarView or JTVerticalCalendarView, it represents the calendar itself.

Your UIViewController have to implement JTCalendarDelegate, all methods are optional.

#import <UIKit/UIKit.h>

#import <JTCalendar/JTCalendar.h>

@interface ViewController : UIViewController<JTCalendarDelegate>

@property (weak, nonatomic) IBOutlet JTCalendarMenuView *calendarMenuView;
@property (weak, nonatomic) IBOutlet JTHorizontalCalendarView *calendarContentView;

@property (strong, nonatomic) JTCalendarManager *calendarManager;

@end

JTCalendarManager is used to coordinate calendarMenuView and calendarContentView and provide a default behavior.

@implementation ViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
        
    _calendarManager = [JTCalendarManager new];
    _calendarManager.delegate = self;
    
    [_calendarManager setMenuView:_calendarMenuView];
    [_calendarManager setContentView:_calendarContentView];
    [_calendarManager setDate:[NSDate date]];
}

@end

The Example project contains some use cases you may check before asking questions.

Advanced usage

Even if all methods of JTCalendarManager are optional you won't get far without implementing at least the two next methods:

  • calendar:prepareDayView: this method is used to customize the design of the day view for a specific date. This method is called each time a new date is set in a dayView or each time the current page change. You can force the call to this method by calling [_calendarManager reload];.
- (void)calendar:(JTCalendarManager *)calendar prepareDayView:(JTCalendarDayView *)dayView
{
    dayView.hidden = NO;
    
    // Test if the dayView is from another month than the page
    // Use only in month mode for indicate the day of the previous or next month
    if([dayView isFromAnotherMonth]){ 
        dayView.hidden = YES;
    }
    // Today
    else if([_calendarManager.dateHelper date:[NSDate date] isTheSameDayThan:dayView.date]){
        dayView.circleView.hidden = NO;
        dayView.circleView.backgroundColor = [UIColor blueColor];
        dayView.dotView.backgroundColor = [UIColor whiteColor];
        dayView.textLabel.textColor = [UIColor whiteColor];
    }
    // Selected date
    else if(_dateSelected && [_calendarManager.dateHelper date:_dateSelected isTheSameDayThan:dayView.date]){
        dayView.circleView.hidden = NO;
        dayView.circleView.backgroundColor = [UIColor redColor];
        dayView.dotView.backgroundColor = [UIColor whiteColor];
        dayView.textLabel.textColor = [UIColor whiteColor];
    }
    // Another day of the current month
    else{
        dayView.circleView.hidden = YES;
        dayView.dotView.backgroundColor = [UIColor redColor];
        dayView.textLabel.textColor = [UIColor blackColor];
    }
    
    // Your method to test if a date have an event for example
    if([self haveEventForDay:dayView.date]){
        dayView.dotView.hidden = NO;
    }
    else{
        dayView.dotView.hidden = YES;
    }
}
  • calendar:didTouchDayView: this method is used to respond to a touch on a dayView. For example you can indicate to display another month if dayView is from another month.
- (void)calendar:(JTCalendarManager *)calendar didTouchDayView:(JTCalendarDayView *)dayView
{
    // Use to indicate the selected date
    _dateSelected = dayView.date;
    
    // Animation for the circleView
    dayView.circleView.transform = CGAffineTransformScale(CGAffineTransformIdentity, 0.1, 0.1);
    [UIView transitionWithView:dayView
                      duration:.3
                       options:0
                    animations:^{
                        dayView.circleView.transform = CGAffineTransformIdentity;
                        [_calendarManager reload];
                    } completion:nil];
    
    // Load the previous or next page if touch a day from another month
    if(![_calendarManager.dateHelper date:_calendarContentView.date isTheSameMonthThan:dayView.date]){
        if([_calendarContentView.date compare:dayView.date] == NSOrderedAscending){
            [_calendarContentView loadNextPageWithAnimation];
        }
        else{
            [_calendarContentView loadPreviousPageWithAnimation];
        }
    }
}

Switch to week view

If you want see just one week at a time, you have to set the isWeekMode to YES and reload the calendar.

_calendarManager.settings.weekModeEnabled = YES;
[_calendarManager reload];

WARNING

When you change the mode, it doesn't change the height of calendarContentView, you have to do it yourself. See the Example project for more details.

Customize the design

For customize the design you have to implement some methods depending of what parts you want to custom. Check the JTCalendarDelegate file and the Example project.

For example:

// This method is independent from the date, it's call only at the creation of the dayView.
// For customize the dayView depending of the date use `prepareDayView` method
- (UIView<JTCalendarDay> *)calendarBuildDayView:(JTCalendarManager *)calendar
{
    JTCalendarDayView *view = [JTCalendarDayView new];
    view.textLabel.font = [UIFont fontWithName:@"Avenir-Light" size:13];
    view.textLabel.textColor = [UIColor blackColor];
    
    return view;
}

Pagination

The content views (JTHorizontalCalendarView and JTVerticalCalendarView) are just subclass of UIScrollView. Each time the current page change, calendarDidLoadNextPage or calendarDidLoadPreviousPage is called. The content views provide two method for display the previous or next page with an animation loadNextPageWithAnimation and loadPreviousPageWithAnimation. You can limit the range of the calendar by implementing canDisplayPageWithDate method.

// Used to limit the date for the calendar
- (BOOL)calendar:(JTCalendarManager *)calendar canDisplayPageWithDate:(NSDate *)date
{
    return [_calendarManager.dateHelper date:date isEqualOrAfter:_minDate andEqualOrBefore:_maxDate];
}

Vertical calendar

If you use JTVerticalCalendarView for having a vertical calendar, you have some settings you have to set.

- (void)viewDidLoad
{
    [super viewDidLoad];
    
    _calendarManager = [JTCalendarManager new];
    _calendarManager.delegate = self;
    
    _calendarManager.settings.pageViewHaveWeekDaysView = NO; // You don't want WeekDaysView in the contentView
    _calendarManager.settings.pageViewNumberOfWeeks = 0; // Automatic number of weeks
    
    _weekDayView.manager = _calendarManager; // You set the manager for WeekDaysView
    [_weekDayView reload]; // You load WeekDaysView manually

    [_calendarManager setMenuView:_calendarMenuView];
    [_calendarManager setContentView:_calendarContentView];
    [_calendarManager setDate:[NSDate date]];
    
    _calendarMenuView.scrollView.scrollEnabled = NO; // The scroll is not supported with JTVerticalCalendarView
}

Internationalization / Localization (change first weekday)

For changing the locale and the timeZone just do:

_calendarManager.dateHelper.calendar.timeZone = [NSTimeZone timeZoneWithAbbreviation:@"CDT"];
_calendarManager.dateHelper.calendar.locale = [NSLocale localeWithLocaleIdentifier:@"fr_FR"];
[_calendarManager reload];

For changing locale and timeZone in Swift use:

let locale = Locale(identifier: "fr_FR")
let timeZone = TimeZone.init(abbreviation: "CDT")
calendarManager = JTCalendarManager(locale: locale, andTimeZone: timeZone)

Date comparaison

Be careful when you compare two different dates, you have to take care of the time zone. An helper is provided for some basic operations:

[_calendarManager.dateHelper date:dateA isTheSameMonthThan:dateB];
[_calendarManager.dateHelper date:dateA isTheSameWeekThan:dateB];
[_calendarManager.dateHelper date:dateA isTheSameDayThan:dateB];

// Use to limit the calendar range
[_calendarManager.dateHelper date:date isEqualOrAfter:minDate andEqualOrBefore:maxDate];

Optimization

Every methods in the delegate are called in the main thread, you have to be really careful, in particular in the prepareDayView method which is called very often.

If you have to fetch some data from something slow, I recommend to create a cache and query this cache in prepareDayView method. You have to cache the data from the next pages and update this cache asynchronously (in another thread via dispatch_async) when a new page is loaded (via calendarDidLoadNextPage and calendarDidLoadPreviousPage methods).

Questions

Before asking any questions be sure to explore the Example project. Check also JTCalendarDelegate and JTCalendarSettings files.

Don't use NSLog to print date use a NSDateFormatter, NSLogdoesn't take care of the timezone.

NSDateFormatter *dateFormatter = [_calendarManager.dateHelper createDateFormatter];
dateFormatter.dateFormat = @"yyyy'-'MM'-'dd' 'HH':'mm':'ss";
NSLog(@"%@", [dateFormatter stringFromDate:yourDate]);

Requirements

  • iOS 7 or higher
  • Automatic Reference Counting (ARC)

Author

License

JTCalendar is released under the MIT license. See the LICENSE file for more info.

jtcalendar's People

Contributors

bigbengao avatar chrismeats avatar cptn-solo avatar ilaszlo avatar jonathantribouharet 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

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.

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

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.

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......;)

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?

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

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.

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];
}

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.

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];

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.

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.

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

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?

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...

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

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

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.

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];

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?

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];
    }
    }

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!

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!

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.

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`

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! 👍

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];

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!

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.

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

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.

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.