How to calculate any date from current day, day in week, month and year?

175 Views Asked by At

I am implementing Calendar View for my iOS application. I am using Date structure for calculating date. But, manually I am stuck with following things. I need formulae for calculation between days depends upon current date.

For Example:

Need to find following categorise depends upon the current date.

Where current date,

let date = 07

let month = 11

let weekDay = 03 (Tuesday)

let year = 2017

Find:

  1. Week day of this month where date is 01.
  2. Week day of last month end date and start date.
  3. Week day of current date on 2018.

Please give me the answer if you know at least one of 3 questions.