Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect date sent to calendarView subtitleForDate:(NSDate *)date #18

Closed
workboxsoftware opened this issue Mar 27, 2015 · 9 comments
Closed

Comments

@workboxsoftware
Copy link

Looks like the date being sent to "SubtitleForDate" is incorrect. I simply echoed back the day being sent to the method which should make the subtitle the same as the day - but as you can see from the example, the subtitle doesn't match.

  • (NSString *)calendar:(FSCalendar *)calendarView subtitleForDate:(NSDate *)date

    {

    return [date fs_stringWithFormat:@"dd"];

    }

fscalendar

WenchaoD pushed a commit that referenced this issue Mar 28, 2015
1. Fix lunar problem in demo project
2. Fix issue #18
@WenchaoD
Copy link
Owner

Thanks.I just fixed it in version 0.5.2. Try it out.

@workboxsoftware
Copy link
Author

Excellent! Thank you for fixing this so quickly. Should I mark this closed? Or is that something you do? I’ve never added an “issue” on git before.

Thanks,
Bob.

PS. Really like the calendar you put together. I’m testing it out now - but it’s looking like I’ll be using it in my app.

Bob Glass
Workbox Software LLC
workboxsoftware.com

On Mar 27, 2015, at 9:59 PM, Wenchao Ding notifications@github.com wrote:

I just fixed it in version 0.5.2. Try it out.


Reply to this email directly or view it on GitHub #18 (comment).

@WenchaoD
Copy link
Owner

Would be great if you use it in your app! The issue could be left open for some days to others who wanna use it. I'll close it later~ Thanks for pointing it out. And if you still have other issue for this lib, feel free to post it here~

@workboxsoftware
Copy link
Author

Hi Wenchao -

I have another request. This is not a bug - just a cosmetic issue. About 1/2 the dates on my calendars will typically have a subtitle. When that happens, the date and subtitle get centered vertically which pushes the date up. It creates a zig-zag effect with the dates no longer aligned. I can add a blank subtitle which fixes the zig-zag issue, but then the date is no longer centered when a date is selected and the blue background is shown. This is not a “stopper” - just a nice to have fix.

Thanks,

Bob.

Bob Glass
Workbox Software LLC
workboxsoftware.com

On Mar 28, 2015, at 12:26 AM, Wenchao Ding notifications@github.com wrote:

Would be great if you use it in your app! The issue could be left open for some days to others who wanna use it. I'll close it later~ Thanks for pointing it out. And if you still have others issues for this, feel free to post it here~


Reply to this email directly or view it on GitHub #18 (comment).

@WenchaoD
Copy link
Owner

Hey, Bob:
I really haven't thought about this zig-zag problem. But if you want the day cell align neatly, the date text centainly wouldn't center. So you need to only center the selected cell?

@workboxsoftware
Copy link
Author

Hi Wenchao -

I can see that there’s no great solution to this. Maybe if I could center the highlighted days it would look better - not sure though - I’d have to see. It’s not that bad - most people wouldn’t notice the zig-zag.

I have another request. I’d like to select the 1st of the month whenever a user switches months - similar to the way the iPhone Calendar works. But the following didn’t work - the screen just hung. Any suggestions?

  • (void)calendarCurrentMonthDidChange:(FSCalendar *)calendar
    {
    NSLog(@"did change to month %@",[calendar.currentMonth fs_stringWithFormat:@"MMMM yyyy"]);
    NSDate *date = [[calendar currentMonth] beginningOfMonth];
    _fsCalendar.selectedDate = date;
    }

Bob Glass
Workbox Software LLC
workboxsoftware.com

On Mar 31, 2015, at 1:38 AM, Wenchao Ding notifications@github.com wrote:

Hey, Bob:
I really haven't thought about this zig-zag problem. But if you want the day cell align neatly, the date text centainly wouldn't center. So you need to only center the selected cell?


Reply to this email directly or view it on GitHub #18 (comment).

@WenchaoD
Copy link
Owner

WenchaoD commented Apr 1, 2015

I see. You can try to add a conditional checking in setSelectedDate around [self scrollToDate:_currentMonth]

if (!_collectionView.tracking && !_collectionView.decelerating) {
    [self scrollToDate:_currentMonth];
}

I think it would work.

@workboxsoftware
Copy link
Author

Hi Wenchao -

I think I found a couple of bugs. Here’s how to reproduce the first one.

Run the Example.
Switch to Vertical
Scroll backwards to January.
Go to Settings and select April 1st.
To the left of April 1st is March 31st. If you tap that date you go to May instead of March.

The other bug is that the routine doesn’t always scroll the selected date. Here’s how to reproduce:
Run the example
Switch to Vertical
Scroll to May
Select April 1st from settings screen. (this will work)
Scroll to May
Select April 1st from settings screen (this will not scroll back to April).

Let me know what you think -

Thanks,
Bob.

Bob Glass
Workbox Software LLC
workboxsoftware.com

On Mar 31, 2015, at 9:47 PM, Wenchao Ding notifications@github.com wrote:

I see. You can try to add a conditional checking in setSelectedDate around [self scrollToDate:_currentMonth]

if (!_collectionView.tracking && !_collectionView.decelerating) {
[self scrollToDate:_currentMonth];
}
I think it would work.


Reply to this email directly or view it on GitHub #18 (comment).

@WenchaoD
Copy link
Owner

WenchaoD commented Apr 4, 2015

  • The first one can not be reproduced now. Maybe because I just fixed another issue and deliberately fix that one too~
  • The reason for the second one is that the selectedDate is already the date you wanna select. So it did't perform a selection action. So your idea is that selectedDate should always be scrolled to even it is already a selectedDate?

As this is already a long page and the original idea of 'issue', I think it would be better to open a new issue if the future problem is not directively relative to this topic:)

@WenchaoD WenchaoD closed this as completed Apr 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants