BetaMasaheft / Documentation

Die Schriftkultur des christlichen Äthiopiens: Eine multimediale Forschungsumgebung
3 stars 3 forks source link

Ethiopic Calendar formatted dates #1271

Closed PietroLiuzzo closed 3 years ago

PietroLiuzzo commented 4 years ago

There is at the moment no proper visualization of dates. While we ought to provide standard gregorian, we could also provide Ethiopic calendar

Describe the solution you'd like How to format the date for Ethiopic calendar

Describe alternatives you've considered None yet

SophiaD-M commented 4 years ago

There are apps for this taks: https://www.metaappz.com/Ethiopian_Date_Converter/Default.aspx (this is a random one, there might be better) Maybe its possible to implement it to BM? Or to give the link?

PietroLiuzzo commented 4 years ago

thanks, I will look at how they format dates in their code

thea-m commented 4 years ago

Might this issue be somehow related to the fact that the calendar attributes list in the schema is currently commented out? Can it be de-commented?

PietroLiuzzo commented 4 years ago

calendar section in schema is not commented out any more

PietroLiuzzo commented 4 years ago

perhaps @smaugustine has something to suggest here? a js solution? I remember your calendar...

smaugustine commented 4 years ago

@PietroLiuzzo, I was just about to write something to you regarding this. The issue with most available code is that it is not concerned with pre-Gregorian dates (that is to say, virtually every existing calendar converter will produce incorrect dates for those before 1582). Also, there is little code already available to aid with other important dating calculations (evangelist year, Easter computus, etc.).

This is the app I finally put together some months ago (see here for the relevant JS, which includes both calendar conversion and Computus-related functions). I'm happy to discuss sometime in more detail the methods of calculation and how to adapt the scripts.

There's also a little bit more here (put together based on a specific request I received).

smaugustine commented 3 years ago

@thea-m, @PietroLiuzzo, @eu-genia, is there a means for encoding date+month combinations? I've been looking for examples but haven't really seen any.

If we had some sort of explicit encoding (like date="22" month="1" or date="22.01" for 22 Maskaram), we could add this to the visualization (<time data-ethiopian-month="1" data-ethiopian-date="2">) then have a tooltip populated by jQuery with the Gregorian/Julian equivalent like:

$('time[data-ethiopian-month]').each(function() {
  var westernDate = toWestern($(this).data('ethiopian-month'), $(this).data('ethiopian-date'));
  ⋮
})

The only hangup, aside from making sure that all the dates are encoded clearly, is also including an estimated year/century, particularly for distinguishing Julian and Gregorian conversions, but also dealing with the gradual shifting of the calendars. The suggested dating of the manuscript, for example, could be used to infer an approximate date.

smaugustine commented 3 years ago

As a follow-up on years/eras/etc., I think that there are too many considerations to allow for automatic conversion of years based on information from colophons, but that it may be worthwhile to provide a tool whereby an editor/user can input the available information (e.g. ṭǝntyon, abaqte, indiction) and then the tool suggests possible years.

I could put a page like this together, if it seems worthwhile. Some months ago I put this together, so there would already be a base to work from. (To be sure, more things could be added, like the evangelist, the date of Easter, the reigning monarch, etc., and these would be fairly easy to include).

thea-m commented 3 years ago

Hi @smaugustine ! There is the possibility of encoding day and month hidden in the guidelines https://betamasaheft.eu/Guidelines/?id=dates with, for example <date ref="ethiocal:Maskaram1">. It has not been used very often, mainly for encoding (recurring) commemoration dates, not a certain day in history. You can have a look here https://betamasaheft.eu/calendar.html

PietroLiuzzo commented 3 years ago

In addition to the system we use for recurring days and months correctly pointed out by @thea-m, please additionally refer to the guidelines for dates. we use att.datable attributes which are quite explicit https://www.tei-c.org/release/doc/tei-p5-doc/de/html/CO.html#CONADA

PietroLiuzzo commented 3 years ago

Also, If I may share a slight concern, I do not terribly like the idea of inferring dates or approximation, when this is after all already most the time implied in the encoding of a date in the manuscript description. it would add layers of approximation to layers of approximation.

smaugustine commented 3 years ago

The issue is that there's no way, really, to convert a date like "6 Sane" without having some sense of the year being discussed: this year it's June 13, in 1708 it was June 11, in 1408 it was May 31. So in contexts where the manuscript/work only gives the month and day, there is no way, really, to make a meaningful conversion without providing a window of a few centuries. It doesn't need to be a precise year, that's why usually conversions give a window of 2 days, but this still requires a choice of which era to use.

smaugustine commented 3 years ago

For now, putting aside more problematic cases, it would be possible to start with conversions of precise dates where the year, month, and day are known. However these might be encoded in TEI, my suggestion is to use data- attributes in the HTML (presumably a <time> element, but could be a <span> or anything else) and do conversions client-side.

As I suggested above, I can provide the functions in JS for doing the conversions and the relevant functions in jQuery, but the sort of XSLT that it sounds like would be required to set things up is something I don't think I could do.

As a rough sketch of my suggestion:

<span>
  <xsl:attribute name="data-year">…</xsl:attribute>
  ⋮
</span>
<span data-year="1434" data-month="sane" data-day="6">Sane 6</span>
⋮
<script>
$('span[data-year]').each(function(){
  var ethiopianDate = { day: $(this).data('day'), month: $(this).data('month'), year: $(this).data('year') };
  var westernDate = toWestern(ethiopianDate); // May 31, 1442
  // put westernDate into a tooltip or other form of display
});
</script>
PietroLiuzzo commented 3 years ago

The issue is that there's no way, really, to convert a date like "6 Sane" without having some sense of the year being discussed: this year it's June 13, in 1708 it was June 11, in 1408 it was May 31. So in contexts where the manuscript/work only gives the month and day, there is no way, really, to make a meaningful conversion without providing a window of a few centuries. It doesn't need to be a precise year, that's why usually conversions give a window of 2 days, but this still requires a choice of which era to use.

I do not think that these where intended to be converted while they may be aligned with a specific calendaric date as shown by @thea-m . This allows grouping recurrences of commemorations for example. The text of the issue did not help in figuring this out and I am sorry it has misled you. I think we can however offer better support, by providing a link to a specific search in the calendar view in the same type of box we are building below.

so, we are speaking of dates only and I think @SophiaD-M was actually referring to things like the info box of person records where we have gregorian dates which could be displayed as dates in the current Ethiopic calendar. I think that is reasonable and if I misunderstood @SophiaD-M can clarify.

your example seems to me to involve a conversion from Ethiopic calendar to western calendar, I think we need a bit more to be able to decide the direction of the conversion, i.e., the js needs to know what type of calendar is used, so that it can decide what to do. when this information is absent I think it should assume gregorian/western.

<span data-calendar="ethiopic" data-year="1434" data-month="sane" data-day="6">Sane 6</span>

which I can easily construct in the xslt. in facts, when a @calendar is present in the <date> a small box with a table is produced already just to give visibility to the information in the element. I think I would put the conversion there, in the case of a converstion from a calendar different from "western" to western. the same I can add to the dates without @calendar and add there the explicit information it is gregorian, so that you can build the w3 tooltip on that. what do you think?

to summarize

how does it sound? thanks

smaugustine commented 3 years ago

This is a sensible approach.

The Julian/Gregorian distinction isn't so much of an issue to deal with, Gregorian is used for JDN >= 2299160.5 (Ṭǝqǝmt 8, 1575) otherwise Julian (<= Ṭǝqǝmt 7, 1575).

The one unaddressed issue is the year. Are Ethiopian dates encoded with years according to ʿĀmata Śǝggāwe (or ʿĀmata ʿĀlam) or another system? It's not a problem to convert these, as long as it's consistent/clear.

PietroLiuzzo commented 3 years ago

I have no clue about this distinction, but I think it would be nice to provide both when converting from western, if they are relevant.

smaugustine commented 3 years ago

So here is a demo (using the current js file on the branch): https://jsfiddle.net/_smaugustine/0jLkr5o7/33/.

Currently it is a function (convertDate()) that converts a given date and returns a string.

Note that it:

The examples in the demo are:

  1. Ethiopian date to Western [Julian] (18/4/1437 => 14/12/1444)
  2. Ethiopian date with Anno Domini year (21/5/1439AD => 16/1/1439)
  3. Ethiopian month+year (12/1427 => 8/1435)
  4. Ethiopian date with ʿĀmata ʿĀlam year (27/10/6916AA => 21/6/1424)
  5. Western (Gregorian) date to Ethiopian (22/1/1901 => 14/5/1893)
PietroLiuzzo commented 3 years ago

Thanks @smaugustine ! I have added to the branch the XSLT to produce the desired attributes for this JS, in the branch. I have then added the calling function copied from the fiddle to the module adding those js script to the page views, always on the branch. because values are varied there is not much one can rely upon, I have made one time element for each attribute present. The values in the js for @calendar do not match the values we assign in the guidelines, perhaps this can be updated? https://betamasaheft.eu/Guidelines/?id=date

first ca. 100 of many thousands text calendar when notBefore notAfter when-custom notBefore-custom notAfter-custom
87 grace
231 grace
፸፻፪፻፲ወ፫ world
ዓመተ፡ ሰማዕታት፡ ፲፻ወ፪፻፷ወ፬። martyrs 1548
1896 julian
መጋቢት፡ ፫ቀን፡ ፲፰፻፺፭ ዓመት፡ ethiopian 1903-03-12 1895-07-03
1896 julian
1896 julian
Fevralja 12-go dnja 1895 g julian 1895-02-12
12th of February 1895 julian 1895-02-12
በነሐሴ፡ በ፲፭ ቀን፡ ፲፰፻፡ ፺፫ ዓመተ፡ ምሕረት፡ ethiopian
በመጋቢት፡ ባ፭ ቀን፡ ethiopian
1896 julian
፲ወ፪ ለመስከረም፡ በ፲ወ፰፻፸ወ፩ አመተ፡ ምህረት፡ ethiopian 1878-09-22 1871-01-12
1896 julian
ሐምሌ፡ ፲፩ ቀን፡ ethiopian
መጋቢት፡ ፫ቀን፡ ፲፰፻፺፭ ዓመት፡ ethiopian 1903-03-12 1895-07-03
1896 julian
1889 julian
1896 julian
1896 julian
በታኅሣሥ፡ በ፲፬ ቀን፡ grace --04-14
1896 julian
መስከረም፡ ፰ቀን፡ ፲፰፻፺፬ ዓመተ፡ ምሕረት፡ ethiopian 1902-09-18 1894-01-08
ዓለም᎓
በተፈጠረ᎓ በ፯ሽ ፳፻፳፪ዘመን world 1833 7325
1896 julian
1896 julian
1896 julian
1896 julian
1896 julian
በሰኔ፡ በ፳፮ ቀን ethiopian
፲፰፻፺፫፡ ዓመተ፡ ምሕረት፡ በሚያዝያ፡ በ፪ ቀን ethiopian
1896 julian
1896 julian
በነሐሴ፡ ፲፬ ቀን፡ ethiopian
በ፲፻በ፰፻፹ወ፭ ዓመተ፡
ምሕረት። በወርኃ፡ጥቅምት፡ በ፲፪ ሌሊት፡ በ፲ መዓልት፡ ethiopian 1892-10-20 1885
በግንቦት፡ በ፲፰ ቀን፡ ethiopian
1897 julian
1901 julian
በጥቅምት፡ በ፲፰ ቀን፡ ethiopian
1896 julian
በሚያዝያ፡ በ፲ ቀን፡ ethiopian
በ፲፰፻፺፪፡ ዓመተ፡ ምሕረት ethiopian
በሰኔ፡ በ፳፯ ቀን፡ ethiopian
1896 julian
፲፰ ለህዳር ethiopian
፸፻ወ፪፻፵ወ፯ዓመተ፡ ዓለም፡ world
በዓመት፡ ፸፻ወ፸ወ፬እምፍጥረተ፡ ዓለም፡ creation
ወበ፲፻ወ፰፻፺ወ፫እምዓመተ፡ እስክንድር፡ alexander
ወበ፲፻ወ፭፻፸ወ፬እምዓመተ፡ ሥጋሁ፡ ለእግዚእነ፡ ኢየሱስ፡ ክርስቶስ፡ መድኅነ፡ ዓለም፡ ethiopian
በ፲፻ወ፪፻፺ወ፰ እምዓመተ፡ ሰማዕታት፡ ንጹሓን፡ diocletian
በ፱፻ወ፱እምዓመተ፡ አጋር፡ ዕብናዊ። islamic
፱፻፹ወ፫እምሰማዕታት፡ ንጹሓን፡ diocletian 983
በዓመት፮፻፷ወ፭ islamic 665
በ፸፻ወ፪፻በ፳ወ፰ዓመት፡
world
7228 world
87 grace
231 grace
፸፻፪፻፲ወ፫ world
ዓመተ፡ ሰማዕታት፡ ፲፻ወ፪፻፷ወ፬። martyrs 1548
1396 Wrote a letter. hijri 1396
1964 gregorian 1964
1263 hijri 1263
1394-08-08 hijri 1394-08-08
0471 hijri 0471
1891 gregorian 1891
1952 gregorian 1952
1211 hijri 1211
1114-10-14 hijri 1114-10-14
1176-01-26 hijri 1176-01-26
1762 gregorian 1762
1354 Appointed. hijri 1354
1386 hijri 1386
1389-10 Wrote a letter. hijri 1389-10
1387 Wrote a letter hijri 1387
1356-01-21 hijri 1356-01-21
1356-12-23 Mentioned in a letter as a witness. hijri 1356-12-23
1919 gregorian 1919
0878 gregorian 0878
1280 hijri 1280
1901 1950 gregorian 1901 1950
1363 Mentioned in a letter. hijri 1363
0433 hijri 0433
0513 hijri 0513
1374 Wrote a note of ownership. hijri 1374
1385-01-01 hijri 1385-01-01
1193 hijri 1193
1285-11-11 hijri 1285-11-11
1345-03 hijri 1345-03
1321 hijri 1321
1424-03-30 hijri 1424-03-30
0790 hijri 0790
0852 hijri 0852
1921 gregorian 1921
2013-08-09 gregorian 2013-08-09
1190 hijri 1190
1197-02-16 hijri 1197-02-16
1357-01-01 hijri 1357-01-01
1322 Copied a manuscript. hijri 1322
1989 According to a school certificate she was 9 years old in 1998 E. ethiopian 1989
1998 School certificate. ethiopian 1998
1850 gregorian 1850
1901-01 gregorian 1901-01
1360-07-17 Mentioned in a letter (HRDVar08). The "0" in 1360 is not completely certain. hijri 1360-07-17
1359-06-07 Mentioned in a letter (HRDVar14). hijri 1359-06-07
1381-11-26 Purchased a book. hijri 1381-11-26
0694 Uncertain: also 698 and 700 H. are given in the sources. hijri 0694
0769 hijri 0769
0846 hijri 0846
0899-02 hijri 0899-02
1366 hijri 1366
1431 Establishes a waqf. hijri 1431
1181-09-25 Finished a copy of the Witriyya. hijri 1181-09-25
0935 hijri 0935
0999 hijri 0999
1698 gregorian 1698
1768 gregorian 1768
1110 hijri 1110
1182 hijri 1182
0034 hijri 0034
0119 hijri 0119
0728 gregorian 0728
1391 His death was mentioned in a letter. hijri 1391
1322 hijri 1322
0890 Died after 890. hijri 0890
1225 1300 gregorian 1225 1300
1340-11-22 Receives land. hijri 1340-11-22
0745 hijri 0745
0808 hijri 0808
1388 hijri 1388
1399 Mentioned in a letter. hijri 1399
1271 hijri 1271
1341 hijri 1341
1382-06-04 Received a letter. hijri 1382-06-04
1394 Wrote a letter hijri 1394
1851 gregorian 1851
1926 gregorian 1926
0179 hijri 0179
1339 hijri 1339
1289 hijri 1289
1920 gregorian 1920
1996 gregorian 1996
1148 Arrived in Damascus. hijri 1148
1125 hijri 1125
1198-08-15 hijri 1198-08-15
1355 A note in TOSG00029 42r mentions the years of the birth and death of Ḥāǧǧ Ādam. He is likely Šayḫ Ādam ʻAbd Allāh. There is a further note in TOSG00029 27v. hijri 1355
1283 hijri 1283
0213 hijri 0213
0276 hijri 0276
1373 DJBL0004 f. 2r. hijri 1373
2016 Alive during the Second Mission of the Islam in the Horn of Africa Project (30 January - 4 March 2016). gregorian 2016
1372-07-15 WOZM00358 fol. 29r hijri 1372-07-15
1892 gregorian 1892
1814 gregorian 1814
1229 hijri 1229
1309 hijri 1309
1385-05-07 hijri 1385-05-07
0445 hijri 0445
0509-07-09 hijri 0509-07-09
1329-08-16 Copied the manuscript USWE070. hijri 1329-08-16
1348 Acted as a witness. hijri 1348
0371 hijri 0371
0444-10-16 hijri 0444-10-16
0644 hijri 0644
0713-12-19 hijri 0713-12-19
1246 gregorian 1246
1314 gregorian 1314
0543 Birth year also given as 544 H. hijri 0543
0606-01-21 hijri 0606-01-21
0672 hijri 0672
0723 hijri 0723
1369 hijri 1369
1387 Received a letter. hijri 1387
1244 hijri 1244
1335 hijri 1335
1179-01-11 gregorian 1179-01-11
0574-08-06 hijri 0574-08-06
0639-04 hijri 0639-04
0733-05-21 hijri 0733-05-21
1040 Estimated in Arabic Literature of Africa vol. 1 p. 37. hijri 1040
1095 hijri 1095
1684 gregorian 1684
1992 Mentioned in a letter. gregorian 1992
1993 hijri 1993
1407-09-14 hijri 1407-09-14
1963-08-09 ethiopian 1963-08-09
1353 Author of poem (Qaṣīdat "Ahlan wa-sahlan yā ḥabīb wa-marḥaban") dated to this year. hijri 1353
1373 hijri 1373
1205 Terminus post quem: based on the year of completion of his work Fatḥ al-raḥīm al-raḥmān. Both GALS 2 and al-Aʻlām give 1205 H but in AGSK00025 p. 210 it is stated that the author completed the work in 1285 H. hijri 1205
1401 hijri 1401
1344-11 Wrote a letter hijri 1344-11
1135 Copied a manuscript hijri 1135
1147 gregorian 1147
0542 hijri 0542
1900 gregorian 1900
1408-10-23 This specific date is given in HRD00083 fol. 7r. hijri 1408-10-23
1412-11-27 hijri 1412-11-27
0691-02-07 hijri 0691-02-07
0751-07-23 hijri 0751-07-23
1350 gregorian 1350
1348 Acted as a witness. hijri 1348
1326 hijri 1326
1770 1850Watermark in the manuscript he copied can be dated to the above period gregorian 1770 1850
1399 Mentioned in a letter. hijri 1399
1387 Wrote a letter. hijri 1387
0492 0567-09-03 hijri 0492 0567-09-03
1259-10-24 hijri 1259-10-24
1333-04-20 hijri 1333-04-20
1901 1975 gregorian 1901 1975
1365 hijri 1365
1915-05-15 gregorian 1915-05-15
1993-08-15 gregorian 1993-08-15
1926 1975 gregorian 1926 1975
1387 Inherits this year. hijri 1387
1382-08-21 hijri 1382-08-21
0600 0699Disciple of Abū al-Ġayṯ ibn Ǧumayl al-Yamanī who died 651 H. hijri 0600 0699
1295 There is a chronological problem with this date (given in HRD00083 fol. 6v): 1295 H corresponds to CE 1878 while according to the Encyclopaedia Aethiopica his rule ended in 1882. hijri 1295
1861 1882 gregorian 1861 1882
1353 Mentioned in a letter. hijri 1353
1407-10-15 hijri 1407-10-15
1365 hijri 1365
0632 hijri 0632
0723 hijri 0723
1375 gregorian 1375
0777 hijri 0777
1303 Received a letter. hijri 1303
1070 hijri 1070
1366 Marriage. hijri 1366
0894 hijri 0894
1344 Received a letter. hijri 1344
1930-01-01 gregorian 1930-01-01
0917 hijri 0917
0840 hijri 0840
1359 Involved in a court case. The year relates to two other cases noted on the same folio. hijri 1359
1291-09-20 hijri 1291-09-20
1322 Acts as a witness in a court case. The year is given in a related letter (LMG00084 fol. 67r). hijri 1322
0538 hijri 0538
0616 hijri 0616
0850 hijri 0850
0918 hijri 0918
1361-05-09 Marriage contract. Bride. hijri 1361-05-09
1309 Terminus post quem. hijri 1309
1350 Received a letter. hijri 1350
0520 hijri 0520
0595-02-09 hijri 0595-02-09
1878 gregorian 1878
1383 hijri 1383
1246 hijri 1246
1357 Mentioned in a letter: divorce case. hijri 1357
1358 Arrival in Ǧimmā. hijri 1358
1014 hijri 1014
1277 hijri 1277
1355 hijri 1355
1366-05-15 Mentioned in a letter (HRDVar23). hijri 1366-05-15
1364-09-02 Mentioned in a letter (HRDVar11). hijri 1364-09-02
1357-02 Appears as a witness. hijri 1357-02
0722 http://www.al-aalam.com/personinfo.asp?pid=1317 hijri 0722
0806-07-15 hijri 0806-07-15
1388-09-15 Acquired a book hijri 1388-09-15
1257-02 Mentioned in a transaction note. hijri 1257-02
1373 In a letter where he is mentioned. hijri 1373
1127 Beneficiary of a waqf hijri 1127
1344 Was teaching (AGMS00016). hijri 1344
2002 gregorian 2002
1891 gregorian 1891
1941 gregorian 1941
1171 Established a waqf hijri 1171
1413 Mentioned in a letter. gregorian 1413
1907 gregorian 1907
1978-04-20 gregorian 1978-04-20
1373-03-19 Mentioned in a document. hijri 1373-03-19
1307 Terminus post quem. hijri 1307
1208 Date found on Wikipedia:
https://ar.wikipedia.org/wiki/%D8%B3%D9%84%D9%8A%D9%85%D8%A7%D9%86_%D8%A7%D9%84%D8%AC%D9%85%D8%B2%D9%88%D8%B1%D9%8A hijri 1208
1280-11 Study and reading.
The year is given in abjad numerals. hijri 1280-11
1321 Book acquisition. hijri 1321
1041 hijri 1041
1096 hijri 1096
1244 1271Cf. ZM00109 p. 260. hijri 1244 1271
0869-11 hijri 0869-11
1801 1900 gregorian 1801 1900
1351-05 Wrote a letter. hijri 1351-05
1344 Wrote a letter. hijri 1344
1357 Received a letter hijri 1357
1410 Received a letter. hijri 1410
1671 1700 gregorian 1671 1700
1339 Wrote a letter. hijri 1339
0223 hijri 0223
0321-08-17 hijri 0321-08-17
0933-08-13 gregorian 0933-08-13
1923 Short biography on p. 455 in Aḍwā’ ʻalā al-hiǧra. gregorian 1923
1917-02-08 gregorian 1917-02-08
1984-05-12 gregorian 1984-05-12
0872 hijri 0872
0928 hijri 0928
1348-07-03 Dated ownership note on a book. hijri 1348-07-03
1384 hijri 1384
1362-07-07 hijri 1362-07-07
0869-08-15 GAL S II 554 hijri 0869-08-15
0930-08-20 hijri 0930-08-20
1391 Mentioned a letter. hijri 1391
1395 Mentioned in a letter. hijri 1395
1865 gregorian 1865
1935 gregorian 1935
1359-06-07 Mentioned in a letter (HRDVar14). hijri 1359-06-07
1364-09-02 Mentioned in a letter (HRDVar11). hijri 1364-09-02
1101 hijri 1101
PietroLiuzzo commented 3 years ago

This is now integrated in the new app. The branch is old and my modifications to the XSLT obsolete, so I opted for copying in the js file (unmodified) from there and paste it in the main branch, I hope you do not mind @smaugustine . For each date-like element an icon will be provided, hovering on which a tooltip is displayed which attempts the dateConversion on each <time> element which can be extracted from available attribute values.

before

Bildschirmfoto 2021-09-08 um 12 44 02

after

Bildschirmfoto 2021-09-08 um 12 43 57

If there is also a calendar information and additional attributes, the calendar icon will follow.