iMash
iMash

Reputation: 1188

NSCalendar Find Saturday and Sunday of Current Month

I am working on project where I want to integrate NSCalendar functionality in my app. Hence I googled and I found this solution. It give me all months in the year and also I can select particular date. that's fine. But I wanted to disable all saturdays and sundays of every month somehow I tried to do it but when I tap previous month or next month it changes the selection. I have gone through almost all stackoverflow questions But I didn't find proper way to do it. I request you to all Is there any flexible solution on this where I can disable weekends and any particular date. The flow should be like this:

  1. Run the application current month is display and all sat & sun disabled.
  2. When tap on next month or previous month, the respective sat & sun should be disable as per that month.
  3. Functionality for any particular date that I want to disable.

Upvotes: 0

Views: 393

Answers (1)

Omar Abdelhafith
Omar Abdelhafith

Reputation: 21221

Hello i updated the files and i created an array of disabled days please check the code form here

RootViewController.m file http://shorttext.com/l7iKEdf

RootViewController.h file http://shorttext.com/lFaath

just replace these files with the original files from the link you provided you will find that i added a disabledDays NSMutableArray add any integers to it to it like following 0 = sat 6 = friday and that day will be disabled

Upvotes: 1

Related Questions