Here is yet another patch, that adds recognition of two new calendar-model symbols, "Gr" and "Jl," for "Gregorian" and "Julian", respectively. (I could not use "Ju," because any regex that recognized "Ju" would also recognize the "Ju" in the months named "June" and "July.")

Now when a user specifies "Gr," the annotated date is always processed according to Gregorian rules. Likewise, when a user specifies "Jl," the annotated date is always processed according to Julian rules.

In the absence of any symbol chosen between these two, the script determines the model by examining for a date on or after October 15, 1582. Any such date is annotated as Gregorian (unless it is British Old Style, described in patch.3); an earlier date is annotated as Julian.

I understand that in the English Wikipedia, the abbreviations "OS" and "NS" (for "Old Style" and "New Style") are described as meaning "Julian calendar" and "Gregorian calendar." But this description belies the actual usage of the OS and NS abbreviations. In articles describing actual historical figures, "OS" is used /exclusively/ to describe a date beginning on March 25 and reckoned by Julian rules. "OS" is therefore /not/ a good substitute symbol for "Julian" in the English language. (However, if anyone knows any expression other than an abbreviation for the word /Julian/ that is used in any other language to specify the Julian calendar, I'll be glad to use it when I complete the internationalization of calendar-model symbols.)

In case anyone is wondering, "Why March 25?" Here's the answer: the inventor of the /Anno Domini/ notation theorized that Jesus Christ was conceived on March 25 and born on December 25. A week later was January 1, 1 AD. In England March 25 was known as "Lady Day," the "Lady" in question being Mary, described in detail in the gospels according to the evangelists Matthew and Luke. (That theory is probably not accurate, but it does explain why the English began their year on March 25 for so many centuries.)

Concerning the proleptic Gregorian calendar, the information I have received informs me that:

1. The proleptic /Gregorian/ calendar is /not/ in common use, though the proleptic /Julian/ calendar is.

2. The proleptic Gregorian calendar /does/ in fact use a "zeroth year," though the Julian calendar does not.

Perhaps the best solution will be to create two printout values, one Gregorian and one Julian, choose between them in parseXSDValue($value,$unit) (or parseDBkeys($args)), and save the other for a tooltip pop-up value. That will come next.

Temlakos
--- ../SemanticMediaWiki-lng/SMW_DV_Time.php    2009-08-11 13:48:46.000000000 
-0400
+++ ./SMW_DV_Time.php   2009-08-11 15:26:03.000000000 -0400
@@ -138,8 +138,8 @@
 
                //browse string for special abbreviations referring to year 
like AD, BC, and OS
                $is_yearbc = false;
-               if(preg_match("/(AD|BC|OS)/u", $filteredvalue, $match)){
-                       $this->m_pref = strtoupper($match[0]);
+               if(preg_match("/(AD|BC|Gr|Jl|OS)/u", $filteredvalue, $match)){
+                       $this->m_pref = $match[0];
                        if ($this->m_pref == 'BC') {
                                $is_yearbc = true;
                        }
@@ -325,18 +325,22 @@
        protected function findModel() {
                if ($this->m_pref == 'OS') {
                        $this->m_pref = ''; // Erase the OS marker; it will not 
be needed after this.
-                       return 'JU'; // Old Style dates are converted per 
Julian rules.
+                       return 'Jl'; // Old Style dates are converted per 
Julian rules.
                }
+               if (($this->m_pref == 'Gr') || ($this->m_pref == 'Jl')) 
{//Specified calendar models
+                       return $this->m_pref;
+               }
+               // Model unspecified: must be determined by examination of the 
date parts.
                if ($this->m_year > 1582) {
-                       return 'GR'; // All dates after 1582 are Gregorian 
dates.
+                       return 'Gr'; // All dates after 1582 are Gregorian 
dates.
                }
                if (($this->m_year == 1582) && ($this->m_month > 10)) {
-                       return 'GR'; // The Gregorian calendar was inaugurated 
after October 4, 1582.
+                       return 'Gr'; // The Gregorian calendar was inaugurated 
after October 4, 1582.
                }
                if (($this->m_year == 1582) && ($this->m_month == 10) && 
($this->m_day > 4)) {
-                       return 'GR';
-               } // Set $model to 'JU'
-               return 'JU';
+                       return 'Gr';
+               } // Set $model to 'Jl'
+               return 'Jl';
        }
 
        protected function parseXSDValue($value, $unit) {
@@ -545,10 +549,10 @@
         */
        protected function createJD($model) {
                switch($model) {
-                       case "GR":
+                       case "Gr":
                                $this->gregorian2JD();
                                break;
-                       case "JU":
+                       case "Jl":
                                $this->julian2JD();
                                break;
                }
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel

Reply via email to