Comments (1)
I know this question was asked long time ago. But I don't think this is a problem about the library. Calendar marked the last date because -markDates was called only once. Please refer to the code below.
__block NSMutableArray *dateMarkers = [[NSMutableArray alloc] init];
__block NSMutableArray *dateMarkersColor = [[NSMutableArray alloc] init];
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
NSArray *test = [NSArray arrayWithObjects:@"2013-07-22",@"2013-07-23",@"2013-08-09",nil];
NSDateFormatter *dateFormat = [[NSDateFormatter alloc] init];
[dateFormat setDateFormat:@"yyyy-MM-dd"];
NSCalendar *gregorian = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar];
for (int i=0; i<test.count;i++){
NSDate *mydate = [dateFormat dateFromString:[test objectAtIndex:i]];
NSDateComponents *components = [gregorian components:NSMonthCalendarUnit fromDate:mydate];
if (month == components.month) {
[dateMarkers addObject:mydate];
[dateMarkersColor addObject:[UIColor redColor]];
}
}
dispatch_async(dispatch_get_main_queue(), ^{
[calendarView markDates:dateMarkers withColors:dateMarkersColor];
});
});
from vurig-calendar.
Related Issues (20)
- ARC? HOT 1
- Please add the license in the code it still says // Copyright (c) 2012 Vurig Media. All rights reserved.
- Voice Over accessibility for blind people.
- how can i get Two Dates When I select Them HOT 2
- Draw markings HOT 1
- No Year Provided in switchedToMonth: delegate method
- Date Issue HOT 2
- Background Color HOT 1
- How to start from sunday? HOT 4
- change month programmatically
- Show only weekdays
- Disable dates to be choosen HOT 2
- IOS 7 ? HOT 1
- Its possible to mark only future dates?
- Select multiple date
- dateSelected delegate method returns incorrect day HOT 5
- how to change height in tableviewCell HOT 1
- Is it possible to change the text and background color and add some extra text to day cell? HOT 1
- showNextMonth not respond to delegate method
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vurig-calendar.