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

add date on supplementaryView #228

Closed
Xc0d3dev opened this issue Feb 12, 2016 · 3 comments
Closed

add date on supplementaryView #228

Xc0d3dev opened this issue Feb 12, 2016 · 3 comments

Comments

@Xc0d3dev
Copy link

Hi, what is step to add new date on supplementaryView.

func supplementaryView(shouldDisplayOnDayView dayView: DayView) -> Bool {
        if (Int(arc4random_uniform(5)) == 1) {

            return true

        }
        return false
    }

@elsesiy
Copy link
Member

elsesiy commented Feb 12, 2016

@Xc0d3dev Sorry, I don't understand what the question is here...Could you please specify what you need to know to have this issue closed? Thanks!

@Xc0d3dev
Copy link
Author

I want to add a new event specific date.Apparently this is done randomly.I want to do it with a constant.
The demo does not show anything to help .there is no example in the documentation .

@Xc0d3dev
Copy link
Author

Has been solved. Code Here. Date array is add date

func supplementaryView(shouldDisplayOnDayView dayView: DayView) -> Bool {
    let dateformatter = NSDateFormatter()
    dateformatter.dateFormat = "yyyy/MM/dd"
    let date2 = dateformatter.stringFromDate(dayView.date.convertedDate()!)
    let date_Array = ["2016/02/10","2016/02/11","2016/02/12"]
    for(var i=0;i<date_Array.count;i++)
    {
        if(date2==date_Array[i])
        {
            return true
        }
    }
    return false
}

}

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

3 participants