Wednesday, July 4, 2012

Sharepoint Change Site Calendar type

using (SPSite oSiteCollection = new SPSite("http://localhost:2020"))
{
    using(SPWeb oWebsiteRoot = oSiteCollection.RootWeb)
    {
        SPRegionalSettings oRegionalSettings = oWebsiteRoot.RegionalSettings;
        oRegionalSettings.CalendarType = 6;  // Hijri Calendar
        oRegionalSettings.AdjustHijriDays = 2;

        oWebsiteRoot.Update();
    }
}

  CalendarType property  values:
  • 0 — None
  • 1 — Gregorian
  • 3 — Japanese Emperor Era
  • 5 — Korean Tangun Era
  • 6 — Hijri
  • 7 — Buddhist
  • 8 — Hebrew Lunar
  • 9 — Gregorian Middle East French Calendar
  • 10 — Gregorian Arabic Calendar
  • 11 — Gregorian Transliterated English Calendar
  • 12 — Gregorian Transliterated French Calendar
  • 16 — Saka Era


naadydev@gmail.com

No comments: