Code Monkey home page Code Monkey logo

pmcalendar's People

Contributors

4ndrey avatar blakewatters avatar kovpas avatar mikebob avatar twocentstudios avatar zachdev 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

pmcalendar's Issues

Memory leak in PMThemeEngine drawString...

There seems to be a memory leak in [PMThemeEngine drawString:withFont:inRect:forElementType:subType:inContext:].

The if (isGradient) conditional has CFReleases for line, attrString, and font, but the else block does not.

Moving the CFReleases outside the if conditional solves the problem. I don't drop down to Foundation that often though, so please feel free to correct me.

// Clean up
if (isGradient)
{
    // ...

    /* Remove these three lines */
    // CFRelease(line);
    // CFRelease(attrString);
    // CFRelease(font);
}
else
{
    // ...
}

/* Add these three lines */
CFRelease(line);
CFRelease(attrString);
CFRelease(font);

Nothing aligned & strange behaviors all of the sudden

Screen Shot 2013-03-20 at 1 38 35 PM

Just recently the calendar in my app began looking like this (attached the image), and it has been acting strange; selecting the wrong date, not appearing a 2nd time..

I swear it was never doing this before..

Has anyone else experienced this issue? I also ran the latest demo code and that is where this screenshot is from

Restricting selection count

Thank you for such wonderful component.

I have one question though, is it possible to set selection count like user can select only 5 days or only 2 days like that.

It is like some times I need 2 dates from user i.e. start date end date, some times I just want to allow only start date

Thanks,

Alignment is incorrect when PMCalendar loads the very first time

Hi,

I like this component alot but I've been noticing an issue that's a blocker. When I present the Calendar for the very first time in my app, the alignment is off (screenshot) attached. All subsequent calls to show the calendar work just fine and the calendar is aligned properly.
Screen Shot 2012-12-29 at 10 01 21 AM

The logs look the same both when it's not aligned and when it is aligned:
not working
PMLOG: -[PMDaysView drawRect:] [Line 847] End
2012-12-29 10:02:25.025 liveWants[75899:1a603] {{257, 152}, {35, 16}}

working
PMLOG: -[PMDaysView drawRect:] [Line 847] End
2012-12-29 10:01:39.954 liveWants[75857:1a603] {{257, 152}, {35, 16}}

Have you noticed this issue before? In summary, it works fine except for the very first time.

I've tried initializing the calendar numerous ways but this is how I currently initialize it:
{code}
PMCalendarController *calendarController = [[PMCalendarController alloc] initWithSize:CGSizeMake(300, 200)];
[calendarController presentCalendarFromRect:CGRectMake(100, 100, 10, 10)
inView:self.view
permittedArrowDirections:PMCalendarArrowDirectionUp | PMCalendarArrowDirectionLeft
animated:YES];
{code}

Environment: iphone 6.0 simulator

Second time it change frame to the little one.

Hi Pavel!

Beautiful control!

My problem is that when I use it in tableView, first time it presents as it should,
but after it changes its frame to the little one and prints in console:
PMLOG: -[PMDaysView drawRect:] [Line 847] End
{{183, 44}, {47, 45}}
PMLOG: -[PMDaysView drawRect:] [Line 847] End
{{19, 44}, {6, -3}}

I use storyboard and static cells.
Do you have any thoughts how to fix it?

  • (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
    {
    [_commentTV resignFirstResponder];
    [self.tableView deselectRowAtIndexPath:indexPath animated:YES];
    [pmCC presentCalendarFromRect:CGRectZero
    inView:tableView.superview
    permittedArrowDirections:PMCalendarArrowDirectionAny
    animated:YES];

// [pmCC presentCalendarFromView:self//(UITableViewCell *)[self.tableView cellForRowAtIndexPath:indexPath]
// permittedArrowDirections:PMCalendarArrowDirectionAny
// animated:YES];
[self calendarController:pmCC didChangePeriod:pmCC.period];
}

Thank you!

The screen rotates date position error.

Screen Shot 2013-04-07 at 4 56 22

modify: PMCalendarController.m
Method: adjustCalendarPositionForPermittedArrowDirections
self.calendarView.frame = frm;
to:
CGRect tempFrm = frm;
tempFrm.origin.y=0;

self.calendarView.frame = tempFrm;

But I'm not very clear, whether it will affect the other.

Swift Compatibility

is this calendar implementation compatible with swift?
If so will adding a bridging header suffice?

mark dates

how to mark a date with a ''.'' or a ''a''?it is posible?thanks

Alignment issue

Hi, I recently went through your PMCalendar, you did a great job.I noticed a issue but i am not able to find cause for it. because if i execute your demo code it is working perfectly when i integrate your library with my project calendar alignment gone crazy. I created a sample project --> then i added PMCalendar directory to xcode --> i used same code in my root view controller class what you used in PMViewController. but calendar alignment is missing but it works well in your demo project. The only difference i noticed is your project deployment target is 4.0 and mine is 7.0 . Please help me
screen shot 2014-03-30 at 1 24 01 pm

No interaction on the calendar view

screen shot 2017-02-07 at 12 51 55 pm

Please check the image above, i added the calendar view over a base controller but it is not taking any action(not able to select the date).

Note : Calendar is opened over the base view controller.

Below is the code used to add calendar πŸ‘

@Property (nonatomic, strong) PMCalendarController *pmCC;

        self.pmCC = [[PMCalendarController alloc] initWithThemeName:@"default"];
        self.pmCC.delegate = self;
        self.pmCC.mondayFirstDayOfWeek = NO;
        [self.pmCC setAllowsPeriodSelection:YES];
        [self.pmCC presentCalendarFromView:sender
                  permittedArrowDirections:PMCalendarArrowDirectionUp
                                 isPopover:isPopover
                                  animated:YES];

Leak and crash in PMCalendarView.m when changing month by touch

I'm using a non-ARC project and added the files needed. Crash appears either if I use -fno-objc-arc or not.

When I press the arrows for changing the month shown in PMCalendar it crashes. This is what I get in the log:

2012-11-07 18:39:03.139 Project[34152:c07] -[__NSCFString monthStartDate]: unrecognized selector sent to instance 0x867f170
2012-11-07 18:39:03.139 Project[34152:c07] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFString monthStartDate]: unrecognized selector sent to instance 0x867f170'
*** First throw call stack:
(0x24a0012 0x1d51e7e 0x252b4bd 0x248fbbc 0x248f94e 0x70f2b 0xf124be 0x70ba3f 0x70b96b     0x61d697 0x70b83c 0x70b9ba 0x70b2b6 0x70b994 0x7000e2 0x70015c 0x67e0bc 0x67f227     0x67f8e2 0x2468afe 0x2468a3d 0x24467c2 0x2445f44 0x2445e1b 0x26d87e3 0x26d8668 0xec265c     0x27ca 0x26d5)
libc++abi.dylib: terminate called throwing an exception

Today functionaity?

Is there any functionality for displaying Today date. User can press a button, to jump to Today date from any date.

Presenting the PMCalendar from the UiNavigationBar

Hi,
I'm trying to present the PMCalendar from a UiButton on the NavigationBar.
The calendar is shown but is not interaction enabled as anywhere I tap. the tap action will be done on the view under the calendar (the corresponding uiview of the nav bar)

Do you know any fix? I'm trying to look in the component code but still no luck.
Thanks

newPeriod.startDate or newPeriod.endDate isn’t updated.

When the calendar is displayed and user selects a date, the newPeriod.startDate has the correct date selected by the user but when the next time calendar is displayed newPeriod.startDate or newPeriod.endDate is the current date not the one which user changed when the last time user selected some date.
How can I achieve this? Or is there anything that I’m missing?

Today Index Calculation Incorrect

I have just noticed that the isToday value computed in the secondary loop of - [PMCalendarView drawRect:(CGRect)rect] is reapplying the weekdayOfFirst logic and throwing the calculation off by 2 days -- in the Demo app I am seeing January 17 selected, rather than January 15.

It looks like we can just do a direct comparison of the dayNumber against the todayIndex.

Today's index give wrong value

In PMCalendarView.m, in the method drawRect, you are calculating todayIndex based on the beginning of the current month. But since days from the previous month are also displayed, I get a wrong value for it !
I changed it like this :

int todayIndex  = [[[NSDate date] dateWithoutTime] daysSinceDate:monthStartDate] + weekdayOfFirst - 1;

and it seems to work now

Rotation Observer Not Torn Down in Dealloc

We are using the calendar within a view controller rather than as a pop-up menu. As a result, we are not invoking dismissCalendarAnimated: when we are done with the calendar. This causes a crash alter in program execution if the device is rotated as the observer added in presentCalendarFromRect:inView:permittedArrowDirections:animated: is never torn down properly.

The fix is to add a dealloc method that removes self from the default notification center.

allowedPeriod Functionality is not working

Not able to give validation for the start date and end date with allowedPeriod property of PMCalendarView.
Have checked the code, the variable has been only defined, but not used anywhere.
Can anyone help to resolve this issue..
Thanks in advance...

Selection of Dates in March 2013 are Off by One

Starting on March 11, 2013 the date selection logic is thrown off. Through March 10, tapping on the date cell highlights the appropriate cell. When you try to tap March 11, the 10th stays highlighted. The rest of the month has this off by one error which I expect is related to the 28 day month of February.

I am working on a fix now.

iOS 7

Renders a gray box behind the popover view

last week tap issue

i could not select any date from last week date. i am using default.plist settings . may be its due to integration fault can any one please help me

Cocoapod

Waiting for a cocoapod to arrive :)
Tried to make a spec by myself, but stuck somewhy on a docset gen.

Pod::Spec.new do |s|
  s.name         = "PMCalendar"
  s.version      = "0.3"
  s.summary      = "Yet another calendar component for iOS. Supports presenting as a popover and very flexible UI tuning."
  s.homepage     = "https://github.com/kovpas/PMCalendar"
  s.author       = { "Pavel" => "[email protected]" }
  s.source       = { :git => "https://github.com/kovpas/PMCalendar.git", :tag => "0.3" }
  s.platform     = :ios
  s.license      = 'MIT'
  s.source_files = 'PMCalendar','PMCalendar/**/*.{h,m}'
  s.resources = 'PMCalendar/Theme/*.{png,plist}'

  s.frameworks = 'UIKit', 'Foundation', 'CoreGraphics', 'CoreText'
  s.requires_arc = true
end

Screen Shot 2013-02-10 at 17 44 27

So PMCalendar pod's dir is empty. Dunno why.

Setting Calendar Period Renders Rows Incorrectly

I am still trying to get to the bottom of this and the behavior doesn't seem to happen within the PMCalendar example app, but I am seeing a behavior in which the configuration of the period with a one-day selected period (i.e. self.calendarController.period = [PMPeriod oneDayPeriodWithDate:self.selectedDate];) results in the incorrect rendering of the day cells in the last week of the month. The cells seem to draw at about half-height. Not configuring the period results in appropriate rendering.

I am on latest master version (ref 98802aa)

We have a custom calendar theme, but the behavior also occurs when I use one of the bundled themes. We are also presenting the calendar from a rect in a view with isPopover:NO.

See the screenshots for examples:

With current period configured:
iOS SimulatorScreenSnapz064

Without:
simulator

Does not work well when scrolling across months (after dismissing once)

A few issues :

  1. On clicking the button the calendar gets displayed, but the user is unable to click the button again (as the button is hidden behind, or disabled or something).
  2. If the calendar is being displayed and i use a background tap to dismiss it, then on clicking the calendar again and moving across months causes the calendar to display incorrectly (see image).

// Dismiss the keyboard and calendar when the background is tapped

  • (IBAction)backgroundTap:(id)sender
    {
    [self.pmCC dismissCalendarAnimated:NO];
    }

pmcalendar-bug

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.