Skip to main content
By default, Ramadan CLI uses the Hijri calendar from the Aladhan API to determine when Ramadan begins. However, you can override this with a custom first roza date to match your local community’s moon sighting or personal preference.

Why Use a Custom Date?

Different Islamic communities may begin Ramadan on different dates based on:
  • Local moon sighting: Some communities follow physical moon sightings rather than calculations
  • Different calculation methods: Various Islamic organizations may declare different start dates
  • Geographic variations: Moon visibility varies by location
  • Following specific authorities: Your community may follow a specific Islamic authority’s declaration
The custom first roza date feature lets you align Ramadan CLI with your community’s actual observance while still getting accurate prayer times.

Setting a Custom First Roza Date

Use the --first-roza-date flag with a date in YYYY-MM-DD format:
This sets March 1, 2026 as the first day of Ramadan and persists this date to your configuration.

Date Format

The date must be in ISO 8601 format: YYYY-MM-DD

Validation

The date is validated to ensure it’s a real calendar date:
Invalid dates will show an error:

How Custom Dates Work

Persistent Storage

Once set, the custom first roza date is saved to your configuration file:
The date is stored in ~/.config/ramadan-cli/config.json (or $RAMADAN_CLI_CONFIG_DIR if set).

Automatic Roza Number Calculation

With a custom first roza date, Ramadan CLI calculates the current roza number based on the number of days since that date:
Example:
  • First roza date: March 1, 2026
  • Today’s date: March 15, 2026
  • Roza number: 15 (15 days since start)

Calendar Generation

When a custom first roza date is set, the full calendar is generated by fetching prayer times for 30 consecutive days:
This ensures accurate prayer times for each day, regardless of when Ramadan actually falls in the Hijri calendar.

Using Custom Dates

View Today with Custom Date

If today is March 15, 2026:
The Hijri date shown in the output comes from the API’s calculation, which may differ from your custom Gregorian start date. The Roza number is what’s calculated from your custom date.

View Full Calendar with Custom Date

This shows 30 days starting from March 1, 2026:

Specific Roza with Custom Date

Shows prayer times for March 27, 2026 (27th day from March 1).

JSON Output with Custom Date

The JSON output uses your custom date for calculations:

Clearing the Custom Date

Use the --clear-first-roza-date flag to remove the stored custom date and return to API-based Hijri calendar:
After clearing, Ramadan CLI will use the Hijri calendar from the API again.
If you provide both --first-roza-date and --clear-first-roza-date, the clear flag takes precedence.

Precedence and Storage

Configuration Resolution

Where It’s Stored

Default location:
Custom location (via environment variable):

Viewing Stored Configuration

Before Ramadan Behavior

If the current date is before your custom first roza date:
When before Ramadan, the CLI shows timings for the first roza and calculates the countdown to the first Sehar.

After Ramadan Behavior

If the current date is more than 30 days after your custom first roza date, the CLI still uses your custom calendar but annotations may not appear:
The current day calculation will show roza 35, but since Ramadan only has 30 days, viewing the calendar will show days 1-30.

Performance Considerations

API Calls

1 API call to fetch the entire Hijri month 9 (Ramadan)Fast ⚡

Caching

The custom first roza date is cached in your config file, so you don’t need to specify it on every run:

Common Use Cases

Following Local Masjid

Different Calculation Methods

Testing Future Ramadan

Resetting Everything

To clear both the custom date and all other configuration:
This removes:
  • Saved location
  • Prayer calculation method and school
  • Custom first roza date
  • Timezone preferences
You’ll be prompted for first-run setup on the next run.

Country-Specific Recommendations

Even when using a custom first roza date, Ramadan CLI still applies country-specific recommended calculation methods:
This ensures accurate prayer times for your location even when overriding the Ramadan start date.