DSLCalendarView icon indicating copy to clipboard operation
DSLCalendarView copied to clipboard

multiple selection

Open avambro opened this issue 11 years ago • 9 comments

How select multiple days of the month?

avambro avatar Jul 30 '14 21:07 avambro

This is possible.

EvgenyKarkan avatar Jul 31 '14 15:07 EvgenyKarkan

I've been testing in the examples but allows me to select date range, I try not to be so. Any idea?

avambro avatar Jul 31 '14 15:07 avambro

Oh - I understand. This is interesting & must have feature...

EvgenyKarkan avatar Jul 31 '14 16:07 EvgenyKarkan

could this be available now?

git2sunder avatar Aug 14 '14 22:08 git2sunder

i want to select multiple dates, but not exactly a range. I want to select randoms dates that comes in my response. Say i want to select the following dates 2,5,6,7,9,13,15,19,23, 29,30. how do i go about that?

manjubasha avatar Mar 23 '15 10:03 manjubasha

https://github.com/Yuyutsu/DSLCalendarView This might helps you :)

Yuyutsu avatar Mar 24 '15 04:03 Yuyutsu

Hi Yuyutsu thank you for your reply. The thing is ( ( 1427653800, 1428258600, 1428863400, 1429468200, 1430073000 ), ( 1427740200, 1428345000, 1428949800, 1429554600, 1430159400 ), ( 1427221800, 1427826600, 1428431400, 1429036200, 1429641000, 1430245800 ), ( 1427394600, 1427999400, 1428604200, 1429209000, 1429813800, 1430418600 ) )

The above given are my sample time stamps. I have to convert them to NSDate and then enable those dates alone. All the others have to be disabled. I am facing issues doing that correctly. I am not able to figure out where I am going wrong. Please help me.

manjubasha avatar Mar 25 '15 07:03 manjubasha

Hi @manjubasha ,

for a single date

DSLCalendarRange *selectedRange  =  _calendarView.selectedRange ? _calendarView.selectedRange : [[DSLCalendarRange alloc] init];//initialized

    double unixTimeStamp =1427221800;  //single date
    NSTimeInterval timeInterval=unixTimeStamp; //Unix timestamps are in seconds, the value you have looks like a number of milliseconds since 1st January 1970. If you divide by 1000

    NSDate *date = [NSDate dateWithTimeIntervalSince1970:timeInterval];

    NSCalendar *calendar = [[NSCalendar alloc]
                            initWithCalendarIdentifier:NSCalendarIdentifierGregorian];

    NSDateComponents *dayComponents =
    [calendar components:NSCalendarUnitCalendar | NSCalendarUnitYear | NSCalendarUnitMonth | NSCalendarUnitDay | NSCalendarUnitWeekday fromDate:date];

    [selectedRange selectDay:dayComponents];  
    _calendarView.selectedRange = selectedRange;

this might helps you :)

Yuyutsu avatar Mar 31 '15 08:03 Yuyutsu

Hai, I need to display selected dates from array and also need to select new date range.

Its possible?

BTManiKandan avatar Jul 09 '16 07:07 BTManiKandan