Support for non Gregorian calendars

hi everyone, I have an application that needs to support two kinds of calendar systems the first one is the default calendar which uses Gregorian calendars and I need to add support for the Hijri calendar also which users can select this kind of date also.
this is Hijri calendar