petec / dslcalendarview Goto Github PK
View Code? Open in Web Editor NEWSimple calendar view for iOS
Simple calendar view for iOS
I implemented this in xcode. I have a problem. Whenever the view controller that has the calendar class opens, it takes a couple seconds to actually open. What can I do to fix that?
Please provide choice mode like
hai,
I want to add dot marker for particular event in month view like Kal calender.Is it possible ?if yes how it possible.....Advance thanks..
I am using DSLCalendarView for displaying schedules. When month is changed, didChangeToVisibleMonth gets called. I am updating the data on this event. But I want the calendar to reload at this event too. Is it possible to refresh/reload the DSLCalendarView ?
I want to show current date selected when calendar loads.
I've tried using,
NSDate *today = [NSDate date];
NSCalendar *gregorian = [[NSCalendar alloc]
initWithCalendarIdentifier:NSGregorianCalendar];
NSDateComponents *component = [gregorian components:(NSCalendarUnitDay|NSCalendarUnitMonth|NSCalendarUnitYear) fromDate:today];
[_calendarView setSelectedRange:[[DSLCalendarRange alloc] initWithStartDay:component endDay:component]];
But its selecting each and every day into the calendar.
Any solution?
I am developing an application which allows a user to book appointment. I want to show only the doctor availability days in the calendar. Say the Dermatologist visits the hospital only on Eg: 4,8,9,10,20,21,23,25,26 i want to disable all the other days from the calendar and show a different background / color. How do i do that?
This will allow containing views/controllers to adjust their height if necessary
How to get the year alone in Calendar view? Please let me know the sample code.
I want to change date background as per some conditions,
For e.g. If it's January, and I've 11,14,15,16,20,25 dates in an NSArray, now when user showing Januaray month into the calendar, I want to mark it blue background, and others should be normal. Where I can check for this?
I reached to drawBackground method of DSLCalendarDayView, I think there its possible, but then how do I compare it with the date and the dates I've in NSArray?
Hi,
First of all thanks for a great calendar. I've been trying to modify your code to allow a user to select a start and end date by tapping and automatically selecting the dates in between. Do you have any plans to implement this feature?
This is what I have tried so far:
(DSLCalendarRange*)calendarView:(DSLCalendarView *)calendarView didDragToDay:(NSDateComponents *)day selectingRange:(DSLCalendarRange *)range {
if (!self.startDate) {
// self.startDate = [self.dateFormatter dateFromString:[NSString stringWithFormat:@"%d/%d/%d",range.startDay.month, range.startDay.day,range.startDay.year]];
//self.startDate = range.s
self.startDate = range.startDay;
self.hasSelectedStartDate = YES;
return [[DSLCalendarRange alloc] initWithStartDay:self.startDate endDay:self.startDate];
NSLog(@"start date set to: %@",self.startDate);
}
else if (self.startDate && !self.endDate)
{
//self.endDate = [self.dateFormatter dateFromString:[NSString stringWithFormat:@"%d/%d/%d",range.startDay.month, range.startDay.day,range.startDay.year]];
self.endDate = range.endDay;
NSLog(@"Start date is: %@",self.startDate);
NSLog(@"end date set to: %@",self.endDate);
return [[DSLCalendarRange alloc] initWithStartDay:self.startDate endDay:self.endDate];
} else if (self.startDate && self.endDate)
{
return [[DSLCalendarRange alloc] initWithStartDay:self.startDate endDay:self.endDate];
self.hasSelectedStartDate = NO;
}
NSLog(@"Select range programattically");
}
I also modified the touchesEnded method in DSLCalendarView.m
//added this part of code
if ([self.delegate respondsToSelector:@selector(hasSelectedStartDate)]) {
self.flag = [self.delegate performSelector:@selector(hasSelectedStartDate)];
NSLog(@"Value: %hhd",self.flag);
}
if (!self.draggedOffStartDay && [self.draggingStartDay isEqual:touchedView.day] && !self.flag) {
self.selectedRange = [[DSLCalendarRange alloc] initWithStartDay:touchedView.day endDay:touchedView.day];
}
}
But this breaks the drag to select functionality. Any help/guidance would be greatly appreciated.
Hello everyone,
I need to make the background transparent numbers of this calendar but unfortunately I encountered some problems because I noticed that if I insert a transparent background many numbers overlap for example, in addition to the number of the month 31 am also 32, 33, 34, etc. .. . how can I prevent a transparent background overlaps the numbers of the calendar? anyone has any solution for this?
I want to get list of dates from an NSArray, from the class where I'm having DSLCalendarView object, how do I pass it? Any other way to pass my dates in DSLCalendarView classes for handling?
The developer created an outstanding work, but I want to report a bug I found. He left commented one life of the code where you can change some BOOL to Yes or NO when asked if the user is allowed to select a day before today and if a user can make a selection with more than one day. By default, both features are set to NO, and the app by default allows more than one day selection and allows the user to selection any date, including a date before today. If you change ONE of this features to YES, the code works and you get what you expect, but if you change the two features to YES (i.e If you try to only let a single day selecton AND dont allow any selection before today), the method doesn't work.
I have DSLCalendarView loading in perfectly and syncing up with EventKit and when selecting a date allows you to see events in your iOS calendar from that day. However I want to take it a step further and add highlighting to dates that have events. So for example if EventKit had 2 events on Friday the 22nd of May I would like to highlight the date in the date picker, anyone have any knowledge about where to start on this?
i have set self.calendarView.delegate = self; in my UIViewController, i want to reload only calendar without re-instantiate all calendar, how can i do?
Hi,
Have problem on DSLCalendarDayView.m at line 179:
CGSize textSize = [_labelText sizeWithFont:textFont];
EXC_BAD_ACCESS
how can i fix?
The project is ARC
Hi Pete!
Thanks for developing this!
I've found that now is only possible way to add calendar - is via IBOutlet.
Trying to add it programmatically - my result is only top view with month/year and days of week header with left/right arrows. And there is no days grid. Sadly.
I am not big fan of Xib & storyboards, sorry :)
So my question is - how to add DSLCalendarView programmatically?
Thanks!
I would like to be able to choose months and years like days, will it be easy to do with the current existing functional?
Any chance the code can be updated to use iOS 8 and not use deprecated methods?
Hi,
I'm experiencing some troubles with this calendar. In some months i don't get the right number of days, as depicted below:
This happens although the "dayAsDate" and "labelText" in DSLCalendarDayView seem to be tuned, when one print them out in the console.
Does anybody know what possibly could cause this?
Thanks in advance
Hi,
Currently we have 5 or 6 rows depending on the month. Please guide me on this issue.
Thanks!
How select multiple days of the month?
Can you please merge the pull requests? There are some pull requests submitted that I could use.
Right now, we're getting days as Sun Mon Tues Wed Thu Fri Sat... Can I set day to start with Mon.. So the calendar will be displayed like, Mon Tue Wed Thu Fri Sat Sun..? Is it possible?
Suppose my current date is Jul 3, 2013, I want to restrict date selection from DSLCalendarView, something like,
User can't select before date from the above date
Only able to select a current month date
Can I set something like, user can only select dates between current month to next to next month, for eg. As current month is July, user can able to select any dates between, July, August, September.
User cannot select a weekend date?
I don't know I can achieve this with the current version of DSLCalendarView or not, please do let me know asap.
In order to be able to subclass to customize, drawRect method of DSLCalendarMonthSelectorView.m and DSLCalendarDayView.m should probably use isKindOfClass instead of isMemberOfClass, because when subclassing these two classes, the subclass is not a member of the class, and therefore the drawRect uses default drawing.
How can I programmatically choose dates? or Start with initial dates are chosen?
I tried
NSDateComponents *startDateForRange = [startingDate dslCalendarView_dayWithCalendar:self.calendarView.visibleMonth.calendar];
NSDateComponents *endDateForRange = [EndDate dslCalendarView_dayWithCalendar:self.calendarView.visibleMonth.calendar];
DSLCalendarRange *newRamnge=[[DSLCalendarRange alloc] initWithStartDay:startDateForRange endDay:endDateForRange];
[self calendarView:self.calendarView didDragToDay:endDateForRange selectingRange:newRamnge];
//[self calendarView:self.calendarView didSelectRange:newRamnge];
//startingDate and EndDate are valid nsdates
can we customize the identifier from gregorian to any identifier, for e.g.
gregorian, hebrew, islamic, indian, persian
Hello, I have developed the delegate to get the current month name and year by tapping on the title but i'm not sure how to select/highlight the whole dates within that specific month.
Any help?
Thanks
Tony
Hey guys, sorry, but i can't figure out how to actually get the first and the last date by tapping first and last not by dragging from first to last and getting the range. Is it possible to do it with taps?????????
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.