Page MenuHomePhabricator

Enhancements to SMW_DV_Time.php, the Date script
Closed, DeclinedPublic

Description

Author: temlakos

Description:
This patch expands the list of supported ordinal suffixes to include "er" for "premier" (French for "first").

The Date script supports English ordinal abbreviations but not those of other languages, e.g. French. Also, the tooltip is limited to giving the date in the proleptic Gregorian calendar and doesn't give it in another commonly used calendar, i.e. the modern Hebrew calendar. Several patches will be submitted to provide enhancements to the Date script, as each enhancement is tested in a working Wiki environment.


Version: unspecified
Severity: enhancement

Attached:

Details

Reference
bz21008

Event Timeline

bzimport raised the priority of this task from to Lowest.Nov 21 2014, 10:48 PM
bzimport set Reference to bz21008.

temlakos wrote:

This patch adds a line to the Tooltip dialog, so that the Gregorian and Hebrew calendars display side-by-side in the dialog balloon.

This patch is in addition to the other patch submitted here.

Attached:

temlakos wrote:

Adds functionality for accepting input in classical Hebrew number strings and producing classical Hebrew numbers as output in Hebrew or Biblical dates. Also adds Biblical date to Tooltip dialog.

Apply in order after Patches 6631 and 6632.

Attached:

temlakos wrote:

Concerning Patch 6641: The enhancements in this patch have been tested in an actual Hebrew Wiki environment. They support the input of a date in either the Hillel II or Biblical calendar, using the classical numbering system that is in use tday in Hebrew publications. (See, for example, http://inn.co.il, the native site for Arutz-7, the Israel National News service.)

When filling in a date with all three parts, you can put in the two parts of a year number (the short thousands part and the longer hundreds-tens-ones part) separated by spaces, and the script will still treat that as one number and render it properly. (This is on account of its position in the string; all purely RTL strings are read RTL.) But if you use a year only, or a year and a month, you must use an underscore (_) to tie the thousands part and the mantissa together. If you do not, then you will see those two parts of the year misinterpreted as separate parts of a date, say a year and a month, or even a year and a day, with results that are unpredictable but will not necessarily generate an improper value. (Typically, if you specify 5770 in Hebrew, you'll get back "Av of the Hebrew year 770." And if you were to specify, say, "Tishrei 5770", you would get back "Fifth day in Tishrei in the Hebrew year 770.")

To specify the Hebrew (or Biblical) year 1000, type "elef" in Hebrew (as aleph-lamed-final pe). To specify 2000, type "alpayim" (aleph-lamed-pe-yod-yod-final mem). To specify 3000, write "gimel <space> aleph-lamed-pe-yod-final mem" and that will translate literally as three thousand. (Recall that Hebrew has no zero.)

Warning: A number ending in "ayin-beth" for -72 might be confused with the symbol "ayin-beth" for "Iv-" (for "Ivrit", the native name of Hebrew). To avoid this, substitute any non-Hebrew-alephbetic character between the ayin and the beth. I prefer the gershayim, which is a special Hebrew double prime. The script will simply ignore it, and it conforms to common Hebrew usage: single-"digit" numbers are followed by a prime, and multi-"digit" numbers have a double prime between the last "digit" and the next-to-last. Your character-map applet should have the Hebrew gerash (prime) and gershayim (double prime) characters available. (The primes and double primes do not appear in the tooltip dialog or a browser output, because most browers cannot render them properly, and they look ugly.)

Support for historical calendar models and time zones has now been included into SMW. The features that are suggested in this bug report, however, were found to be too specific for most applications of SMW and the patches are thus not applied to SMW core. For example, most users of SMW would find it rather unsuitable if dates for, say, upcoming meetings would now feature a tooltip that shows the time using the Julian calendar.

At the same time, we see the need for allowing datatype extensions to SMW, and SMW 1.5.0 thus further improves datatype extendibility. We are currently working out the best solution for internationalisation of related strings (the SMW language files are not optimal anyway, and are even more cumbersome if used for extensions). A good solution would thus be to publish the historic date type as an extension to SMW.