Skip to content

PrayerTimes v2.0.0 - Prayer Time Calculations

Choose a tag to compare

@a-saab a-saab released this 22 Dec 19:28
· 3 commits to main since this release

PrayerTimes v2.0.0 Release

A major update bringing production-grade robustness to Islamic prayer time calculations while maintaining 100% backward compatibility with v1.x code.

🎯 What's New in v2.0

✅ Input Validation & Error Handling

  • NEW: Coordinate validation (±90° latitude, ±180° longitude)
  • NEW: Date validation with leap year support (1900-2100)
  • NEW: Diagnostic error messages via PrayerTimesResult.errorMessage
  • NEW: isInitialized() method to verify coordinate validity
  • Prevents silent failures from invalid inputs

🌍 High-Latitude Polar Region Support

  • NEW: Automatic Arctic/Antarctic circle detection (isHighLatitude())
  • NEW: Four adjustment methods for extreme latitudes: NONE, MIDDLE_OF_NIGHT, ONE_SEVENTH, ANGLE_BASED
  • NEW: Smart defaults automatically apply MIDDLE_OF_NIGHT for locations >66.6°
  • NEW: getLatitude() method for location queries
  • Tested extensively with Tromsø, Norway (69.6°N) winter solstice

🕐 Enhanced Functionality

  • NEW: calculateWithOffset() for DST and timezone adjustments
  • NEW: Minute-based timezone offsets (supports fractional timezones like UTC+5:30, UTC+5:45)
  • NEW: Expanded to 20+ pre-configured calculation methods
  • Existing manual adjustment fine-tuning still available

📚 Better Documentation & Examples

  • NEW: Comprehensive Quick Start in README.md
  • NEW: Advanced_Error_Handling.ino with 7 test cases
  • ENHANCED: Multi-City_Test.ino with 5 global locations (including polar region)
  • ENHANCED: IDE syntax highlighting for new methods and enums

🔄 Backward Compatibility with v1.x

✅ All v1.x code works unchanged:

  • Legacy calculate() method with 12 output parameters still supported
  • All existing calculation methods still available
  • Manual adjustments work exactly as before
  • Time formatting utilities (formatTime12, formatTime24) unchanged
  • Default behavior identical for valid inputs
// V1.x code continues to work in v2.0
PrayerTimes pt(45.5017, -73.5673, -300);
pt.setCalculationMethod(CalculationMethods::ISNA);
pt.setAdjustments(0, 0, 0, 0, 0, 0);

int fajrH, fajrM;
pt.calculate(22, 12, 2025, fajrH, fajrM, ...);  // Still works!