Persian Calendar

approved

by karfekr

Persian Calendar for managing periodic notes based on persian solar (shamsi) calendar.

108 stars8,498 downloadsUpdated 29d ago

فارسی / English

"Persian Calendar" Plugin for Obsidian

This plugin adds the Solar Hijri calendar alongside the Gregorian and Lunar Hijri calendars to Obsidian, offering Iranian users a more pleasant journaling experience.

preview
Related to previous versions of the plugin

Installation Guide

First method (recommended)

You can install this plugin by searching for Persian Calendar in Obsidian's Community plugins.

Second method

You can visit the Releases section of this GitHub page, download the plugin's executable files -main.js, manifest.json and styles.css- and move them to the following path:

[Your Vault Address]/.obsidian/plugins/persian-calendar

Guide to the Essential Features

Dynamic Paths

You can set the paths for your calendar notes dynamically.

Dynamic PathSample ValueDescription
jYYYY1404Four-digit Solar Hijri year
jQQQQپاییز (Autumn)Full name of the Solar Hijri season
jQQ03Two-digit Solar Hijri season number
jQ3Solar Hijri season number
jMMMMآذر (Azar)Full name of the Solar Hijri month
jMM09Two-digit Solar Hijri month number
jM9Solar Hijri month number
default path
Default note paths

Quick Reference to Calendar Notes

Using the @ symbol, you can quickly reference your calendar notes.

  • Days: امروز، دیروز، فردا، پریروز، پس‌فردا
  • Days of the week: (نام روز جاری)، روز بعد، روز قبل
  • Weeks: این هفته، هفته قبل، هفته بعد
  • Months: این ماه، ماه قبل، ماه بعد
  • Seasons: این فصل، فصل قبل، فصل بعد
  • Years: امسال، سال قبل، سال بعد

You can also select the desired phrase in the text and link it to the corresponding note by executing the related command.

preview
Related to previous versions of the plugin

Placeholders

By inserting the following placeholders into your note templates, you can include your desired text in the final result.

By typing {{}} you can receive suggestions for choosing your placeholder.

Daily Note Placeholders

Only replaced in daily notes.

PlaceholderSample OutputDescription
{{تاریخ شمسی یادداشت}}1404-11-30Solar Hijri date of the daily note
{{تاریخ میلادی یادداشت}}2026-02-19Gregorian date of the daily note
{{تاریخ قمری یادداشت}}1447-09-01Lunar Hijri date of the daily note
{{روز هفته یادداشت}}پنجشنبه (Thursday)Name of the day of the week
{{روز ماه یادداشت}}30Day of the month
{{مناسبت یادداشت}}Event textEvents of the daily note's date

Weekly Placeholders

Work in daily notes and weekly notes.

PlaceholderSample OutputDescription
{{هفته یادداشت}}1404-W49Week identifier
{{اول هفته}}2026-02-14Start date of the week (Gregorian)
{{آخر هفته}}2026-02-20End date of the week (Gregorian)

Monthly Placeholders

Work in daily notes and monthly notes.

PlaceholderSample OutputDescription
{{ماه یادداشت}}1404-11Month identifier
{{نام ماه یادداشت}}بهمن (Bahman)Name of the Solar Hijri month
{{اول ماه}}2026-01-21Start date of the month (Gregorian)
{{آخر ماه}}2026-02-19End date of the month (Gregorian)

Seasonal Placeholders

Work in daily notes, monthly notes, and seasonal notes.

PlaceholderSample OutputDescription
{{فصل یادداشت}}1404-S4Season identifier
{{نام فصل یادداشت}}زمستان (Winter)Name of the season
{{اول فصل}}2025-12-22Start date of the season (Gregorian)
{{آخر فصل}}2026-03-21End date of the season (Gregorian)

Yearly Placeholders

Work in daily, weekly, monthly, and yearly notes.

PlaceholderSample OutputDescription
{{سال یادداشت}}1404Solar Hijri year
{{اول سال}}2025-03-21Start date of the year (Gregorian)
{{آخر سال}}2026-03-20End date of the year (Gregorian)

Current Time Placeholders

These always return today's date, regardless of the note type.

PlaceholderSample OutputDescription
{{تاریخ شمسی جاری}}1404-11-26Today's Solar Hijri date
{{تاریخ میلادی جاری}}2026-02-15Today's Gregorian date
{{تاریخ قمری جاری}}1447-08-26Today's Lunar Hijri date
{{روز هفته جاری}}یکشنبه (Sunday)Name of today's weekday
{{روز ماه جاری}}26Today's day of the month
{{هفته جاری}}1404-W49Current week identifier
{{نام ماه جاری}}بهمن (Bahman)Name of the current month
{{ماه جاری}}1404-11Current month identifier
{{نام فصل جاری}}زمستان (Winter)Name of the current season
{{فصل جاری}}1404-S4Current season identifier
{{سال جاری}}1404Current year
{{مناسبت جاری}}Event textToday's events

Elapsed and Remaining Days

By default, calculated relative to the daily note's date; if placed in a non-daily note, they use today's date.

PlaceholderSample OutputDescription
{{روزهای گذشته سال}}334Days passed since the beginning of the year
{{روزهای باقیمانده سال}}31Days remaining until the end of the year
{{روزهای گذشته فصل}}58Days passed since the beginning of the season
{{روزهای باقیمانده فصل}}31Days remaining until the end of the season
{{روزهای گذشته ماه}}28Days passed since the beginning of the month
{{روزهای باقیمانده ماه}}2Days remaining until the end of the month

Using the Dedicated API

This plugin provides a public API so you can use features like date and number conversion in other plugins and scripts (such as DataviewJS or Templater).

const pcApi = app.plugins.getPlugin("persian-calendar").api;

// Number conversion
pcApi.toEnNumber("۱۲۳ تست test"); // "123 تست test"
pcApi.toFaNumber("123 تست test"); // "۱۲۳ تست test"

// Solar Hijri date conversion
pcApi.jalaliToDate(1405, 9, 13); // Equivalent Gregorian date as Date object
pcApi.jalaliToGregorian(1405, 9, 13); // {gy: 2026, gm: 12, gd: 4}
pcApi.jalaliToHijri(1405, 9, 13); // (Iran basis) {hy: 1448, hm: 6, hd: 24}
pcApi.jalaliToHijri(1405, 9, 13, { base: "umalqura" }); // (Umm al-Qura basis) {hy: 1448, hm: 6, hd: 24}
pcApi.jalaliMonthName(9); // آذر (Azar)
pcApi.jalaliMonthName(9, "en"); // Azar
pcApi.seasonName(3); // پاییز (Autumn)
pcApi.seasonName(3, "en"); // Autumn

// Gregorian date conversion
pcApi.dateToGregorian(new Date()); // {gy, gm, gd}
pcApi.gregorianToDate(2026, 12, 4); // Date object
pcApi.gregorianToJalali(2026, 12, 4); // {jy: 1405, jm: 9, jd: 13}
pcApi.gregorianToHijri(2026, 12, 4); // (Iran) {hy: 1448, hm: 6, hd: 24}
pcApi.gregorianToHijri(2026, 12, 4, { base: "umalqura" }); // (Umm al-Qura) {hy: 1448, hm: 6, hd: 24}

// Lunar Hijri date conversion (Iran basis)
pcApi.hijriToDate(1448, 6, 24); // Date object
pcApi.hijriToGregorian(1448, 6, 24); // {gy: 2026, gm: 12, gd: 4}
pcApi.hijriToJalali(1448, 6, 24); // {jy: 1405, jm: 9, jd: 13}

// Lunar Hijri date conversion (Umm al-Qura basis)
pcApi.hijriToDate(1448, 6, 24, { base: "umalqura" }); // Date object
pcApi.hijriToGregorian(1448, 6, 24, { base: "umalqura" }); // {gy: 2026, gm: 12, gd: 4}
pcApi.hijriToJalali(1448, 6, 24, { base: "umalqura" }); // {jy: 1405, jm: 9, jd: 13}

// Events
pcApi.checkHoliday(new Date()); // Is it a holiday? true/false
pcApi.dateToEvents(new Date()); // Array of {title(fa/en), categories, isHoliday}
pcApi.dateToEvents(new Date(), { base: "umalqura" }); // With Umm al-Qura basis

Other Features

view
  • Display of official Iranian holidays on the calendar
  • Display of Iran's official calendar events and international observances
  • Option to "Open today's daily note on startup," user configurable
  • Customizable display of calendar events
  • Option to create and display seasonal notes, user configurable
  • Confirmation dialog before creating calendar notes, user configurable
  • Option to set the user interface to Persian or English
  • Ability to configure calendar note templates
  • Ability to set the Lunar Hijri calendar based on Iran's Crescent Committee or Saudi Arabia's Umm al-Qura
  • Option to display the Gregorian or Lunar Hijri calendar as supplementary calendars
  • Ability to use a dedicated date picker when setting a property with type date
  • Users can use this plugin's default font named "Persian Calendar"

Collaboration and Project Participation

This plugin has been developed with love, for non-commercial purposes, and under this license.

You can support our continued efforts in the following ways:

  • Contribute to the development of this plugin
  • Report bugs or suggest a feature for development via the Issues section on this GitHub page
  • Recommend installing and using this plugin to your friends
  • Follow our website and Telegram channel

Website Telegram Channel Telegram Group

For plugin developers

Search results and similarity scores are powered by semantic analysis of your plugin's README. If your plugin isn't appearing for searches you'd expect, try updating your README to clearly describe your plugin's purpose, features, and use cases.