Stellarium  0.20.4
Public Member Functions | Static Public Member Functions | Static Public Attributes | Static Protected Member Functions | Static Protected Attributes
IcelandicCalendar Class Reference

The Icelandic calendar includes years, seasons (summer/winter), months (1..6 per season plus unaccounted days), weeks (1..52/53) and days (7-day week) This implementation follows CC. More...

#include <IcelandicCalendar.hpp>

Public Member Functions

 IcelandicCalendar (double jd)
 
virtual void retranslate () Q_DECL_OVERRIDE
 Translate e.g. stringlists of part names.
 
virtual void setJD (double JD) Q_DECL_OVERRIDE
 Set a calendar date from the Julian day number.
 
virtual void setDate (QVector< int > parts) Q_DECL_OVERRIDE
 set date from a vector of calendar date elements sorted from the largest to the smallest. More...
 
virtual QStringList getDateStrings () const Q_DECL_OVERRIDE
 get a stringlist of calendar date elements sorted from the largest to the smallest. More...
 
virtual QString getFormattedDateString () const Q_DECL_OVERRIDE
 get a formatted complete string for a date
 
- Public Member Functions inherited from Calendar
 Calendar (double jd)
 
virtual double getJD () const
 Get Julian day number from a calendar date.
 
virtual QVector< int > getDate () const
 get a vector of calendar date elements sorted from the largest to the smallest. More...
 
int rdCorrSum (QVector< int >factors, int corr)
 

Static Public Member Functions

static bool isLeap (int iyear)
 returns true for leap years (those with 53 weeks)
 
static int fixedFromIcelandic (QVector< int > icelandic)
 RD from {year, season, week[1...27], weekday[0...6]}.
 
static QVector< int > icelandicFromFixed (int rd)
 return year-season-week-day for RD date N.B. More...
 
static QPair< int, int > icelandicMonth (QVector< int >iDate)
 return month number in the season. More...
 
static QString icelandicMonthName (int i)
 Retrieve Icelandic month name. Numbers 1..6 for summer months, 7..12 for winter months.
 
- Static Public Member Functions inherited from Calendar
static double momentFromJD (double jd, bool respectUTCoffset=true)
 Interfacing function from Reingold/Dershowitz: Calendrical Calculations Returns a "moment" in RD that represents JD. More...
 
static int fixedFromMoment (double rd)
 
static double timeFromMoment (double rd)
 
static int fixedFromJD (double jd, bool respectUTCoffset=true)
 Interfacing function from Reingold/Dershowitz: Calendrical Calculations Returns a fixed date in RD that represents noon of JD. More...
 
static double momentFromMJD (double mjd)
 
static double jdFromMoment (double rd, bool respectUTCoffset=true)
 interfacing function from Reingold/Dershowitz: Calendrical Calculations Returns a JD from an RD "moment" (including fractions of day) Stellarium extension: optionally includes local time zone offset. More...
 
static double jdFromFixed (double rd, bool respectUTCoffset=true)
 interfacing function from Reingold/Dershowitz: Calendrical Calculations Returns a JD from an RD "moment" (including fractions of day) Stellarium extension: optionally includes local time zone offset. More...
 
static double mjdFromFixed (double rd)
 
static int dayOfWeekFromFixed (int rd)
 weekday from RD date. CC.UE(1.60).
 
static int kdayOnOrBefore (const Calendar::Day k, const int rd)
 the R.D. of the nearest weekday k on or before rd
 
static int kdayOnOrAfter (const Calendar::Day k, const int rd)
 the R.D. of the nearest weekday k on or after rd
 
static int kdayNearest (const Calendar::Day k, const int rd)
 the R.D. of the nearest weekday k around rd
 
static int kdayBefore (const Calendar::Day k, const int rd)
 the R.D. of the nearest weekday k before rd
 
static int kdayAfter (const Calendar::Day k, const int rd)
 the R.D. of the nearest weekday k after rd
 
static double modInterval (double x, double a, double b)
 Interval modulus, CC.UE 1.24. More...
 
static int modInterval (int x, int a, int b)
 Interval modulus, CC.UE 1.24: This EXCLUDES the upper limit! Use StelUtils::amod(x, b) for CC's (x)mod[1..b].
 
static int rdCorrSum (QVector< int >parts, QVector< int >factors, int corr)
 Reingold-Dershowitz CC.UE 1.48.
 
static QVector< int > toRadix (int num, QVector< int >radix)
 Split integer to mixed-radix vector. Reingold-Dershowitz CC.UE 1.42.
 

Static Public Attributes

static const int icelandicEpoch
 
- Static Public Attributes inherited from Calendar
static constexpr const double J2000 =2451545.0
 
static constexpr const double jdEpoch =-1721424.5
 
static constexpr const double mjdEpoch =678576.0
 
static constexpr const int bogus =-1000000
 

Static Protected Member Functions

static int icelandicSummer (int iyear)
 RD of April 19, AD1 (Gregorian). More...
 
static int icelandicWinter (int iyear)
 

Static Protected Attributes

static QMap< int, QString > weekDayNames
 
static QMap< int, QString > monthNames
 

Additional Inherited Members

- Public Types inherited from Calendar
enum  Day {
  sunday = 0, monday, tuesday, wednesday,
  thursday, friday, saturday
}
 enum from CC.UE-ch1.12.
 
enum  Season { spring = 0, summer = 90, autumn = 180, winter = 270 }
 
- Signals inherited from Calendar
void partsChanged (QVector< int > parts)
 
void jdChanged (double jd)
 
- Protected Attributes inherited from Calendar
double JD
 
QVector< int > parts
 date expressed as JD(UT), including day fraction (ready to interact with the main application)
 

Detailed Description

It provides proper dates after the Gregorian switchover of A.D. 1700.

Member Function Documentation

◆ getDateStrings()

virtual QStringList IcelandicCalendar::getDateStrings ( ) const
virtual

Year, Season, Month, MonthName, Week, Day, DayName

Implements Calendar.

◆ icelandicFromFixed()

static QVector<int> IcelandicCalendar::icelandicFromFixed ( int  rd)
static

This adds month over the definition given by CC

◆ icelandicMonth()

static QPair<int,int> IcelandicCalendar::icelandicMonth ( QVector< int >  iDate)
static

The first number of the pair is the month number, the second is an index to retrieve the name with icelandicMonthName(int)

◆ icelandicSummer()

static int IcelandicCalendar::icelandicSummer ( int  iyear)
staticprotected

find RD of begin of summer for Icelandic (Gregorian) year.

◆ setDate()

virtual void IcelandicCalendar::setDate ( QVector< int >  parts)
virtual

Year-Season[90=summer/270=winter]-week[1..27]-Day[1...31]

Implements Calendar.