Skip to content
Snippets Groups Projects
Commit e3894233 authored by Mirar (Pontus Hagland)'s avatar Mirar (Pontus Hagland)
Browse files

simplified.

Rev: lib/modules/Calendar.pmod/Austrian.pmod:1.2
Rev: lib/modules/Calendar.pmod/CHANGES:1.2
Rev: lib/modules/Calendar.pmod/Orthodox.pmod:1.2(DEAD)
Rev: lib/modules/Calendar.pmod/Swedish.pmod:1.2
parent e57c2a0e
Branches
Tags
No related merge requests found
// by Martin Baehr <mbaehr@email.archlab.tuwien.ac.at>
//!
//! module Calendar
//! submodule Austrian
//!
//! Same as the ISO calendar,
//! but with austrian as the default language.
//!
//! This calendar exist only for backwards compatible
//! purposes.
//!
inherit Calendar.ISO:ISO;
void create()
{
month_names=
({"jnner","feber","mrz","april","mai","juni","juli","august",
"september","oktober","november","dezember"});
week_day_names=
({"montag","dienstag","mittwoch","donnerstag",
"freitag","samstag","sonntag"});
}
class Week
{
inherit ISO::Week;
string name()
{
return "w"+(string)this->number();
}
}
class Year
{
inherit ISO::Year;
import ".";
inherit ISO:ISO;
string name()
private static mixed __initstuff=lambda()
{
if (this->number()<=0)
return (string)(1-this->number())+" v. Chr.";
return (string)this->number();
}
}
default_rules=default_rules->set_language("austrian");
}();
......@@ -174,3 +174,19 @@ Note
which should solve the problem better.
================================================================
Depricated and removed:
Calendar.Swedish and Calendar.Austrian is to be
replaced by the language rules. Those still exist
for backwards compatibility issues.
Orthodox is removed; it was based on something
that never was accepted. The Orthodox church still
uses the julian calendar to calculate the holidays;
but the holidays are better calculated using the
Events sub-module.
================================================================
// by Mirar
inherit Calendar.Gregorian : christ;
class Year
{
inherit Calendar.Gregorian.Year;
int leap() // tack, hubbe... :-)
{
switch(y%900)
{
case 0:
case 100:
case 300:
case 400:
case 500:
case 700:
case 800: return 0;
case 200:
case 600: return 1;
default: return !(y%4);
}
}
};
......@@ -3,8 +3,7 @@
//! submodule Swedish
//!
//! Same as the ISO calendar,
//! but with swedish namedays added, and
//! swedish is the default language.
//! but with swedish as the default language.
//!
//! This calendar exist only for backwards compatible
//! purposes.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment