Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
TherearemanynonGregoriancalendarsusedintheworldtoday.ThispagepostsQlikscriptsforsomeofthem.
TheJuliancalendar
TheJuliancalendariseasytorecreateinamastercalendarinaQlikapp.Allyouneedtodoistogeneratealldaysina
fouryearcycleandassigntheappropriatemonthsanddaynumbers.ThefileJULN_Script.txtcontainsascriptthatdoes
this.
TheHijricalendar
TheHijricalendar,orIslamiccalendar,isapurelylunarcalendar,containing12monthsbasedonthemotionofthemoon.
ThismeansthattheHijriyearalwaysisshorterthanthetropicalyear,andthereforeitshiftswithrespecttotheGregorian
calendar.
TocreateaHijricalendar,youneedatablecontainingthemonthstarts(HIJR_Calendar.txt).Fromthis,youcangenerate
themastercalendarofyourdatamodel.Attachedyouwillalsofindtablescontainingtemplatemonthnamesandday
names.AllfilesfortheHijricalendarhavetheHIJRprefix.
Thiscalendar,likeanyotherHijricalendarbasedoncalculation,onlygivesanestimateddate.Thecalendarisnotbased
ontheactualsightingofthemoon,whichisrequiredforthebeginningofsomeofthemonths.Forapropercalendaryou
shouldcontactyourlocalMuslimscholar.
TheHebrewcalendar
TheHebrewcalendarisusedtodaypredominantlyforJewishreligiousobservances.Itisalunisolarcalendarwith12
monthsbasedonthemotionofthemoon.However,topreventtheyearfromshiftingwithrespecttotheseasons,aleap
monthisinsertedapproximatelyeverythirdyear.
TocreateaHebrewcalendar,youneedatablecontainingthemonthstarts(HEBR_Calendar.txt).Fromthis,youcan
generatethemastercalendarofyourdatamodel.Attachedyouwillalsofindtablescontainingtemplatemonthnamesand
daynames.AllfilesfortheHebrewcalendarhavetheHEBRprefix.
TheShamsicalendar
TheShamsicalendar,alsoknownasPersiancalendarortheJalaaliCalendar,isapurelysolarcalendar,containing12
monthsbasedonthezodiacconstellations.TheyearalwaysstartsatthevernalequinoxasseenfromtheTehranhorizon.
ThismeansthattheShamsicalendarnevershiftswithrespecttotheseasons.
TocreateaShamsicalendar,youneedatablecontainingthevernalequinoxes(EQNX_Equinoxes.txt).Fromthis,you
cangeneratethemastercalendarofyourdatamodel.Attachedyouwillalsofindtablescontainingtemplatemonthnames
anddaynames.AllfilesfortheShamsicalendarhavetheSHMSprefix.YoualsoneedthefileEQNX_Equinoxes.txt.
TheFrenchRepublicancalendar
TheFrenchRepublicancalendar,alsocalledtheFrenchRevolutionarycalendar,wastheofficialcalendarinFrancefrom
1793to1805.Itisapurelysolarcalendar,containing12monthswith30dayseach,andanadditional56daysattheend
oftheyear.Inthisversion,theyearalwaysstartsattheautumnalequinoxasseenfromtheParishorizon.Thismeans
thatitnevershiftswithrespecttotheseasons.
TocreateaFrenchRepublicancalendar,youneedatablecontainingtheautumnalequinoxesexpressedasGregorian
dates(EQNX_Equinoxes.txt).Fromthis,youcangenerateaFrenchRepublicanmastercalendarforyourdatamodel.
Attachedyouwillalsofindtablescontainingmonthnamesanddaynames.AllfilesfortheFrenchRepublicancalendar
havetheFREPprefix.YoualsoneedthefileEQNX_Equinoxes.txt.
Aboutthescripts
Thescriptsgenerateanumberoffields,e.g.Year,Month,Dayofmonthandfulldate.Allfieldsaredualwhereapplicable,
sotheyarecorrectlysorted.
Thealgorithmsusedforthesefivecalendarsarenotidentical,buttheyaresimilar.Thebasicstructureis:
1.Loadtheyearstarts(ormonthstarts)asGregoriandatesfromanexternaltable.Orgeneratethemfromsome
deterministicrule.
2.GenerateallGregoriandatesbetweenoneyearstartandthenext.
3.LoadnonGregorianmonthnamesandotherdatafromexternaltables,andjointheseontothecalendarusingthe
appropriatekey,e.g.nonGregorianmonthnumber.
ScriptfilesarenamedXXXX_Script.txt.Eachofthescriptfileswillrunasitisifyouincludeitinanemptyappandplace
theothersourcefilesinthesamefolderastheapp.Tousethescriptinanexistingapp,youneedtoremovethemockup
facttablefromthescript,andmayberenamesomeofthefields.
Theinformationinthesourcefileshavebeencompiledfromdifferentopensources.TheymaycontainerrorsandQlikTech
cannotassumeanyresponsibilityforsucherrorsorwhattheseerrorsmayleadtowhenthedataisused.Considerthe
filesastemplatesforhowtosolvethechallengeofimplementinganonGregoriancalendar.Useatyourownriskand
verifythatthecontentmeetstherequirementsthatyouhave.
Seealsothecorrespondingblogpost: NonGregoriancalendars.