Persian Calendar View

[Discontinued] PersianCalendarView - تقویم فارسی اندروید

Discontinuation notice.

I won't be updating this library anymore. But pull requests are still welcome.

Persian calendar view for android based on ebraminio's DroidPersianCalendar open-source project.


First add jitpack to your projects build.gradle file

allprojects {
    repositories {
        maven { url "" }

Then add the dependency in modules build.gradle file

dependencies {
    compile 'com.github.roojin:persian-calendar-view:1.2.2'

now just simply add PersianCalendarView to your layouts


Sample App is provided to demonstrate the basic scenario.

You can also interact with the sample app in this Page



Attribute Type Description
pcv_typefacePath string Path to custom font in assets folder
pcv_headersTypefacePath string Path to custom font for header in assets folder
pcv_colorBackground color Calendar's background color
pcv_colorHoliday color Text color of holidays
pcv_colorHolidaySelected color Text color of holidays when selected
pcv_colorNormalDay color Text color of normal days
pcv_colorNormalDaySelected color Text color of normal days when selected
pcv_colorDayName color Text color of day name headers
pcv_eventUnderlineColor color Underline color of days with events
pcv_todayBackground reference Background resource used to highlight today
pcv_selectedDayBackground reference Background resource used to highlight selected day
pcv_fontSize dimension Day digits font size
pcv_headersFontSize dimension Day name headers font size


Most of the functionalities are inside the handler class. you can get it like this

  PersianCalendarView calendarView  = (PersianCalendarView) findViewById(;
  PersianCalendarHandler calendarHandler = persianCalendarView.getCalendar();
                PersianDate today = calendar.getToday();


The library includes official events but you can also add your own events to it

Adding local events

// Add an event called "Custom event" to this day
calendarHandler.addLocalEvent(new CalendarEvent(calendar.getToday(), "Custom event", false));
// Add an event called "Custom event 2" to 12 days later
calendarHandler.addLocalEvent(new CalendarEvent(today.clone().rollDay(12,true), "Custom event 2", true));
// Add an event called "Custom event 3" to 1399/1/10 later
calendarHandler.addLocalEvent(new CalendarEvent(new PersianDate(1399,1,10), "Custom event 2", true));

Getting events for specific day

PersianDate today = calendar.getToday();


currently you can set Click, LongClick and MonthChange listeners on PersianCalendarView

void setOnDayClickedListener(OnDayClickedListener listener)
void setOnDayLongClickedListener(OnDayLongClickedListener listener)
void setOnMonthChangedListener(OnMonthChangedListener listener)

Other functions of PersianCalendarView

void update()
void goToDate(PersianDate date)
void goToToday()
void goToNextMonth()
void goToPreviousMonth()
void goToMonthFromNow(int offset)
PersianCalendarHandler getCalendar()

Useful methods of PersianCalendarHandler

PersianDate getToday()
// These ones Convert english digits to persian
String formatNumber(int number) 
String formatNumber(String number)
// Converts classes inherited from AbstractDate class to date string
String dateToString(AbstractDate date)
String dayTitleSummary
String dayTitleSummary(PersianDate persianDate)
String getMonthName(AbstractDate date)
String getWeekDayName(AbstractDate date)
List<CalendarEvent> getOfficialEventsForDay(PersianDate day)
List<CalendarEvent> getAllEventsForDay(PersianDate day)
List<CalendarEvent> getLocalEvents()
List<CalendarEvent> getLocalEventsForDay(PersianDate day)
String getEventsTitle(PersianDate day, boolean holiday)
// These ones also have getters
PersianCalendarHandler setMonthNames(String[] monthNames)
PersianCalendarHandler setWeekDaysNames(String[] weekDaysNames)
PersianCalendarHandler setTypeface(Typeface typeface)
PersianCalendarHandler setColorBackground(int colorBackground) 
PersianCalendarHandler setColorDayName(int colorDayName)
PersianCalendarHandler setColorHoliday(int colorHoliday)
PersianCalendarHandler setColorHolidaySelected(int colorHolidaySelected)
PersianCalendarHandler setColorNormalDay(int colorNormalDay)
PersianCalendarHandler setColorNormalDaySelected(int colorNormalDaySelected)
PersianCalendarHandler setColorEventUnderline(int colorEventUnderline)
PersianCalendarHandler setDaysFontSize(int daysFontSize)
PersianCalendarHandler setHeadersFontSize(int headersFontSize)
PersianCalendarHandler setTodayBackground(int todayBackground)
PersianCalendarHandler setSelectedDayBackground(int selectedDayBackground)
PersianCalendarHandler setHighlightOfficialEvents(boolean highlightOfficialEvents)
PersianCalendarHandler setHighlightLocalEvents(boolean highlightLocalEvents)


If you want to use this library with Xamarin or Basic4Android you can use the following links. I didn't test any of these myself but I guess they may work fine.

using with Xamarin

take a look at issue #11

Using with B4A


  • Make it even more flexible and customizable
  • Clean it up


Any contributions are welcome. just fork it and submit your changes to your fork and then create a pull request


Special thanks to ebrahimino for his open-source project which this library is based on


Roojin co

Roojin co (Github page)