Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • how to create islamic calendar (hijri calendar) using iOS sdks

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 1.63k
    Comment on it

    Following code will return the today's date in islamic calendar

      NSCalendar *hijriCalendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSIslamicCivilCalendar];
    
    
      NSDateComponents *hijriComponents = [hijriCalendar components:NSDayCalendarUnit | NSMonthCalendarUnit | NSYearCalendarUnit fromDate:[NSDate date]];
    

    To get the current day of hijri calendar :

    (long)[hijriComponents day]
    

    To get the current month of hijri calendar :

    (long)[hijriComponents month]
    

    To get the current year of hijri calendar :

    (long)[hijriComponents year]
    

    Gregorian calendar =Islamic calendar

    Jan = Muharram
    Feb= safar
    March=Rabi' I
    April=Rabi' II
    May=Jumada I
    June=Jumada II
    July=Rajab
    August=Sha'ban
    September =Ramadan
    October =Shawwal
    Nov=Dhu al-Qidah
    Dec=Dhu al-Hijjah
    

    so if

    (long)[hijriComponents month] 
    

    return 1 means Muharram in hijri calendar

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: