An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:sparkles: Support lunar dates in database date fields https://github.com/siyuan-note/siyuan/issues/20322
Daniel8cc4934414b3
diff --git a/app/appearance/langs/ar.json b/app/appearance/langs/ar.jsonindex 1b0496e2ba..58ba36f9a4 100644--- a/app/appearance/langs/ar.json+++ b/app/appearance/langs/ar.json@@ -2736,6 +2736,15 @@"quit": "خروج من التطبيق"},"_attrView": {+ "dateCalendar": "التقويم",+ "solarCalendar": "الميلادي",+ "lunarCalendar": "القمري الصيني",+ "lunarLeapMonth": "${month} الكبيس",+ "lunarMonths": "الشهر 1|الشهر 2|الشهر 3|الشهر 4|الشهر 5|الشهر 6|الشهر 7|الشهر 8|الشهر 9|الشهر 10|الشهر 11|الشهر 12",+ "lunarDays": "1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30",+ "lunarDateTemplate": "التقويم القمري الصيني ${year}، ${month}، اليوم ${day}",+ "lunarRange": "نطاق التواريخ القمرية: 1901-02-19 - 2100-12-31",+ "lunarInvalid": "التاريخ القمري أو الوقت غير صالح؛ اختر مجددًا","calendar": "التقويم","list": "قائمة","dateFormat": "تنسيق التاريخ",diff --git a/app/appearance/langs/de.json b/app/appearance/langs/de.jsonindex 0edc651ef1..994899a4fc 100644--- a/app/appearance/langs/de.json+++ b/app/appearance/langs/de.json@@ -2736,6 +2736,15 @@"quit": "Anwendung beenden"},"_attrView": {+ "dateCalendar": "Kalender",+ "solarCalendar": "Gregorianisch",+ "lunarCalendar": "Chinesischer Mondkalender",+ "lunarLeapMonth": "Schalt${month}",+ "lunarMonths": "monat 1|monat 2|monat 3|monat 4|monat 5|monat 6|monat 7|monat 8|monat 9|monat 10|monat 11|monat 12",+ "lunarDays": "1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30",+ "lunarDateTemplate": "Chinesischer Mondkalender ${year}, ${month}, Tag ${day}",+ "lunarRange": "Mondkalender-Datumsbereich: 1901-02-19 - 2100-12-31",+ "lunarInvalid": "Ungültiges Mondkalenderdatum oder ungültige Uhrzeit; bitte erneut auswählen","calendar": "Kalender","list": "Liste","dateFormat": "Datumsformat",diff --git a/app/appearance/langs/en.json b/app/appearance/langs/en.jsonindex 5df79c42f2..a3c82b4341 100644--- a/app/appearance/langs/en.json+++ b/app/appearance/langs/en.json@@ -2736,6 +2736,15 @@"quit": "Quit application"},"_attrView": {+ "dateCalendar": "Calendar",+ "solarCalendar": "Gregorian",+ "lunarCalendar": "Chinese lunar",+ "lunarLeapMonth": "Leap ${month}",+ "lunarMonths": "Month 1|Month 2|Month 3|Month 4|Month 5|Month 6|Month 7|Month 8|Month 9|Month 10|Month 11|Month 12",+ "lunarDays": "1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30",+ "lunarDateTemplate": "Chinese lunar ${year}, ${month}, day ${day}",+ "lunarRange": "Lunar dates: 1901-02-19 - 2100-12-31",+ "lunarInvalid": "Invalid lunar date or time; select again","calendar": "Calendar","list": "List","dateFormat": "Date format",diff --git a/app/appearance/langs/es.json b/app/appearance/langs/es.jsonindex e124bbc119..d2180b500a 100644--- a/app/appearance/langs/es.json+++ b/app/appearance/langs/es.json@@ -2736,6 +2736,15 @@"quit": "Salir de la aplicación"},"_attrView": {+ "dateCalendar": "Calendario",+ "solarCalendar": "Gregoriano",+ "lunarCalendar": "Lunar chino",+ "lunarLeapMonth": "${month} intercalar",+ "lunarMonths": "Mes 1|Mes 2|Mes 3|Mes 4|Mes 5|Mes 6|Mes 7|Mes 8|Mes 9|Mes 10|Mes 11|Mes 12",+ "lunarDays": "1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30",+ "lunarDateTemplate": "Calendario lunar chino ${year}, ${month}, día ${day}",+ "lunarRange": "Fechas lunares: 1901-02-19 - 2100-12-31",+ "lunarInvalid": "Fecha lunar u hora no válida; vuelve a seleccionar","calendar": "Calendario","list": "Lista","dateFormat": "Formato de fecha",diff --git a/app/appearance/langs/fr.json b/app/appearance/langs/fr.jsonindex 7140c650bf..6d0fdd3939 100644--- a/app/appearance/langs/fr.json+++ b/app/appearance/langs/fr.json@@ -2736,6 +2736,15 @@"quit": "Quitter le programme"},"_attrView": {+ "dateCalendar": "Calendrier",+ "solarCalendar": "Grégorien",+ "lunarCalendar": "Lunaire chinois",+ "lunarLeapMonth": "${month} intercalaire",+ "lunarMonths": "Mois 1|Mois 2|Mois 3|Mois 4|Mois 5|Mois 6|Mois 7|Mois 8|Mois 9|Mois 10|Mois 11|Mois 12",+ "lunarDays": "1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30",+ "lunarDateTemplate": "Calendrier lunaire chinois ${year}, ${month}, jour ${day}",+ "lunarRange": "Plage des dates lunaires : 1901-02-19 - 2100-12-31",+ "lunarInvalid": "Date lunaire ou heure invalide ; veuillez sélectionner à nouveau","calendar": "Calendrier","list": "Liste","dateFormat": "Format de date",diff --git a/app/appearance/langs/he.json b/app/appearance/langs/he.jsonindex e788350eb1..db37844e72 100644--- a/app/appearance/langs/he.json+++ b/app/appearance/langs/he.json@@ -2736,6 +2736,15 @@"quit": "צא מהאפליקציה"},"_attrView": {+ "dateCalendar": "לוח שנה",+ "solarCalendar": "גרגוריאני",+ "lunarCalendar": "ירחי סיני",+ "lunarLeapMonth": "${month} מעובר",+ "lunarMonths": "חודש 1|חודש 2|חודש 3|חודש 4|חודש 5|חודש 6|חודש 7|חודש 8|חודש 9|חודש 10|חודש 11|חודש 12",+ "lunarDays": "1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30",+ "lunarDateTemplate": "לוח ירחי סיני ${year}, ${month}, יום ${day}",+ "lunarRange": "טווח תאריכים ירחיים: 1901-02-19 - 2100-12-31",+ "lunarInvalid": "התאריך הירחי או השעה אינם תקינים; יש לבחור מחדש","calendar": "לוח שנה","list": "רשימה","dateFormat": "תבנית תאריך",diff --git a/app/appearance/langs/hi.json b/app/appearance/langs/hi.jsonindex 2f985dc9a9..3939848fe9 100644--- a/app/appearance/langs/hi.json+++ b/app/appearance/langs/hi.json@@ -2736,6 +2736,15 @@"quit": "एप्लिकेशन से बाहर निकलें"},"_attrView": {+ "dateCalendar": "पंचांग",+ "solarCalendar": "ग्रेगोरियन",+ "lunarCalendar": "चीनी चंद्र पंचांग",+ "lunarLeapMonth": "अधिक ${month}",+ "lunarMonths": "महीना 1|महीना 2|महीना 3|महीना 4|महीना 5|महीना 6|महीना 7|महीना 8|महीना 9|महीना 10|महीना 11|महीना 12",+ "lunarDays": "1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30",+ "lunarDateTemplate": "चीनी चंद्र पंचांग ${year}, ${month}, दिन ${day}",+ "lunarRange": "चंद्र तिथियों की सीमा: 1901-02-19 - 2100-12-31",+ "lunarInvalid": "चंद्र तिथि या समय अमान्य है; फिर से चुनें","calendar": "कैलेंडर","list": "सूची","dateFormat": "दिनांक प्रारूप",diff --git a/app/appearance/langs/id.json b/app/appearance/langs/id.jsonindex 389b610381..a25971625a 100644--- a/app/appearance/langs/id.json+++ b/app/appearance/langs/id.json@@ -2736,6 +2736,15 @@"quit": "Keluar aplikasi"},"_attrView": {+ "dateCalendar": "Kalender",+ "solarCalendar": "Gregorian",+ "lunarCalendar": "Lunar Tionghoa",+ "lunarLeapMonth": "${month} kabisat",+ "lunarMonths": "Bulan 1|Bulan 2|Bulan 3|Bulan 4|Bulan 5|Bulan 6|Bulan 7|Bulan 8|Bulan 9|Bulan 10|Bulan 11|Bulan 12",+ "lunarDays": "1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30",+ "lunarDateTemplate": "Kalender lunar Tionghoa ${year}, ${month}, hari ${day}",+ "lunarRange": "Rentang tanggal lunar: 1901-02-19 - 2100-12-31",+ "lunarInvalid": "Tanggal lunar atau waktu tidak valid; pilih kembali","calendar": "Kalender","list": "Daftar","dateFormat": "Format tanggal",diff --git a/app/appearance/langs/it.json b/app/appearance/langs/it.jsonindex 44d1e19bc8..f56dd0949f 100644--- a/app/appearance/langs/it.json+++ b/app/appearance/langs/it.json@@ -2736,6 +2736,15 @@"quit": "Esci dall'applicazione"},"_attrView": {+ "dateCalendar": "Calendario",+ "solarCalendar": "Gregoriano",+ "lunarCalendar": "Lunare cinese",+ "lunarLeapMonth": "${month} intercalare",+ "lunarMonths": "Mese 1|Mese 2|Mese 3|Mese 4|Mese 5|Mese 6|Mese 7|Mese 8|Mese 9|Mese 10|Mese 11|Mese 12",+ "lunarDays": "1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30",+ "lunarDateTemplate": "Calendario lunare cinese ${year}, ${month}, giorno ${day}",+ "lunarRange": "Intervallo delle date lunari: 1901-02-19 - 2100-12-31",+ "lunarInvalid": "Data lunare o ora non valida; seleziona di nuovo","calendar": "Calendario","list": "Elenco","dateFormat": "Formato data",diff --git a/app/appearance/langs/ja.json b/app/appearance/langs/ja.jsonindex f3239f9e9d..79f7c7010a 100644--- a/app/appearance/langs/ja.json+++ b/app/appearance/langs/ja.json@@ -2736,6 +2736,15 @@"quit": "アプリケーションを終了"},"_attrView": {+ "dateCalendar": "暦",+ "solarCalendar": "グレゴリオ暦",+ "lunarCalendar": "旧暦(中国暦)",+ "lunarLeapMonth": "閏${month}",+ "lunarMonths": "1月|2月|3月|4月|5月|6月|7月|8月|9月|10月|11月|12月",+ "lunarDays": "1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30",+ "lunarDateTemplate": "旧暦 ${year}年${month}${day}日",+ "lunarRange": "旧暦の日付範囲:1901-02-19 - 2100-12-31",+ "lunarInvalid": "旧暦の日付または時刻が無効です。選び直してください","calendar": "カレンダー","list": "リスト","dateFormat": "日付形式",diff --git a/app/appearance/langs/ko.json b/app/appearance/langs/ko.jsonindex 5c230e094f..ec9cd05a5e 100644--- a/app/appearance/langs/ko.json+++ b/app/appearance/langs/ko.json@@ -2736,6 +2736,15 @@"quit": "애플리케이션 종료"},"_attrView": {+ "dateCalendar": "달력 체계",+ "solarCalendar": "양력",+ "lunarCalendar": "중국 음력",+ "lunarLeapMonth": "윤${month}",+ "lunarMonths": "1월|2월|3월|4월|5월|6월|7월|8월|9월|10월|11월|12월",+ "lunarDays": "1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30",+ "lunarDateTemplate": "음력 ${year}년 ${month} ${day}일",+ "lunarRange": "음력 날짜 범위: 1901-02-19 - 2100-12-31",+ "lunarInvalid": "음력 날짜 또는 시간이 올바르지 않습니다. 다시 선택하세요","calendar": "달력","list": "목록","dateFormat": "날짜 형식",diff --git a/app/appearance/langs/nl.json b/app/appearance/langs/nl.jsonindex e12afbd1eb..572a0511be 100644--- a/app/appearance/langs/nl.json+++ b/app/appearance/langs/nl.json@@ -2736,6 +2736,15 @@"quit": "Applicatie afsluiten"},"_attrView": {+ "dateCalendar": "Kalender",+ "solarCalendar": "Gregoriaans",+ "lunarCalendar": "Chinese maankalender",+ "lunarLeapMonth": "Schrikkel${month}",+ "lunarMonths": "maand 1|maand 2|maand 3|maand 4|maand 5|maand 6|maand 7|maand 8|maand 9|maand 10|maand 11|maand 12",+ "lunarDays": "1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30",+ "lunarDateTemplate": "Chinese maankalender ${year}, ${month}, dag ${day}",+ "lunarRange": "Datumbereik maankalender: 1901-02-19 - 2100-12-31",+ "lunarInvalid": "Ongeldige maankalenderdatum of tijd; selecteer opnieuw","calendar": "Kalender","list": "Lijst","dateFormat": "Datumnotatie",diff --git a/app/appearance/langs/pl.json b/app/appearance/langs/pl.jsonindex fa7030005d..4fd7ab654e 100644--- a/app/appearance/langs/pl.json+++ b/app/appearance/langs/pl.json@@ -2736,6 +2736,15 @@"quit": "Zamknij aplikację"},"_attrView": {+ "dateCalendar": "Kalendarz",+ "solarCalendar": "Gregoriański",+ "lunarCalendar": "Chiński księżycowy",+ "lunarLeapMonth": "${month} przestępny",+ "lunarMonths": "Miesiąc 1|Miesiąc 2|Miesiąc 3|Miesiąc 4|Miesiąc 5|Miesiąc 6|Miesiąc 7|Miesiąc 8|Miesiąc 9|Miesiąc 10|Miesiąc 11|Miesiąc 12",+ "lunarDays": "1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30",+ "lunarDateTemplate": "Chiński kalendarz księżycowy ${year}, ${month}, dzień ${day}",+ "lunarRange": "Zakres dat księżycowych: 1901-02-19 - 2100-12-31",+ "lunarInvalid": "Nieprawidłowa data księżycowa lub godzina; wybierz ponownie","calendar": "Kalendarz","list": "Lista","dateFormat": "Format daty",diff --git a/app/appearance/langs/pt-BR.json b/app/appearance/langs/pt-BR.jsonindex c15ef87546..31293a6e66 100644--- a/app/appearance/langs/pt-BR.json+++ b/app/appearance/langs/pt-BR.json@@ -2736,6 +2736,15 @@"quit": "Sair do aplicativo"},"_attrView": {+ "dateCalendar": "Calendário",+ "solarCalendar": "Gregoriano",+ "lunarCalendar": "Lunar chinês",+ "lunarLeapMonth": "${month} intercalar",+ "lunarMonths": "Mês 1|Mês 2|Mês 3|Mês 4|Mês 5|Mês 6|Mês 7|Mês 8|Mês 9|Mês 10|Mês 11|Mês 12",+ "lunarDays": "1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30",+ "lunarDateTemplate": "Calendário lunar chinês ${year}, ${month}, dia ${day}",+ "lunarRange": "Intervalo de datas lunares: 1901-02-19 - 2100-12-31",+ "lunarInvalid": "Data lunar ou horário inválido; selecione novamente","calendar": "Calendário","list": "Lista","dateFormat": "Formato de data",diff --git a/app/appearance/langs/ru.json b/app/appearance/langs/ru.jsonindex 209cad7b96..8e2b37530c 100644--- a/app/appearance/langs/ru.json+++ b/app/appearance/langs/ru.json@@ -2736,6 +2736,15 @@"quit": "Выйти из приложения"},"_attrView": {+ "dateCalendar": "Календарь",+ "solarCalendar": "Григорианский",+ "lunarCalendar": "Китайский лунный",+ "lunarLeapMonth": "Вставной ${month}",+ "lunarMonths": "месяц 1|месяц 2|месяц 3|месяц 4|месяц 5|месяц 6|месяц 7|месяц 8|месяц 9|месяц 10|месяц 11|месяц 12",+ "lunarDays": "1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30",+ "lunarDateTemplate": "Китайский лунный календарь ${year}, ${month}, день ${day}",+ "lunarRange": "Диапазон лунных дат: 1901-02-19 - 2100-12-31",+ "lunarInvalid": "Недопустимая лунная дата или время; выберите заново","calendar": "Календарь","list": "Список","dateFormat": "Формат даты",diff --git a/app/appearance/langs/sk.json b/app/appearance/langs/sk.jsonindex bd3b1ff90b..8b8a3ec126 100644--- a/app/appearance/langs/sk.json+++ b/app/appearance/langs/sk.json@@ -2736,6 +2736,15 @@"quit": "Ukončiť aplikáciu"},"_attrView": {+ "dateCalendar": "Kalendár",+ "solarCalendar": "Gregoriánsky",+ "lunarCalendar": "Čínsky lunárny",+ "lunarLeapMonth": "Priestupný ${month}",+ "lunarMonths": "mesiac 1|mesiac 2|mesiac 3|mesiac 4|mesiac 5|mesiac 6|mesiac 7|mesiac 8|mesiac 9|mesiac 10|mesiac 11|mesiac 12",+ "lunarDays": "1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30",+ "lunarDateTemplate": "Čínsky lunárny kalendár ${year}, ${month}, deň ${day}",+ "lunarRange": "Rozsah lunárnych dátumov: 1901-02-19 - 2100-12-31",+ "lunarInvalid": "Neplatný lunárny dátum alebo čas; vyberte znova","calendar": "Kalendár","list": "Zoznam","dateFormat": "Formát dátumu",diff --git a/app/appearance/langs/sr.json b/app/appearance/langs/sr.jsonindex 21af54d20a..cb361eb8d4 100644--- a/app/appearance/langs/sr.json+++ b/app/appearance/langs/sr.json@@ -2736,6 +2736,15 @@"quit": "Ugasi aplikaciju"},"_attrView": {+ "dateCalendar": "Календар",+ "solarCalendar": "Грегоријански",+ "lunarCalendar": "Кинески лунарни",+ "lunarLeapMonth": "Преступни ${month}",+ "lunarMonths": "месец 1|месец 2|месец 3|месец 4|месец 5|месец 6|месец 7|месец 8|месец 9|месец 10|месец 11|месец 12",+ "lunarDays": "1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30",+ "lunarDateTemplate": "Кинески лунарни календар ${year}, ${month}, дан ${day}",+ "lunarRange": "Распон лунарних датума: 1901-02-19 - 2100-12-31",+ "lunarInvalid": "Неважећи лунарни датум или време; изаберите поново","calendar": "Календар","list": "Lista","dateFormat": "Format datuma",diff --git a/app/appearance/langs/th.json b/app/appearance/langs/th.jsonindex cde36c7e73..0166a8ce5f 100644--- a/app/appearance/langs/th.json+++ b/app/appearance/langs/th.json@@ -2736,6 +2736,15 @@"quit": "ออก"},"_attrView": {+ "dateCalendar": "ระบบปฏิทิน",+ "solarCalendar": "เกรกอเรียน",+ "lunarCalendar": "จันทรคติจีน",+ "lunarLeapMonth": "${month}อธิกมาส",+ "lunarMonths": "เดือน 1|เดือน 2|เดือน 3|เดือน 4|เดือน 5|เดือน 6|เดือน 7|เดือน 8|เดือน 9|เดือน 10|เดือน 11|เดือน 12",+ "lunarDays": "1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30",+ "lunarDateTemplate": "จันทรคติจีน ปี ${year} ${month} วันที่ ${day}",+ "lunarRange": "ช่วงวันที่จันทรคติ: 1901-02-19 - 2100-12-31",+ "lunarInvalid": "วันที่จันทรคติหรือเวลาไม่ถูกต้อง โปรดเลือกใหม่","calendar": "ปฏิทิน","list": "รายการ","dateFormat": "รูปแบบวันที่",diff --git a/app/appearance/langs/tr.json b/app/appearance/langs/tr.jsonindex 694388db7c..6503e0af51 100644--- a/app/appearance/langs/tr.json+++ b/app/appearance/langs/tr.json@@ -2736,6 +2736,15 @@"quit": "Uygulamadan çık"},"_attrView": {+ "dateCalendar": "Takvim",+ "solarCalendar": "Miladi",+ "lunarCalendar": "Çin ay takvimi",+ "lunarLeapMonth": "Artık ${month}",+ "lunarMonths": "ay 1|ay 2|ay 3|ay 4|ay 5|ay 6|ay 7|ay 8|ay 9|ay 10|ay 11|ay 12",+ "lunarDays": "1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30",+ "lunarDateTemplate": "Çin ay takvimi ${year}, ${month}, gün ${day}",+ "lunarRange": "Ay takvimi tarih aralığı: 1901-02-19 - 2100-12-31",+ "lunarInvalid": "Ay takvimi tarihi veya saat geçersiz; yeniden seçin","calendar": "Takvim","list": "Liste","dateFormat": "Tarih biçimi",diff --git a/app/appearance/langs/uk.json b/app/appearance/langs/uk.jsonindex 9c19896ab6..b9a0ccb572 100644--- a/app/appearance/langs/uk.json+++ b/app/appearance/langs/uk.json@@ -2736,6 +2736,15 @@"quit": "Вийти із застосунку"},"_attrView": {+ "dateCalendar": "Календар",+ "solarCalendar": "Григоріанський",+ "lunarCalendar": "Китайський місячний",+ "lunarLeapMonth": "Вставний ${month}",+ "lunarMonths": "місяць 1|місяць 2|місяць 3|місяць 4|місяць 5|місяць 6|місяць 7|місяць 8|місяць 9|місяць 10|місяць 11|місяць 12",+ "lunarDays": "1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30",+ "lunarDateTemplate": "Китайський місячний календар ${year}, ${month}, день ${day}",+ "lunarRange": "Діапазон місячних дат: 1901-02-19 - 2100-12-31",+ "lunarInvalid": "Недійсна місячна дата або час; виберіть знову","calendar": "Календар","list": "Список","dateFormat": "Формат дати",diff --git a/app/appearance/langs/zh-CN.json b/app/appearance/langs/zh-CN.jsonindex 2e6d26902f..da7589e9c1 100644--- a/app/appearance/langs/zh-CN.json+++ b/app/appearance/langs/zh-CN.json@@ -2736,6 +2736,15 @@"quit": "退出程序"},"_attrView": {+ "dateCalendar": "历法",+ "solarCalendar": "公历",+ "lunarCalendar": "农历",+ "lunarLeapMonth": "闰${month}",+ "lunarMonths": "正月|二月|三月|四月|五月|六月|七月|八月|九月|十月|冬月|腊月",+ "lunarDays": "初一|初二|初三|初四|初五|初六|初七|初八|初九|初十|十一|十二|十三|十四|十五|十六|十七|十八|十九|二十|廿一|廿二|廿三|廿四|廿五|廿六|廿七|廿八|廿九|三十",+ "lunarDateTemplate": "农历 ${year}年${month}${day}",+ "lunarRange": "农历日期范围:1901-02-19 - 2100-12-31",+ "lunarInvalid": "农历日期或时间无效,请重新选择","calendar": "日历","list": "列表","dateFormat": "日期格式",diff --git a/app/appearance/langs/zh-TW.json b/app/appearance/langs/zh-TW.jsonindex 98d2d3f18e..11738a1189 100644--- a/app/appearance/langs/zh-TW.json+++ b/app/appearance/langs/zh-TW.json@@ -2736,6 +2736,15 @@"quit": "退出程序"},"_attrView": {+ "dateCalendar": "曆法",+ "solarCalendar": "西曆",+ "lunarCalendar": "農曆",+ "lunarLeapMonth": "閏${month}",+ "lunarMonths": "正月|二月|三月|四月|五月|六月|七月|八月|九月|十月|冬月|臘月",+ "lunarDays": "初一|初二|初三|初四|初五|初六|初七|初八|初九|初十|十一|十二|十三|十四|十五|十六|十七|十八|十九|二十|廿一|廿二|廿三|廿四|廿五|廿六|廿七|廿八|廿九|三十",+ "lunarDateTemplate": "農曆 ${year}年${month}${day}",+ "lunarRange": "農曆日期範圍:1901-02-19 - 2100-12-31",+ "lunarInvalid": "農曆日期或時間無效,請重新選擇","calendar": "日曆","list": "列表","dateFormat": "日期格式",diff --git a/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-xaduj2o/20240208172514-9dsv6na/20260613155453-sgecaav.sy b/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-xaduj2o/20240208172514-9dsv6na/20260613155453-sgecaav.syindex 14bb87e568..a80ea82b52 100644--- a/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-xaduj2o/20240208172514-9dsv6na/20260613155453-sgecaav.sy+++ b/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-xaduj2o/20240208172514-9dsv6na/20260613155453-sgecaav.sy@@ -6,7 +6,7 @@"id": "20260613155453-sgecaav","title": "Field Types","type": "doc",- "updated": "20260809232000"+ "updated": "20261009120841"},"Children": [{@@ -2053,7 +2053,7 @@"HeadingLevel": 2,"Properties": {"id": "20260613155453-tvixbm7",- "updated": "20260613155453"+ "updated": "20261009120841"},"Children": [{@@ -2071,12 +2071,12 @@"Type": "NodeParagraph","Properties": {"id": "20260613155453-3tiq5c7",- "updated": "20260613155453"+ "updated": "20261009120841"},"Children": [{"Type": "NodeText",- "Data": "Used for storing dates or date-times."+ "Data": "Used for storing dates or date-times, with Gregorian and Chinese lunar calendar support."}]},diff --git a/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180321-hbvl5c2/20240208113259-nykkvaq/20260613155453-n1se73o.sy b/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180321-hbvl5c2/20240208113259-nykkvaq/20260613155453-n1se73o.syindex 0fc0aef380..8b1f46bb4a 100644--- a/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180321-hbvl5c2/20240208113259-nykkvaq/20260613155453-n1se73o.sy+++ b/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180321-hbvl5c2/20240208113259-nykkvaq/20260613155453-n1se73o.sy@@ -6,7 +6,7 @@"id": "20260613155453-n1se73o","title": "字段类型","type": "doc",- "updated": "20260809232000"+ "updated": "20261009120841"},"Children": [{@@ -2053,7 +2053,7 @@"HeadingLevel": 2,"Properties": {"id": "20260613155453-n6oj93a",- "updated": "20260613155453"+ "updated": "20261009120841"},"Children": [{@@ -2071,12 +2071,12 @@"Type": "NodeParagraph","Properties": {"id": "20260613155453-xsf0r9j",- "updated": "20260613155453"+ "updated": "20261009120841"},"Children": [{"Type": "NodeText",- "Data": "用于存储日期或日期时间。"+ "Data": "用于存储日期或日期时间,支持公历和农历。"}]},diff --git a/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226121203-rjjngpz/20240208171522-y7dxcno/20260613155453-pxxzmhc.sy b/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226121203-rjjngpz/20240208171522-y7dxcno/20260613155453-pxxzmhc.syindex 8257cb7848..5831758a00 100644--- a/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226121203-rjjngpz/20240208171522-y7dxcno/20260613155453-pxxzmhc.sy+++ b/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226121203-rjjngpz/20240208171522-y7dxcno/20260613155453-pxxzmhc.sy@@ -6,7 +6,7 @@"id": "20260613155453-pxxzmhc","title": "字段類型","type": "doc",- "updated": "20260809232000"+ "updated": "20261009120841"},"Children": [{@@ -2053,7 +2053,7 @@"HeadingLevel": 2,"Properties": {"id": "20260613155453-veckkdg",- "updated": "20260613155453"+ "updated": "20261009120841"},"Children": [{@@ -2071,12 +2071,12 @@"Type": "NodeParagraph","Properties": {"id": "20260613155453-2pbevhk",- "updated": "20260613155453"+ "updated": "20261009120841"},"Children": [{"Type": "NodeText",- "Data": "用於儲存日期或日期時間。"+ "Data": "用於儲存日期或日期時間,支援西曆和農曆。"}]},diff --git a/app/guide/20240530133126-axarxgx/20240530101000-4qitucx/20240530101000-g3ugxml/20240530101000-3eaevtp/20260613155453-sncbsow.sy b/app/guide/20240530133126-axarxgx/20240530101000-4qitucx/20240530101000-g3ugxml/20240530101000-3eaevtp/20260613155453-sncbsow.syindex 5a1d52e595..3a002e38c0 100644--- a/app/guide/20240530133126-axarxgx/20240530101000-4qitucx/20240530101000-g3ugxml/20240530101000-3eaevtp/20260613155453-sncbsow.sy+++ b/app/guide/20240530133126-axarxgx/20240530101000-4qitucx/20240530101000-g3ugxml/20240530101000-3eaevtp/20260613155453-sncbsow.sy@@ -6,7 +6,7 @@"id": "20260613155453-sncbsow","title": "フィールドタイプ","type": "doc",- "updated": "20260809232000"+ "updated": "20261009120841"},"Children": [{@@ -2053,7 +2053,7 @@"HeadingLevel": 2,"Properties": {"id": "20260613155453-u24im6o",- "updated": "20260613155453"+ "updated": "20261009120841"},"Children": [{@@ -2071,12 +2071,12 @@"Type": "NodeParagraph","Properties": {"id": "20260613155453-gge1qu8",- "updated": "20260613155453"+ "updated": "20261009120841"},"Children": [{"Type": "NodeText",- "Data": "日付または日時の保存に使用します。"+ "Data": "日付または日時の保存に使用します。グレゴリオ暦と旧暦(中国暦)に対応しています。"}]},diff --git a/app/src/assets/scss/business/_av.scss b/app/src/assets/scss/business/_av.scssindex a65cf5d002..ec1ad20fad 100644--- a/app/src/assets/scss/business/_av.scss+++ b/app/src/assets/scss/business/_av.scss@@ -1,3 +1,31 @@+.av__lunar-editor {+ width: 340px;+ max-width: 100%;+}++.av__lunar-date {+ display: flex;+ flex-direction: column;+ gap: 8px;+ margin: 4px 8px 8px;+}++.av__lunar-date-controls {+ display: flex;+ flex-wrap: wrap;+ gap: 8px;++ .b3-select {+ flex: 1 1 70px;+ min-width: 0;+ max-width: 100%;+ }++ .b3-select[data-lunar-part="month"] {+ flex: 2 1 130px;+ }+}+// 单字段条件编辑器供筛选和条件颜色菜单共用。@mixin av-filter-editor {.b3-menu__item.av__filter-row {diff --git a/app/src/protyle/render/av/attributePanelVisibility.test.ts b/app/src/protyle/render/av/attributePanelVisibility.test.tsindex 09d19a839c..3e9836993c 100644--- a/app/src/protyle/render/av/attributePanelVisibility.test.ts+++ b/app/src/protyle/render/av/attributePanelVisibility.test.ts@@ -8,13 +8,14 @@ import {promisify} from "node:util";import {ScriptTarget, transpileModule} from "typescript";import {compileString} from "sass";-const browserCases = (source: string, css: string, columnSource: string, blockSource: string, menuSource: string) => {+const browserCases = (source: string, css: string, columnSource: string, blockSource: string, menuSource: string, calendarSource: string) => {const check: typeof assert = require("node:assert/strict");const config = {editor: {databaseAttrShow: true, databaseAttrHideEmpty: false, databaseAttrViewMode: 0, databaseAttrUseTabs: false}};Object.assign(window, {siyuan: {config, languages: {database: "Database", edit: "Edit", displayEmptyFields: "Show", hideEmptyFields: "Hide",default: "Default", attributePanelVisibility: "Database panel field visibility",alwaysShow: "Always show", hideWhenEmpty: "Hide when empty", alwaysHide: "Always hide",+ _attrView: {dateCalendar: "Calendar", solarCalendar: "Gregorian", lunarCalendar: "Chinese lunar"},}}});const Panel = new Function("cancelHeightAnimation", source + "\nreturn AVAttributePanel;")(() => {});const style = document.createElement("style");@@ -68,16 +69,22 @@ const browserCases = (source: string, css: string, columnSource: string, blockSolet submenuShown = 0;let mobileChoices: IMenu[] = [];Object.assign(window.siyuan, {menus: {menu: {remove() {}, showSubMenu() { submenuShown++; }}}});- const Item = new Function("updateMenuItemGroupClasses", menuSource + "\nreturn MenuItem;")(() => {});+ const Item = new Function("updateMenuItemGroupClasses", "updateHotkeyTip", menuSource + "\nreturn MenuItem;")(() => {}, (tip: string) => tip);class MobileMenu {public addItem(item: IMenu) { mobileChoices.push(item); }public open() {}}- const columns = new Function("getFieldsByData", "escapeAttr", "escapeHtml", "escapeAriaLabel", "bindRollupData", "transaction", "MenuItem", "Menu", "isMobile",+ const bindCalendar = new Function("MenuItem", "Menu", "isMobile", "setDateFieldFormat",+ calendarSource + "\nreturn bindDateCalendarMenu;")(Item, MobileMenu, () => mobile,+ (_protyle: IProtyle, avID: string, id: string, type: string, format: string, oldFormat: string) => {+ transactions.push([[{action: "setAttrViewColDateFormat", avID, id, type, format}],+ [{action: "setAttrViewColDateFormat", avID, id, type, format: oldFormat}]]);+ });+ const columns = new Function("getFieldsByData", "escapeAttr", "escapeHtml", "escapeAriaLabel", "bindRollupData", "transaction", "MenuItem", "Menu", "isMobile", "bindDateCalendarMenu", "getLabelByDateFormat",columnSource + "\nreturn {getEditHTML, bindEditEvent};")((data: IAV) => (data.view as IAVTable).columns, escape, escape, escape, () => {},(_protyle: IProtyle, operations: IOperation[], undo: IOperation[]) => transactions.push([operations, undo]),- Item, MobileMenu, () => mobile);+ Item, MobileMenu, () => mobile, bindCalendar, (format: string) => format);for (const visibility of [undefined, "always", "hide-empty", "hide"]) {const field = {id: "key", name: "Notes", type: "text", attributePanelVisibility: visibility};const data = {id: "database", viewType: "table", view: {columns: [field]}};@@ -146,6 +153,44 @@ const browserCases = (source: string, css: string, columnSource: string, blockSocheck.equal(menuElement.querySelector('[data-type="attributePanelVisibility"]'), null);menuElement.remove();}+ for (const mobileMode of [false, true]) {+ mobile = mobileMode;+ for (const previous of ["day-month-year", "lunar"]) {+ const field = {id: "birthday", name: "Birthday", type: "date", dateFormat: previous};+ const data = {id: "database", viewType: "table", view: {columns: [field]}};+ const menuElement = document.createElement("div");+ document.body.append(menuElement);+ const options = {data, colId: field.id, isCustomAttr: true, menuElement};+ menuElement.innerHTML = columns.getEditHTML(options);+ columns.bindEditEvent(options);+ const parent = menuElement.querySelector<HTMLButtonElement>('[data-type="dateCalendar"]');+ check.equal(parent.querySelector("select"), null);+ const buttons = Array.from(parent.querySelectorAll<HTMLButtonElement>(".b3-menu__submenu .b3-menu__item"));+ check.deepEqual(buttons.map(button => button.querySelector(".b3-menu__label").textContent), ["Gregorian", "Chinese lunar"]);+ check.equal(buttons.findIndex(button => !!button.querySelector(".b3-menu__checked")), previous === "lunar" ? 1 : 0);+ check.equal(menuElement.querySelector('[data-type="dateFormat"]').classList.contains("fn__none"), previous === "lunar");+ const shown = submenuShown;+ parent.dispatchEvent(new MouseEvent("mouseenter"));+ if (mobile) {+ check.equal(submenuShown, shown);+ mobileChoices = [];+ parent.click();+ check.equal(mobileChoices.length, 2);+ mobileChoices[previous === "lunar" ? 0 : 1].click(parent, new MouseEvent("click"));+ } else {+ check.equal(submenuShown, shown + 1);+ parent.dispatchEvent(new KeyboardEvent("keydown", {key: "ArrowRight", bubbles: true}));+ check.equal(document.activeElement, buttons[0]);+ buttons[previous === "lunar" ? 0 : 1].click();+ }+ check.deepEqual(transactions.at(-1), [[{+ action: "setAttrViewColDateFormat", avID: "database", id: "birthday", type: "date",+ format: previous === "lunar" ? "full" : "lunar",+ }], [{action: "setAttrViewColDateFormat", avID: "database", id: "birthday", type: "date", format: previous}]]);+ menuElement.remove();+ }+ }+ mobile = false;const tables = ["database-a", "database-b"].map(avID => ({avID, avName: avID, blockIDs: ["document"],keyValues: [@@ -227,9 +272,12 @@ test("attribute panel field rules preserve global defaults and reveal hidden fieconst menuSource = transpileModule(readFileSync("src/menus/Menu.ts", "utf8").replace(/^import [\s\S]*?;\r?\n/gm, "").replace(/^export /gm, ""),{compilerOptions: {target: ScriptTarget.ES2021}}).outputText;+ const calendarSource = transpileModule(readFileSync(path.resolve(__dirname, "dateCalendarMenu.ts"), "utf8")+ .replace(/^import [\s\S]*?;\r?\n/gm, "").replace(/^export /gm, ""),+ {compilerOptions: {target: ScriptTarget.ES2021}}).outputText;const temporary = mkdtempSync(path.join(tmpdir(), "siyuan-panel-visibility-test-"));const script = path.join(temporary, "run.cjs");- const code = "const __name = value => value; (" + browserCases.toString() + ")(" + JSON.stringify(source) + "," + JSON.stringify(css) + "," + JSON.stringify(columnSource) + "," + JSON.stringify(blockSource) + "," + JSON.stringify(menuSource) + ")";+ const code = "const __name = value => value; (" + browserCases.toString() + ")(" + JSON.stringify(source) + "," + JSON.stringify(css) + "," + JSON.stringify(columnSource) + "," + JSON.stringify(blockSource) + "," + JSON.stringify(menuSource) + "," + JSON.stringify(calendarSource) + ")";writeFileSync(script, `const {app, BrowserWindow} = require("electron");app.setPath("userData", ${JSON.stringify(path.join(temporary, "profile"))});app.whenReady().then(async () => {diff --git a/app/src/protyle/render/av/automation.ts b/app/src/protyle/render/av/automation.tsindex c4a831e32b..c6b91c2ed3 100644--- a/app/src/protyle/render/av/automation.ts+++ b/app/src/protyle/render/av/automation.ts@@ -5,7 +5,7 @@ import {escapeAttr, escapeHtml} from "../../../util/escape";import {fetchSyncPost} from "../../../util/fetch";import {transaction} from "../../wysiwyg/transaction";import {bindInlineFilterEvents, genEmptyFilterValue, getFiltersHTML} from "./filter";-import {genFieldValue, getRelationOptions, getSelectedOptionsHTML, getValueInputHTML, openFieldRelationMenu, openFieldSelectMenu, renderRelationFieldValue} from "./fieldValueEditor";+import {bindFieldLunarDates, genFieldValue, getRelationOptions, getSelectedOptionsHTML, getValueInputHTML, openFieldRelationMenu, openFieldSelectMenu, renderRelationFieldValue} from "./fieldValueEditor";import {openSearchAV} from "./relation";interface AutomationValue extends Omit<AVAutomationValueInput, "value"> {@@ -245,6 +245,7 @@ export const openAutomationMenu = async (options: {`<button type="button" class="b3-button b3-button--cancel" data-role="field-value" data-value-type="${field.type}" data-selected="${escapeAttr(JSON.stringify(selected))}">${getSelectedOptionsHTML(field, selected) || lang.select}</button>` :getValueInputHTML(field, {mode: "static", value: value.value});const input = host.querySelector<HTMLElement>('[data-role="field-value"]');+ bindFieldLunarDates(host);const update = () => {if (input instanceof HTMLInputElement && !input.checkValidity()) {input.reportValidity();diff --git a/app/src/protyle/render/av/col.ts b/app/src/protyle/render/av/col.tsindex f953d23c35..a239324b94 100644--- a/app/src/protyle/render/av/col.ts+++ b/app/src/protyle/render/av/col.ts@@ -11,6 +11,7 @@ import {openMenuPanel} from "./openMenuPanel";import {getPropertiesHTML} from "./panels/properties";import {getLabelByNumberFormat} from "./number";import {getDefaultDateFormat, getLabelByDateFormat} from "./dateFormat";+import {bindDateCalendarMenu} from "./dateCalendarMenu";import {removeAttrViewColAnimation, updateAttrViewCellAnimation, updateAttrViewColAnimation} from "./action";import {openEmojiPanel, unicode2Emoji} from "../../../emoji";import {focusBlock} from "../../util/selection";@@ -201,7 +202,8 @@ export const getEditHTML = (options: {getRollupHTML({data: options.data, colData});} else if (colData.type === "date") {html += `<button class="b3-menu__separator" data-id="separator_2"></button>-<button class="b3-menu__item" data-type="dateFormat" data-format="${colData.dateFormat || ""}">+<button class="b3-menu__item" data-type="dateCalendar"><svg class="b3-menu__icon"><use xlink:href="#iconMode"></use></svg><span class="b3-menu__label">${window.siyuan.languages._attrView.dateCalendar}</span><span class="b3-menu__accelerator">${colData.dateFormat === "lunar" ? window.siyuan.languages._attrView.lunarCalendar : window.siyuan.languages._attrView.solarCalendar}</span><svg class="b3-menu__icon b3-menu__icon--small"><use xlink:href="#iconRight"></use></svg></button>+<button class="b3-menu__item${colData.dateFormat === "lunar" ? " fn__none" : ""}" data-type="dateFormat" data-format="${colData.dateFormat || ""}"><svg class="b3-menu__icon"><use xlink:href="#iconFormat"></use></svg><span class="b3-menu__label">${window.siyuan.languages._attrView.dateFormat}</span><span class="b3-menu__accelerator">${getLabelByDateFormat(colData.dateFormat)}</span>@@ -303,6 +305,7 @@ export const bindEditEvent = (options: {const avID = options.data.id;const colId = options.menuElement.querySelector(".b3-menu__item").getAttribute("data-col-id");const colData = getFieldsByData(options.data).find((item: IAVColumn) => item.id === colId);+ bindDateCalendarMenu(options.protyle, avID, colData, options.menuElement);const visibilityElement = options.menuElement.querySelector('[data-type="attributePanelVisibility"]');if (visibilityElement) {const choices: Array<[IAVColumn["attributePanelVisibility"], string]> = [diff --git a/app/src/protyle/render/av/date.ts b/app/src/protyle/render/av/date.tsindex 7874197ece..66f58c8a60 100644--- a/app/src/protyle/render/av/date.ts+++ b/app/src/protyle/render/av/date.ts@@ -2,9 +2,13 @@ import * as dayjs from "dayjs";import {genCellValueByElement, updateCellsValue} from "./cell";import {getFieldsByData} from "./view";import {shouldSubmitDateEdit} from "./dateSubmit";+import {bindLunarDateEvent, getLunarDateHTML} from "./lunarDate";-export const getDateHTML = (cellElements: HTMLElement[]) => {+export const getDateHTML = (cellElements: HTMLElement[], format?: TAVDateFormat) => {const cellValue = genCellValueByElement("date", cellElements[0]).date;+ if ((format ?? cellElements[0].dataset.dateFormat) === "lunar") {+ return getLunarDateHTML(cellValue);+ }const isNotTime = cellValue.isNotTime;let value = "";const currentDate = Date.now();@@ -58,7 +62,11 @@ export const bindDateEvent = (options: {blockElement: Element,cellElements: HTMLElement[],requireExplicitChange?: boolean,+ format?: TAVDateFormat,}) => {+ if ((options.format ?? options.cellElements?.[0]?.dataset.dateFormat) === "lunar") {+ return bindLunarDateEvent(options);+ }const inputElements: NodeListOf<HTMLInputElement> = options.menuElement.querySelectorAll("input");let dirty = false;diff --git a/app/src/protyle/render/av/dateCalendarMenu.ts b/app/src/protyle/render/av/dateCalendarMenu.tsnew file mode 100644index 0000000000..221ec4259d--- /dev/null+++ b/app/src/protyle/render/av/dateCalendarMenu.ts@@ -0,0 +1,66 @@+import {Menu} from "../../../plugin/Menu";+import {MenuItem} from "../../../menus/Menu";+import {isMobile} from "../../../util/functions";+import {setDateFieldFormat} from "./dateFormatMenu";++export const bindDateCalendarMenu = (protyle: IProtyle, avID: string, field: IAVColumn, menuElement: HTMLElement) => {+ const placeholder = menuElement.querySelector('[data-type="dateCalendar"]');+ if (!placeholder) {+ return;+ }+ const lang = window.siyuan.languages._attrView;+ const items: IMenu[] = [false, true].map(lunar => ({+ label: lunar ? lang.lunarCalendar : lang.solarCalendar,+ iconHTML: "",+ checked: (field.dateFormat === "lunar") === lunar,+ click: () => {+ if ((field.dateFormat === "lunar") !== lunar) {+ setDateFieldFormat(protyle, avID, field.id, "date", lunar ? "lunar" : "full", field.dateFormat || "");+ }+ menuElement.closest(".av__panel")?.remove();+ },+ }));+ const item = new MenuItem({icon: "iconMode", label: lang.dateCalendar,+ accelerator: field.dateFormat === "lunar" ? lang.lunarCalendar : lang.solarCalendar, submenu: items});+ placeholder.replaceWith(item.element);+ item.element.dataset.type = "dateCalendar";+ const submenu = item.element.querySelector<HTMLElement>(".b3-menu__submenu");+ const show = () => {+ item.element.classList.add("b3-menu__item--show");+ window.siyuan.menus.menu.showSubMenu(submenu);+ };+ if (!isMobile()) {+ item.element.addEventListener("mouseenter", show);+ menuElement.addEventListener("mouseover", event => {+ const hovered = (event.target as Element).closest(".b3-menu__item");+ if (hovered && !item.element.contains(hovered)) {+ item.element.classList.remove("b3-menu__item--show");+ }+ });+ item.element.addEventListener("keydown", event => {+ if (event.key === "ArrowRight") {+ event.preventDefault();+ event.stopPropagation();+ show();+ submenu.querySelector<HTMLButtonElement>(".b3-menu__item").focus();+ } else if (event.key === "ArrowLeft" || event.key === "Escape") {+ event.preventDefault();+ event.stopPropagation();+ item.element.classList.remove("b3-menu__item--show");+ item.element.focus();+ }+ });+ }+ item.element.addEventListener("click", event => {+ event.preventDefault();+ event.stopPropagation();+ if (isMobile()) {+ const menu = new Menu(undefined, undefined, true);+ items.forEach(choice => menu.addItem(choice));+ const rect = item.element.getBoundingClientRect();+ menu.open({x: rect.left, y: rect.bottom, h: rect.height});+ } else {+ show();+ }+ });+};diff --git a/app/src/protyle/render/av/dateFormat.ts b/app/src/protyle/render/av/dateFormat.tsindex afc755e226..4d32383b02 100644--- a/app/src/protyle/render/av/dateFormat.ts+++ b/app/src/protyle/render/av/dateFormat.ts@@ -1,4 +1,5 @@import {isAVDateType} from "./capabilities";+import {formatLunarDate, lunarToSolar, parseLunarDate, solarToLunar} from "./lunarCalendar";const pad = (value: number) => value.toString().padStart(2, "0");const getMonths = (): string[] => window.siyuan.languages._attrView.dateMonths.split("|");@@ -12,7 +13,10 @@ export const formatDateDisplay = (content: number, format: TAVDateFormat = "", iconst month = date.getMonth() + 1;const day = date.getDate();let formatted: string;- if (format === "full") {+ if (format === "lunar") {+ const lunar = solarToLunar(content);+ formatted = lunar ? formatLunarDate(lunar) : `${year.toString().padStart(4, "0")}-${pad(month)}-${pad(day)} (${window.siyuan.languages._attrView.lunarRange})`;+ } else if (format === "full") {formatted = window.siyuan.languages._attrView.dateFormatFullTemplate.replaceAll("${year}", year.toString()).replaceAll("${month}", getMonths()[month - 1] || date.toLocaleString(undefined, {month: "long"}))@@ -79,7 +83,7 @@ const parseFullDate = (value: string) => {};};-const parseDateEndpoint = (value: string, format: TAVDateFormat) => {+const parseDateEndpoint = (value: string, format: TAVDateFormat): {content: number, isNotTime: boolean} | undefined => {const trimmed = value.trim();const timeMatch = trimmed.match(/\s+(\d{1,2}):(\d{2})$/);const hour = timeMatch ? Number(timeMatch[1]) : 0;@@ -88,7 +92,17 @@ const parseDateEndpoint = (value: string, format: TAVDateFormat) => {let year: number;let month: number;let day: number;- if (format === "full") {+ if (format === "lunar") {+ const lunar = parseLunarDate(dateText);+ if (!lunar) {+ const suffix = ` (${window.siyuan.languages._attrView.lunarRange})`;+ const solarText = dateText.endsWith(suffix) ? dateText.slice(0, -suffix.length) : dateText;+ return /^\d{4}-\d{1,2}-\d{1,2}$/.test(solarText) ?+ parseDateEndpoint(solarText + (timeMatch ? timeMatch[0] : ""), "") : undefined;+ }+ const content = lunar && lunarToSolar(lunar, hour, minute);+ return content === undefined ? undefined : {content, isNotTime: !timeMatch};+ } else if (format === "full") {const parts = parseFullDate(dateText);if (!parts) {return;@@ -143,7 +157,8 @@ const parseDateEndpoint = (value: string, format: TAVDateFormat) => {};export const parseDateValue = (value: string, format: TAVDateFormat = ""): IAVCellDateValue => {- const endpoints = value.split(/\s*→\s*|\s+[~-]\s+/);+ const normalized = format === "lunar" ? value.replaceAll(` (${window.siyuan.languages._attrView.lunarRange})`, "") : value;+ const endpoints = normalized.split(/\s*→\s*|\s+[~-]\s+/);if (endpoints.length > 2) {return {content: null, isNotEmpty: false, content2: null, isNotEmpty2: false, hasEndDate: false, isNotTime: true};}@@ -164,6 +179,9 @@ export const parseDateValue = (value: string, format: TAVDateFormat = ""): IAVCe};export const getLabelByDateFormat = (format: TAVDateFormat = "") => {+ if (format === "lunar") {+ return window.siyuan.languages._attrView.lunarCalendar;+ }if (format === "full") {return window.siyuan.languages._attrView.fullDate;}diff --git a/app/src/protyle/render/av/dateFormatMenu.ts b/app/src/protyle/render/av/dateFormatMenu.tsindex 1084c37417..4d23ac34f6 100644--- a/app/src/protyle/render/av/dateFormatMenu.ts+++ b/app/src/protyle/render/av/dateFormatMenu.ts@@ -13,6 +13,14 @@ const refreshDatabaseAttributePanels = (protyle: IProtyle, avID: string) => {});};+export const setDateFieldFormat = (protyle: IProtyle, avID: string, colId: string,+ type: "date" | "created" | "updated", format: TAVDateFormat, oldFormat: TAVDateFormat) => {+ transaction(protyle, [{action: "setAttrViewColDateFormat", id: colId, avID, format, type}],+ [{action: "setAttrViewColDateFormat", id: colId, avID, format: oldFormat, type}], {+ callback: () => refreshDatabaseAttributePanels(protyle, avID),+ });+};+export const formatDate = (options: {avPanelElement: Element,element: HTMLElement,@@ -30,21 +38,7 @@ export const formatDate = (options: {label: getLabelByDateFormat(format),accelerator: format === "full" ? formatDateDisplay(Date.now(), format) : undefined,click() {- transaction(options.protyle, [{- action: "setAttrViewColDateFormat",- id: options.colId,- avID: options.avID,- format,- type: options.type,- }], [{- action: "setAttrViewColDateFormat",- id: options.colId,- avID: options.avID,- format: options.oldFormat,- type: options.type,- }], {- callback: () => refreshDatabaseAttributePanels(options.protyle, options.avID),- });+ setDateFieldFormat(options.protyle, options.avID, options.colId, options.type, format, options.oldFormat);options.avPanelElement.remove();}});diff --git a/app/src/protyle/render/av/fieldValueEditor.ts b/app/src/protyle/render/av/fieldValueEditor.tsindex cc442eecba..63d3398123 100644--- a/app/src/protyle/render/av/fieldValueEditor.ts+++ b/app/src/protyle/render/av/fieldValueEditor.ts@@ -9,6 +9,8 @@ import {getAVColorStyle} from "./color";import {createAVPlainTextEditValue} from "./richTextValue";import {getFileTreeIconHTML} from "../../../emoji/fileTreeIcon";import {renderAVBlockIcon} from "./blockIcon";+import {formatDateValue} from "./dateFormat";+import {bindLunarDateEditor, getLunarDateHTML} from "./lunarDate";export const getSelectedOptionNames = (element: HTMLElement) => {try {@@ -76,6 +78,9 @@ export const genFieldValue = (column: IAVColumn, input: HTMLElement, previousValcase "number":return {type: column.type, number: {content: Number(content), isNotEmpty: content !== ""}};case "date":+ if (column.dateFormat === "lunar") {+ return {type: "date", date: JSON.parse(input.dataset.lunarValue)};+ }return {type: column.type,date: {@@ -122,6 +127,10 @@ export const genFieldValue = (column: IAVColumn, input: HTMLElement, previousValexport const getValueInputHTML = (column: IAVColumn, fieldValue?: IAVNewItemFieldValue) => {const value = fieldValue?.value;+ if (column.type === "date" && column.dateFormat === "lunar") {+ const date = value?.date || {isNotEmpty: false, isNotTime: !column.date?.fillSpecificTime};+ return `<button type="button" class="b3-button b3-button--cancel${fieldValue?.mode === "currentTime" ? " fn__none" : ""}" data-role="field-value" data-value-type="lunarDate" data-lunar-value="${escapeAttr(JSON.stringify(date))}">${escapeHtml(formatDateValue(date, "lunar") || window.siyuan.languages.select)}</button>`;+ }if (column.type === "checkbox") {const checked = value?.checkbox?.checked || false;return `<button class="fn__flex-center" data-role="field-value" data-value-type="checkbox" aria-label="${escapeAttr(column.name || window.siyuan.languages.checkbox)}" aria-pressed="${checked}" type="button" style="background:transparent;border:0;color:inherit;padding:0"><svg class="av__checkbox"><use xlink:href="#icon${checked ? "Check" : "Uncheck"}"></use></svg></button>`;@@ -144,6 +153,34 @@ export const getValueInputHTML = (column: IAVColumn, fieldValue?: IAVNewItemFielreturn `<input class="b3-text-field b3-text-field--text fn__flex-1${hiddenClass}" data-role="field-value" type="${inputType}"${column.type === "number" ? ' step="any"' : ""}${max} value="${escapeAttr(getFieldText(value))}">`;};+export const bindFieldLunarDates = (host: HTMLElement) => {+ host.querySelectorAll<HTMLElement>('[data-value-type="lunarDate"]').forEach(target => target.addEventListener("click", event => {+ event.preventDefault();+ event.stopPropagation();+ const value: IAVCellDateValue = JSON.parse(target.dataset.lunarValue);+ let submit: () => void;+ const menu = new Menu("av-field-lunar-date", () => submit?.(), true);+ menu.addItem({+ type: "empty",+ label: getLunarDateHTML(value),+ bind: element => {+ element.classList.add("b3-menu__custom");+ submit = bindLunarDateEditor({+ value, menuElement: element, requireExplicitChange: true,+ update: date => {+ target.dataset.lunarValue = JSON.stringify(date);+ target.textContent = formatDateValue(date, "lunar") || window.siyuan.languages.select;+ target.dispatchEvent(new Event("change", {bubbles: true}));+ },+ close: () => menu.close(),+ });+ },+ });+ const rect = target.getBoundingClientRect();+ menu.open({x: rect.left, y: rect.bottom, h: rect.height});+ }));+};+export const openFieldSelectMenu = (target: HTMLElement, column: IAVColumn) => {const menu = new Menu("av-new-item-template-field-value");if (menu.isOpen) {diff --git a/app/src/protyle/render/av/lunarCalendar.test.ts b/app/src/protyle/render/av/lunarCalendar.test.tsnew file mode 100644index 0000000000..2e54046c88--- /dev/null+++ b/app/src/protyle/render/av/lunarCalendar.test.ts@@ -0,0 +1,77 @@+import * as assert from "node:assert/strict";+import {readFileSync, readdirSync} from "node:fs";+import {join} from "node:path";+import {test} from "node:test";+import {formatLunarDate, getLunarMonths, lunarToSolar, parseLunarDate, solarToLunar} from "./lunarCalendar";+import {formatDateDisplay, parseDateValue} from "./dateFormat";++const languagesPath = join(__dirname, "../../../../appearance/langs");+const setLanguage = (name: string) => Object.defineProperty(globalThis, "window", {+ configurable: true, value: {siyuan: {languages: JSON.parse(readFileSync(join(languagesPath, name), "utf8"))}},+});++test("lunar input distinguishes leap months and rejects invalid or uncovered dates", () => {+ assert.deepEqual(solarToLunar(new Date(2025, 6, 25).valueOf()), {year: 2025, month: -6, day: 1});+ assert.notEqual(lunarToSolar({year: 2025, month: 6, day: 1}), lunarToSolar({year: 2025, month: -6, day: 1}));+ for (const date of [{year: 2026, month: -6, day: 1}, {year: 2025, month: -6, day: 30},+ {year: 1900, month: 1, day: 1}, {year: 2100, month: 12, day: 2}]) {+ assert.equal(lunarToSolar(date), undefined);+ }+ assert.equal(solarToLunar(new Date(1901, 1, 18).valueOf()), undefined);+ assert.equal(solarToLunar(new Date(2101, 0, 1).valueOf()), undefined);+ const early = new Date(0);+ early.setFullYear(50, 0, 2);+ assert.equal(solarToLunar(early.valueOf()), undefined);+ assert.equal(lunarToSolar({year: 2025, month: 1, day: 1.5}), undefined);+ assert.equal(lunarToSolar({year: 2025, month: 1, day: 1}, 24), undefined);+});++test("nonexistent local times during daylight saving transitions are rejected", () => {+ const originalTimezone = process.env.TZ;+ try {+ process.env.TZ = "America/New_York";+ const lunar = solarToLunar(new Date(2024, 2, 10, 1).valueOf());+ assert.equal(lunarToSolar(lunar, 2, 30), undefined);+ assert.notEqual(lunarToSolar(lunar, 3, 30), undefined);+ } finally {+ if (originalTimezone === undefined) {+ delete process.env.TZ;+ } else {+ process.env.TZ = originalTimezone;+ }+ }+});++test("all supported month boundaries round trip in the existing local date semantics", () => {+ for (let year = 1901; year <= 2100; year++) {+ for (const month of getLunarMonths(year)) {+ for (const day of [1, month[3]]) {+ const lunar = {year, month: month[1], day};+ assert.deepEqual(solarToLunar(lunarToSolar(lunar, 14, 7)), lunar);+ }+ }+ }+});++test("all localized lunar display and clipboard values round trip, including date ranges", () => {+ for (const language of readdirSync(languagesPath).filter(name => name.endsWith(".json"))) {+ setLanguage(language);+ const lunar = {year: 2025, month: -6, day: 1};+ assert.deepEqual(parseLunarDate(formatLunarDate(lunar)), lunar, language);+ const start = lunarToSolar(lunar, 14, 7);+ const end = lunarToSolar({...lunar, day: 2}, 15, 8);+ const text = `${formatDateDisplay(start, "lunar", false)} → ${formatDateDisplay(end, "lunar", false)}`;+ const parsed = parseDateValue(text, "lunar");+ assert.equal(parsed.content, start, language);+ assert.equal(parsed.content2, end, language);+ assert.equal(parsed.hasEndDate, true, language);+ assert.equal(parsed.isNotTime, false, language);+ const original = new Date(1800, 0, 2, 14, 7).valueOf();+ assert.equal(parseDateValue(formatDateDisplay(original, "lunar", false), "lunar").content, original, language);+ }+});++test("Gregorian clipboard dates remain accepted in lunar fields", () => {+ setLanguage("en.json");+ assert.equal(parseDateValue("2025-07-25 14:07", "lunar").content, new Date(2025, 6, 25, 14, 7).valueOf());+});diff --git a/app/src/protyle/render/av/lunarCalendar.ts b/app/src/protyle/render/av/lunarCalendar.tsnew file mode 100644index 0000000000..1a8122d832--- /dev/null+++ b/app/src/protyle/render/av/lunarCalendar.ts@@ -0,0 +1,91 @@+import data = require("../../../../../kernel/av/lunar_calendar_data.json");++const dayMilliseconds = 86400000;+const months = data.months;+export const lunarFirstYear = data.firstYear;+export const lunarLastYear = data.lastYear;++export interface ILunarDate {+ year: number;+ month: number;+ day: number;+}++// 月份为负数表示闰月;时间戳按现有日期字段的本地日历日解释。+export const solarToLunar = (content: number): ILunarDate | undefined => {+ const solar = new Date(content);+ if (solar.getFullYear() < lunarFirstYear || solar.getFullYear() > lunarLastYear || !Number.isFinite(content)) {+ return undefined;+ }+ const day = Date.UTC(solar.getFullYear(), solar.getMonth(), solar.getDate()) / dayMilliseconds;+ let low = 0;+ let high = months.length;+ while (low < high) {+ const middle = (low + high) >>> 1;+ if (months[middle][2] <= day) {+ low = middle + 1;+ } else {+ high = middle;+ }+ }+ const month = months[low - 1];+ return month && day >= month[2] && day < month[2] + month[3] ?+ {year: month[0], month: month[1], day: day - month[2] + 1} : undefined;+};++export const getLunarMonths = (year: number) => months.filter(month => month[0] === year);++export const lunarToSolar = (lunar: ILunarDate, hours = 0, minutes = 0): number | undefined => {+ const month = months.find(month => month[0] === lunar.year && month[1] === lunar.month);+ if (!month || !Number.isInteger(lunar.day) || lunar.day < 1 || lunar.day > month[3] ||+ !Number.isInteger(hours) || hours < 0 || hours > 23 || !Number.isInteger(minutes) || minutes < 0 || minutes > 59) {+ return undefined;+ }+ const civil = new Date((month[2] + lunar.day - 1) * dayMilliseconds);+ const result = new Date(civil.getUTCFullYear(), civil.getUTCMonth(), civil.getUTCDate(), hours, minutes);+ // 夏令时造成不存在的本地时间时返回错误,不把输入静默调整为其它时间。+ if (result.getFullYear() !== civil.getUTCFullYear() || result.getMonth() !== civil.getUTCMonth() ||+ result.getDate() !== civil.getUTCDate() || result.getHours() !== hours || result.getMinutes() !== minutes) {+ return undefined;+ }+ return result.valueOf();+};++export const getLunarMonthLabel = (month: number) => {+ const label = window.siyuan.languages._attrView.lunarMonths.split("|")[Math.abs(month) - 1];+ return month < 0 ? window.siyuan.languages._attrView.lunarLeapMonth.replace("${month}", label) : label;+};++export const getLunarDayLabel = (day: number) => window.siyuan.languages._attrView.lunarDays.split("|")[day - 1];++export const formatLunarDate = (lunar: ILunarDate) => window.siyuan.languages._attrView.lunarDateTemplate+ .replaceAll("${year}", lunar.year.toString())+ .replaceAll("${month}", getLunarMonthLabel(lunar.month))+ .replaceAll("${day}", getLunarDayLabel(lunar.day));++export const parseLunarDate = (content: string): ILunarDate | undefined => {+ const escape = (text: string) => text.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");+ const names = Array.from({length: 12}, (_, index) => [getLunarMonthLabel(index + 1), getLunarMonthLabel(-index - 1)]).flat();+ const days: string[] = window.siyuan.languages._attrView.lunarDays.split("|");+ const captures: string[] = [];+ const pattern = window.siyuan.languages._attrView.lunarDateTemplate.split(/(\$\{year}|\$\{month}|\$\{day})/).map((token: string) => {+ if (token === "${year}") {+ captures.push("year");+ return "(\\d{4})";+ }+ if (token === "${month}" || token === "${day}") {+ captures.push(token === "${month}" ? "month" : "day");+ return `(${(token === "${month}" ? names : days).map(escape).sort((a, b) => b.length - a.length).join("|")})`;+ }+ return escape(token);+ }).join("");+ const match = content.match(new RegExp(`^${pattern}$`));+ if (!match) {+ return undefined;+ }+ const parts: Record<string, string> = {};+ captures.forEach((key, index) => parts[key] = match[index + 1]);+ const index = names.indexOf(parts.month);+ const lunar = {year: Number(parts.year), month: (Math.floor(index / 2) + 1) * (index % 2 ? -1 : 1), day: days.indexOf(parts.day) + 1};+ return lunarToSolar(lunar) === undefined ? undefined : lunar;+};diff --git a/app/src/protyle/render/av/lunarDate.test.ts b/app/src/protyle/render/av/lunarDate.test.tsnew file mode 100644index 0000000000..3720b3bd0c--- /dev/null+++ b/app/src/protyle/render/av/lunarDate.test.ts@@ -0,0 +1,154 @@+import * as assert from "node:assert/strict";+import {execFile} from "node:child_process";+import {mkdtempSync, readFileSync, rmSync, writeFileSync} from "node:fs";+import {tmpdir} from "node:os";+import * as path from "node:path";+import {test} from "node:test";+import {promisify} from "node:util";+import {ModuleKind, ScriptTarget, transpileModule} from "typescript";+import {compileString} from "sass";++const browserCases = (sources: Record<string, string>, language: Record<string, unknown>, data: unknown, css: string) => {+ const check: typeof assert = require("node:assert/strict");+ const modules: Record<string, unknown> = {+ "../../../../../kernel/av/lunar_calendar_data.json": data,+ "./capabilities": {},+ "./cell": {},+ "./view": {},+ "../../../util/escape": {+ escapeAttr: (value: string) => value.replaceAll("&", "&").replaceAll('"', """).replaceAll("<", "<").replaceAll(">", ">"),+ escapeHtml: (value: string) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">"),+ },+ "../../../dialog/message": {showMessage: () => {}},+ };+ Object.assign(window, {siyuan: {languages: language}});+ for (const [name, source] of Object.entries(sources)) {+ const exports = {};+ new Function("require", "exports", source)((name: string) => modules[name], exports);+ modules["./" + name] = exports;+ }+ const editor = modules["./lunarDate"] as typeof import("./lunarDate");+ const style = document.createElement("style");+ style.textContent = css + ".fn__none{display:none} body{margin:0} .b3-menu{max-width:100%;width:max-content}";+ document.head.append(style);+ const menu = document.createElement("div");+ menu.classList.add("b3-menu");+ document.body.append(menu);+ let updates: IAVCellDateValue[] = [];+ let closeCount = 0;+ let submit: () => void;+ const original: IAVCellDateValue = {+ content: new Date(2025, 6, 25, 14, 7, 35, 123).valueOf(), isNotEmpty: true, isNotTime: false,+ content2: new Date(2025, 6, 26, 15, 8, 45, 456).valueOf(), isNotEmpty2: true, hasEndDate: true,+ };+ const mount = (value = original, explicit = false) => {+ updates = [];+ menu.innerHTML = editor.getLunarDateHTML(value);+ submit = editor.bindLunarDateEditor({value, menuElement: menu, requireExplicitChange: explicit,+ update: value => updates.push(value), close: () => closeCount++});+ };+ const first = () => menu.querySelector<HTMLElement>("[data-lunar-endpoint]");+ const select = (part: string, value: string) => {+ const control = first().querySelector<HTMLSelectElement>(`[data-lunar-part="${part}"]`);+ control.value = value;+ control.dispatchEvent(new Event("change", {bubbles: true}));+ };+ mount();+ select("year", "2026");+ check.equal(first().querySelector<HTMLSelectElement>('[data-lunar-part="month"]').value, "");+ check.equal(first().querySelector<HTMLSelectElement>('[data-lunar-part="day"]').value, "");+ check.equal(first().querySelector("[data-lunar-error]").classList.contains("fn__none"), false);+ submit();+ check.equal(updates.length, 0, "invalid input keeps the stored date");+ select("month", "8");+ select("day", "15");+ submit();+ check.equal(updates[0].content, new Date(2026, 8, 25, 14, 7).valueOf());+ check.equal(updates[0].content2, original.content2, "editing the start preserves the end timestamp");+ mount();+ select("month", "6");+ select("day", "30");+ select("month", "-6");+ check.equal(first().querySelector<HTMLSelectElement>('[data-lunar-part="day"]').value, "");+ submit();+ check.equal(updates.length, 0, "a short month does not clamp the thirtieth day");+ mount();+ menu.querySelector<HTMLInputElement>("[data-lunar-end]").click();+ submit();+ check.equal(updates[0].content, original.content);+ check.equal(updates[0].content2, original.content2);+ check.equal(updates[0].hasEndDate, false);+ mount({content: new Date(1800, 0, 2).valueOf(), isNotEmpty: true, isNotTime: true});+ submit();+ check.equal(updates.length, 0, "old dates outside the conversion table remain unchanged");+ mount({isNotEmpty: false, isNotTime: true}, true);+ submit();+ check.equal(updates.length, 0, "cancelling empty input does not save the prefilled date");+ select("year", "2025");+ select("month", "-6");+ select("day", "1");+ submit();+ check.equal(updates[0].isNotEmpty2, false, "a disabled end date stays empty");+ mount();+ menu.querySelector<HTMLButtonElement>('[data-type="clearDate"]').click();+ submit();+ check.equal(updates.length, 1);+ check.equal(updates[0].isNotEmpty, false);+ check.equal(updates[0].isNotEmpty2, false);+ check.equal(closeCount, 1);+ mount();+ for (const control of Array.from(menu.querySelectorAll<HTMLElement>("input, select"))) {+ if (getComputedStyle(control).display === "none") {+ continue;+ }+ check.ok(control.getBoundingClientRect().right <= window.innerWidth, "controls fit a narrow viewport");+ const key = new KeyboardEvent("keydown", {key: "ArrowDown", bubbles: true, cancelable: true});+ control.dispatchEvent(key);+ check.equal(key.defaultPrevented, false, "native control navigation remains available");+ if (control instanceof HTMLSelectElement) {+ const before = closeCount;+ control.dispatchEvent(new KeyboardEvent("keydown", {key: "Enter", bubbles: true}));+ check.equal(closeCount, before, "Enter on a select confirms its option without closing the editor");+ }+ }+ return "Lunar date editor cases passed";+};++test("lunar date controls preserve dates, validate selections, and fit narrow layouts", {+ skip: process.platform === "linux" && !process.env.DISPLAY && !process.env.WAYLAND_DISPLAY,+ timeout: 45000,+}, async () => {+ const sources = Object.fromEntries(["lunarCalendar", "dateFormat", "dateSubmit", "lunarDate"].map(name => [name,+ transpileModule(readFileSync(path.join(__dirname, name + ".ts"), "utf8"), {+ compilerOptions: {module: ModuleKind.CommonJS, target: ScriptTarget.ES2021},+ }).outputText]));+ const language = JSON.parse(readFileSync("appearance/langs/zh-CN.json", "utf8"));+ const data = JSON.parse(readFileSync("../kernel/av/lunar_calendar_data.json", "utf8"));+ const css = compileString(readFileSync("src/assets/scss/business/_av.scss", "utf8")).css;+ const temporary = mkdtempSync(path.join(tmpdir(), "siyuan-lunar-date-test-"));+ const script = path.join(temporary, "run.cjs");+ const args = [sources, language, data, css].map(value => JSON.stringify(value)).join(",");+ const code = "const __name = value => value; (" + browserCases.toString() + ")(" + args + ")";+ writeFileSync(script, `const {app, BrowserWindow} = require("electron");+app.setPath("userData", ${JSON.stringify(path.join(temporary, "profile"))});+app.whenReady().then(async () => {+ const win = new BrowserWindow({show:false, width:320, height:700, webPreferences:{nodeIntegration:true, contextIsolation:false}});+ try {+ await win.loadURL("data:text/html,<html><body></body></html>");+ console.log(await win.webContents.executeJavaScript(${JSON.stringify(code)}));+ app.exit(0);+ } catch (error) {console.error(error); app.exit(1);}+});`, "utf8");+ const env = {...process.env};+ delete env.ELECTRON_RUN_AS_NODE;+ try {+ const result = await promisify(execFile)(require("electron") as unknown as string, [script], {+ env, windowsHide: true, timeout: 40000,+ });+ assert.match(result.stdout, /Lunar date editor cases passed/);+ } finally {+ if (path.dirname(path.resolve(temporary)) === path.resolve(tmpdir()) && path.basename(temporary).startsWith("siyuan-lunar-date-test-")) {+ rmSync(temporary, {recursive: true, force: true});+ }+ }+});diff --git a/app/src/protyle/render/av/lunarDate.ts b/app/src/protyle/render/av/lunarDate.tsnew file mode 100644index 0000000000..cbd35ddc3b--- /dev/null+++ b/app/src/protyle/render/av/lunarDate.ts@@ -0,0 +1,160 @@+import {escapeAttr, escapeHtml} from "../../../util/escape";+import {showMessage} from "../../../dialog/message";+import {genCellValueByElement, updateCellsValue} from "./cell";+import {getFieldsByData} from "./view";+import {shouldSubmitDateEdit} from "./dateSubmit";+import {getLunarDayLabel, getLunarMonthLabel, getLunarMonths, lunarFirstYear, lunarLastYear, lunarToSolar, solarToLunar} from "./lunarCalendar";+import {formatDateDisplay} from "./dateFormat";++const option = (value: number, label: string, selected?: number) =>+ `<option value="${value}"${value === selected ? " selected" : ""}>${escapeHtml(label)}</option>`;++const getEndpointHTML = (content: number, isNotTime: boolean, hidden: boolean) => {+ const lunar = solarToLunar(content);+ const solar = new Date(content);+ const lang = window.siyuan.languages;+ const month = lunar && getLunarMonths(lunar.year).find(month => month[1] === lunar.month);+ return `<div class="av__lunar-date${hidden ? " fn__none" : ""}" data-lunar-endpoint>+<div class="av__lunar-date-controls">+<select class="b3-select" data-lunar-part="year" aria-label="${escapeAttr(lang.year)}"><option value="">${escapeHtml(lang.year)}</option>${Array.from({length: lunarLastYear - lunarFirstYear + 1}, (_, index) => option(index + lunarFirstYear, String(index + lunarFirstYear), lunar?.year)).join("")}</select>+<select class="b3-select" data-lunar-part="month" aria-label="${escapeAttr(lang.month)}"><option value="">${escapeHtml(lang.month)}</option>${lunar ? getLunarMonths(lunar.year).map(month => option(month[1], getLunarMonthLabel(month[1]), lunar.month)).join("") : ""}</select>+<select class="b3-select" data-lunar-part="day" aria-label="${escapeAttr(lang.day)}"><option value="">${escapeHtml(lang.day)}</option>${month ? Array.from({length: month[3]}, (_, day) => option(day + 1, getLunarDayLabel(day + 1), lunar.day)).join("") : ""}</select>+</div>+<input type="time" class="b3-text-field${isNotTime ? " fn__none" : ""}" data-lunar-time value="${String(solar.getHours()).padStart(2, "0")}:${String(solar.getMinutes()).padStart(2, "0")}" aria-label="${escapeAttr(lang.includeTime)}">+<div class="ft__smaller ft__on-surface" data-lunar-preview>${escapeHtml(lunar ? lang._attrView.solarCalendar + " " + formatDateDisplay(content, "full", isNotTime) : lang._attrView.lunarRange)}</div>+<div class="ft__error ft__smaller fn__none" data-lunar-error role="alert">${escapeHtml(lang._attrView.lunarInvalid)}</div>+</div>`;+};++export const getLunarDateHTML = (value: IAVCellDateValue) => {+ const now = Date.now();+ const lang = window.siyuan.languages;+ return `<div class="b3-menu__items">+<div class="av__lunar-editor">+<div class="ft__smaller ft__on-surface">${lang._attrView.lunarCalendar}</div>+${getEndpointHTML(value.isNotEmpty ? value.content : now, value.isNotTime, false)}+${getEndpointHTML(value.isNotEmpty2 ? value.content2 : now, value.isNotTime, !value.hasEndDate)}+<button class="b3-menu__separator"></button>+<label class="b3-menu__item"><span class="fn__flex-center">${lang.endDate}</span><span class="fn__space fn__flex-1"></span><input data-lunar-end type="checkbox" class="b3-switch b3-switch--menu"${value.hasEndDate ? " checked" : ""}></label>+<label class="b3-menu__item"><span class="fn__flex-center">${lang.includeTime}</span><span class="fn__space fn__flex-1"></span><input data-lunar-include-time type="checkbox" class="b3-switch b3-switch--menu"${value.isNotTime ? "" : " checked"}></label>+<button class="b3-menu__separator"></button>+<button class="b3-menu__item" data-type="clearDate"><svg class="b3-menu__icon"><use xlink:href="#iconTrashcan"></use></svg><span class="b3-menu__label">${lang.clear}</span></button>+</div></div>`;+};++export const bindLunarDateEditor = (options: {+ value: IAVCellDateValue;+ menuElement: HTMLElement;+ update: (value: IAVCellDateValue) => void;+ close: () => void;+ requireExplicitChange?: boolean;+}) => {+ const original = options.value;+ const endpoints = Array.from(options.menuElement.querySelectorAll<HTMLElement>("[data-lunar-endpoint]"));+ const hasEnd = options.menuElement.querySelector<HTMLInputElement>("[data-lunar-end]");+ const includeTime = options.menuElement.querySelector<HTMLInputElement>("[data-lunar-include-time]");+ const edited = [false, false];+ let dirty = false;+ const read = (element: HTMLElement) => {+ const parts = element.querySelectorAll<HTMLSelectElement>("select");+ const time = element.querySelector<HTMLInputElement>("[data-lunar-time]").value.split(":");+ return lunarToSolar({year: Number(parts[0].value), month: Number(parts[1].value), day: Number(parts[2].value)},+ includeTime.checked ? Number(time[0]) : 0, includeTime.checked ? Number(time[1]) : 0);+ };+ const refresh = (element: HTMLElement) => {+ const content = read(element);+ element.querySelector("[data-lunar-error]").classList.toggle("fn__none", content !== undefined);+ element.querySelector("[data-lunar-preview]").textContent = content === undefined ? "" :+ window.siyuan.languages._attrView.solarCalendar + " " + formatDateDisplay(content, "full", !includeTime.checked);+ return content;+ };+ endpoints.forEach((element, index) => {+ element.addEventListener("change", event => {+ dirty = true;+ edited[index] = true;+ const target = event.target as HTMLElement;+ const parts = element.querySelectorAll<HTMLSelectElement>("select");+ if (target.dataset.lunarPart === "year") {+ const oldMonth = Number(parts[1].value);+ parts[1].innerHTML = `<option value="">${escapeHtml(window.siyuan.languages.month)}</option>` ++ getLunarMonths(Number(parts[0].value)).map(month => option(month[1], getLunarMonthLabel(month[1]), oldMonth)).join("");+ }+ if (target.dataset.lunarPart === "year" || target.dataset.lunarPart === "month") {+ const oldDay = Number(parts[2].value);+ const month = getLunarMonths(Number(parts[0].value)).find(month => month[1] === Number(parts[1].value));+ parts[2].innerHTML = `<option value="">${escapeHtml(window.siyuan.languages.day)}</option>` ++ (month ? Array.from({length: month[3]}, (_, day) => option(day + 1, getLunarDayLabel(day + 1), oldDay)).join("") : "");+ }+ refresh(element);+ });+ });+ hasEnd.addEventListener("change", () => {+ dirty = true;+ endpoints[1].classList.toggle("fn__none", !hasEnd.checked);+ });+ includeTime.addEventListener("change", () => {+ dirty = true;+ endpoints.forEach(element => {+ element.querySelector("[data-lunar-time]").classList.toggle("fn__none", !includeTime.checked);+ refresh(element);+ });+ });+ let submitted = false;+ const submit = () => {+ if (submitted || !shouldSubmitDateEdit(dirty, options.requireExplicitChange === true)) {+ return true;+ }+ // 未修改的端点保留原始时间戳,包括秒和毫秒以及对照表范围外的旧日期。+ const content = !edited[0] && original.isNotEmpty ? original.content : refresh(endpoints[0]);+ const content2 = !edited[1] && original.isNotEmpty2 ? original.content2 :+ hasEnd.checked || edited[1] ? refresh(endpoints[1]) : undefined;+ if (content === undefined || hasEnd.checked && content2 === undefined) {+ showMessage(window.siyuan.languages._attrView.lunarInvalid);+ return false;+ }+ if (!dirty && original.isNotEmpty) {+ return true;+ }+ submitted = true;+ options.update({+ content, isNotEmpty: true, content2: content2 || 0, isNotEmpty2: content2 !== undefined,+ hasEndDate: hasEnd.checked, isNotTime: !includeTime.checked,+ });+ return true;+ };+ options.menuElement.querySelectorAll("input, select").forEach(control => control.addEventListener("keydown", (event: KeyboardEvent) => {+ if (event.key !== "Escape") {+ event.stopPropagation();+ }+ if (event.key === "Enter" && !event.isComposing && !(control instanceof HTMLSelectElement)) {+ dirty = true;+ if (submit()) {+ options.close();+ }+ }+ }));+ options.menuElement.querySelector('[data-type="clearDate"]').addEventListener("click", event => {+ event.preventDefault();+ event.stopPropagation();+ submitted = true;+ options.update({content: 0, content2: 0, isNotEmpty: false, isNotEmpty2: false, hasEndDate: false, isNotTime: original.isNotTime});+ options.close();+ });+ return () => { submit(); };+};++export const bindLunarDateEvent = (options: {+ protyle: IProtyle;+ data: IAV;+ menuElement: HTMLElement;+ blockElement: Element;+ cellElements: HTMLElement[];+ requireExplicitChange?: boolean;+}) => bindLunarDateEditor({+ value: genCellValueByElement("date", options.cellElements[0]).date,+ menuElement: options.menuElement,+ update: value => updateCellsValue(options.protyle, options.blockElement as HTMLElement, value,+ options.cellElements, getFieldsByData(options.data)),+ close: () => document.querySelector(".av__panel")?.dispatchEvent(new CustomEvent("click", {detail: "close"})),+ requireExplicitChange: options.requireExplicitChange,+});diff --git a/app/src/protyle/render/av/newItemTemplate.ts b/app/src/protyle/render/av/newItemTemplate.tsindex b830c71215..8c506914ec 100644--- a/app/src/protyle/render/av/newItemTemplate.ts+++ b/app/src/protyle/render/av/newItemTemplate.ts@@ -1,5 +1,5 @@import {isAVNewItemTemplateType, isAVSelectType} from "./capabilities";-import {genFieldValue, getValueInputHTML, openFieldSelectMenu, getRelationOptions, renderRelationFieldValue, openFieldRelationMenu} from "./fieldValueEditor";+import {bindFieldLunarDates, genFieldValue, getValueInputHTML, openFieldSelectMenu, getRelationOptions, renderRelationFieldValue, openFieldRelationMenu} from "./fieldValueEditor";import {getCalendarCreationDate} from "./calendar/state";import {Constants} from "../../../constants";import {Dialog} from "../../../dialog";@@ -435,7 +435,8 @@ export const openNewItemTemplateDialog = (options: {}});});- hostElement.querySelectorAll<HTMLElement>('[data-role="field-value"][data-value-type]').forEach(item => item.addEventListener("click", (event) => {+ bindFieldLunarDates(hostElement);+ hostElement.querySelectorAll<HTMLElement>('[data-role="field-value"][data-value-type]:not([data-value-type="lunarDate"])').forEach(item => item.addEventListener("click", (event) => {event.preventDefault();event.stopPropagation();if (item.dataset.valueType === "checkbox") {diff --git a/app/src/protyle/render/av/panels/date.ts b/app/src/protyle/render/av/panels/date.tsindex 2154aa5589..8ca033f86d 100644--- a/app/src/protyle/render/av/panels/date.ts+++ b/app/src/protyle/render/av/panels/date.ts@@ -5,7 +5,8 @@ import { updateCellsValue } from "../cell";import type { IAVPanelDescriptor } from "./types";export const datePanel: IAVPanelDescriptor = {render: context => {- context.html = getDateHTML(context.options.cellElements);+ const colId = getColId(context.options.cellElements[0], context.data.viewType);+ context.html = getDateHTML(context.options.cellElements, context.fields.find(field => field.id === colId)?.dateFormat || "");return true;},bind: context => {@@ -16,6 +17,7 @@ export const datePanel: IAVPanelDescriptor = {cellElements: context.options.cellElements,blockElement: context.options.blockElement,requireExplicitChange: context.options.requireExplicitChange,+ format: context.fields.find(field => field.id === getColId(context.options.cellElements[0], context.data.viewType))?.dateFormat || "",});},actions: {diff --git a/app/src/types/api/index.d.ts b/app/src/types/api/index.d.tsindex fb414501c9..be07905871 100644--- a/app/src/types/api/index.d.ts+++ b/app/src/types/api/index.d.ts@@ -322,7 +322,7 @@ export type AVGallery = { "cardAspectRatio": number; "cardAspectRatioValue": numexport type AVGalleryCard = { "conditionalColors"?: AVItemConditionalColors; "coverContent": string; "coverPosition"?: AVCardCoverPosition; "coverURL": string; "id": string; "values": Array<AVGalleryFieldValue | null> | null; };-export type AVGalleryField = { "calc": AVFieldCalc | null; "created"?: AVCreated; "date"?: AVDate; "dateFormat"?: "" | "full" | "month-day-year" | "day-month-year" | "year-month-day"; "desc": string; "fullRow": boolean; "hidden": boolean; "icon": string; "id": string; "name": string; "numberFormat": string; "options"?: Array<AVSelectOption | null>; "relation"?: AVRelation; "renderTemplate"?: string; "rollup"?: AVRollup; "template": string; "type": "block" | "text" | "number" | "date" | "select" | "mSelect" | "url" | "email" | "phone" | "mAsset" | "template" | "created" | "updated" | "checkbox" | "relation" | "rollup" | "lineNumber"; "updated"?: AVUpdated; "wrap": boolean; } | ({ "fullRow": boolean; } & { "calc"?: never; "created"?: never; "date"?: never; "dateFormat"?: never; "desc"?: never; "hidden"?: never; "icon"?: never; "id"?: never; "name"?: never; "numberFormat"?: never; "options"?: never; "relation"?: never; "renderTemplate"?: never; "rollup"?: never; "template"?: never; "type"?: never; "updated"?: never; "wrap"?: never; });+export type AVGalleryField = { "calc": AVFieldCalc | null; "created"?: AVCreated; "date"?: AVDate; "dateFormat"?: "" | "full" | "month-day-year" | "day-month-year" | "year-month-day" | "lunar"; "desc": string; "fullRow": boolean; "hidden": boolean; "icon": string; "id": string; "name": string; "numberFormat": string; "options"?: Array<AVSelectOption | null>; "relation"?: AVRelation; "renderTemplate"?: string; "rollup"?: AVRollup; "template": string; "type": "block" | "text" | "number" | "date" | "select" | "mSelect" | "url" | "email" | "phone" | "mAsset" | "template" | "created" | "updated" | "checkbox" | "relation" | "rollup" | "lineNumber"; "updated"?: AVUpdated; "wrap": boolean; } | ({ "fullRow": boolean; } & { "calc"?: never; "created"?: never; "date"?: never; "dateFormat"?: never; "desc"?: never; "hidden"?: never; "icon"?: never; "id"?: never; "name"?: never; "numberFormat"?: never; "options"?: never; "relation"?: never; "renderTemplate"?: never; "rollup"?: never; "template"?: never; "type"?: never; "updated"?: never; "wrap"?: never; });export type AVGalleryFieldValue = { "id": string; "value": AVValue | null; "valueType": "block" | "text" | "number" | "date" | "select" | "mSelect" | "url" | "email" | "phone" | "mAsset" | "template" | "created" | "updated" | "checkbox" | "relation" | "rollup" | "lineNumber"; } | (Record<string, never> & { "id"?: never; "value"?: never; "valueType"?: never; });@@ -342,11 +342,11 @@ export type AVKanban = { "cardAspectRatio": number; "cardAspectRatioValue": numbexport type AVKanbanCard = { "conditionalColors"?: AVItemConditionalColors; "coverContent": string; "coverPosition"?: AVCardCoverPosition; "coverURL": string; "id": string; "values": Array<AVKanbanFieldValue | null> | null; };-export type AVKanbanField = { "calc": AVFieldCalc | null; "created"?: AVCreated; "date"?: AVDate; "dateFormat"?: "" | "full" | "month-day-year" | "day-month-year" | "year-month-day"; "desc": string; "fullRow": boolean; "hidden": boolean; "icon": string; "id": string; "name": string; "numberFormat": string; "options"?: Array<AVSelectOption | null>; "relation"?: AVRelation; "renderTemplate"?: string; "rollup"?: AVRollup; "template": string; "type": "block" | "text" | "number" | "date" | "select" | "mSelect" | "url" | "email" | "phone" | "mAsset" | "template" | "created" | "updated" | "checkbox" | "relation" | "rollup" | "lineNumber"; "updated"?: AVUpdated; "wrap": boolean; } | ({ "fullRow": boolean; } & { "calc"?: never; "created"?: never; "date"?: never; "dateFormat"?: never; "desc"?: never; "hidden"?: never; "icon"?: never; "id"?: never; "name"?: never; "numberFormat"?: never; "options"?: never; "relation"?: never; "renderTemplate"?: never; "rollup"?: never; "template"?: never; "type"?: never; "updated"?: never; "wrap"?: never; });+export type AVKanbanField = { "calc": AVFieldCalc | null; "created"?: AVCreated; "date"?: AVDate; "dateFormat"?: "" | "full" | "month-day-year" | "day-month-year" | "year-month-day" | "lunar"; "desc": string; "fullRow": boolean; "hidden": boolean; "icon": string; "id": string; "name": string; "numberFormat": string; "options"?: Array<AVSelectOption | null>; "relation"?: AVRelation; "renderTemplate"?: string; "rollup"?: AVRollup; "template": string; "type": "block" | "text" | "number" | "date" | "select" | "mSelect" | "url" | "email" | "phone" | "mAsset" | "template" | "created" | "updated" | "checkbox" | "relation" | "rollup" | "lineNumber"; "updated"?: AVUpdated; "wrap": boolean; } | ({ "fullRow": boolean; } & { "calc"?: never; "created"?: never; "date"?: never; "dateFormat"?: never; "desc"?: never; "hidden"?: never; "icon"?: never; "id"?: never; "name"?: never; "numberFormat"?: never; "options"?: never; "relation"?: never; "renderTemplate"?: never; "rollup"?: never; "template"?: never; "type"?: never; "updated"?: never; "wrap"?: never; });export type AVKanbanFieldValue = { "id": string; "value": AVValue | null; "valueType": "block" | "text" | "number" | "date" | "select" | "mSelect" | "url" | "email" | "phone" | "mAsset" | "template" | "created" | "updated" | "checkbox" | "relation" | "rollup" | "lineNumber"; } | (Record<string, never> & { "id"?: never; "value"?: never; "valueType"?: never; });-export type AVKey = { "attributePanelVisibility"?: "" | "always" | "hide-empty" | "hide"; "created"?: AVCreated; "date"?: AVDate; "dateFormat"?: "" | "full" | "month-day-year" | "day-month-year" | "year-month-day"; "desc": string; "icon": string; "id": string; "name": string; "numberFormat": string; "options"?: Array<AVSelectOption | null>; "relation"?: AVRelation; "renderTemplate"?: string; "rollup"?: AVRollup; "template": string; "type": "block" | "text" | "number" | "date" | "select" | "mSelect" | "url" | "email" | "phone" | "mAsset" | "template" | "created" | "updated" | "checkbox" | "relation" | "rollup" | "lineNumber"; "updated"?: AVUpdated; };+export type AVKey = { "attributePanelVisibility"?: "" | "always" | "hide-empty" | "hide"; "created"?: AVCreated; "date"?: AVDate; "dateFormat"?: "" | "full" | "month-day-year" | "day-month-year" | "year-month-day" | "lunar"; "desc": string; "icon": string; "id": string; "name": string; "numberFormat": string; "options"?: Array<AVSelectOption | null>; "relation"?: AVRelation; "renderTemplate"?: string; "rollup"?: AVRollup; "template": string; "type": "block" | "text" | "number" | "date" | "select" | "mSelect" | "url" | "email" | "phone" | "mAsset" | "template" | "created" | "updated" | "checkbox" | "relation" | "rollup" | "lineNumber"; "updated"?: AVUpdated; };export type AVKeyValues = { "key": AVKey | null; "values"?: Array<AVValue | null>; };@@ -426,7 +426,7 @@ export type AVTable = { "calendar"?: AVCalendarSettings; "calendarRange"?: AVCalexport type AVTableCell = { "bgColor": string; "color": string; "id": string; "value": AVValue | null; "valueType": "block" | "text" | "number" | "date" | "select" | "mSelect" | "url" | "email" | "phone" | "mAsset" | "template" | "created" | "updated" | "checkbox" | "relation" | "rollup" | "lineNumber"; } | ({ "bgColor": string; "color": string; } & { "id"?: never; "value"?: never; "valueType"?: never; });-export type AVTableColumn = { "align": "" | "left" | "center" | "right"; "calc": AVFieldCalc | null; "created"?: AVCreated; "date"?: AVDate; "dateFormat"?: "" | "full" | "month-day-year" | "day-month-year" | "year-month-day"; "desc": string; "hidden": boolean; "icon": string; "id": string; "name": string; "numberFormat": string; "options"?: Array<AVSelectOption | null>; "pin": boolean; "relation"?: AVRelation; "renderTemplate"?: string; "rollup"?: AVRollup; "template": string; "type": "block" | "text" | "number" | "date" | "select" | "mSelect" | "url" | "email" | "phone" | "mAsset" | "template" | "created" | "updated" | "checkbox" | "relation" | "rollup" | "lineNumber"; "updated"?: AVUpdated; "width": string; "wrap": boolean; } | ({ "align": "" | "left" | "center" | "right"; "pin": boolean; "width": string; } & { "calc"?: never; "created"?: never; "date"?: never; "dateFormat"?: never; "desc"?: never; "hidden"?: never; "icon"?: never; "id"?: never; "name"?: never; "numberFormat"?: never; "options"?: never; "relation"?: never; "renderTemplate"?: never; "rollup"?: never; "template"?: never; "type"?: never; "updated"?: never; "wrap"?: never; });+export type AVTableColumn = { "align": "" | "left" | "center" | "right"; "calc": AVFieldCalc | null; "created"?: AVCreated; "date"?: AVDate; "dateFormat"?: "" | "full" | "month-day-year" | "day-month-year" | "year-month-day" | "lunar"; "desc": string; "hidden": boolean; "icon": string; "id": string; "name": string; "numberFormat": string; "options"?: Array<AVSelectOption | null>; "pin": boolean; "relation"?: AVRelation; "renderTemplate"?: string; "rollup"?: AVRollup; "template": string; "type": "block" | "text" | "number" | "date" | "select" | "mSelect" | "url" | "email" | "phone" | "mAsset" | "template" | "created" | "updated" | "checkbox" | "relation" | "rollup" | "lineNumber"; "updated"?: AVUpdated; "width": string; "wrap": boolean; } | ({ "align": "" | "left" | "center" | "right"; "pin": boolean; "width": string; } & { "calc"?: never; "created"?: never; "date"?: never; "dateFormat"?: never; "desc"?: never; "hidden"?: never; "icon"?: never; "id"?: never; "name"?: never; "numberFormat"?: never; "options"?: never; "relation"?: never; "renderTemplate"?: never; "rollup"?: never; "template"?: never; "type"?: never; "updated"?: never; "wrap"?: never; });export type AVTableRow = { "cells": Array<AVTableCell | null> | null; "conditionalColors"?: AVItemConditionalColors; "id": string; };diff --git a/app/src/types/index.d.ts b/app/src/types/index.d.tsindex 7ea635d826..e8755b7132 100644--- a/app/src/types/index.d.ts+++ b/app/src/types/index.d.ts@@ -27,7 +27,7 @@ type TEventBus = "ws-main" | "sync-start" | "sync-end" | "sync-fail" |"common-menu-open" | "common-menu-closed"type TAVView = "table" | "list" | "gallery" | "kanban" | "calendar";type TAVAlign = "" | "left" | "center" | "right"-type TAVDateFormat = "" | "full" | "month-day-year" | "day-month-year" | "year-month-day"+type TAVDateFormat = "" | "full" | "month-day-year" | "day-month-year" | "year-month-day" | "lunar"type TAVCol = import("./av").AVKeyType;type TAVFilterOperator = import("./av").AVFilterOperator;diff --git a/app/tsconfig.json b/app/tsconfig.jsonindex e0d71ed99c..77bcfc75b4 100644--- a/app/tsconfig.json+++ b/app/tsconfig.json@@ -3,6 +3,7 @@"outDir": "./src/types/dist","noImplicitAny": true,"module": "commonjs",+ "resolveJsonModule": true,"target": "es6","lib": ["ES2021", "DOM", "DOM.Iterable"],"typeRoots": [diff --git a/kernel/api/contract_av_lunar_test.go b/kernel/api/contract_av_lunar_test.gonew file mode 100644index 0000000000..4d70e097cd--- /dev/null+++ b/kernel/api/contract_av_lunar_test.go@@ -0,0 +1,37 @@+package api++import (+ "bytes"+ "net/http"+ "testing"++ "github.com/siyuan-note/siyuan/kernel/apicontract"+ "github.com/siyuan-note/siyuan/kernel/av"+)++func TestAVContractLunarField(t *testing.T) {+ fixture := setupAttributeViewContextFilterAPITest(t)+ key := av.NewKey("20261009120000-lunara1", "Birthday", "", av.KeyTypeDate)+ key.DateFormat = av.DateDisplayFormatLunar+ fixture.attrView.KeyValues = append(fixture.attrView.KeyValues, &av.KeyValues{Key: key, Values: []*av.Value{}})+ fixture.attrView.Views[0].Table.Columns = append(fixture.attrView.Views[0].Table.Columns,+ &av.ViewTableColumn{BaseField: &av.BaseField{ID: key.ID}})+ if err := av.SaveAttributeView(fixture.attrView); err != nil {+ t.Fatal(err)+ }+ path := "/api/av/renderAttributeView"+ response := callAttributeViewContextFilterAPI(t, path, map[string]any{+ "id": fixture.attrView.ID, "blockID": fixture.databaseID, "ignoreRows": true,+ }, renderAttributeView)+ if !bytes.Contains(response.Body.Bytes(), []byte(`"dateFormat":"lunar"`)) {+ t.Fatalf("lunar field missing from response: %s", response.Body.String())+ }+ bundle, err := apicontract.BuildBundle()+ if err != nil {+ t.Fatal(err)+ }+ if err = bundle.ValidateHTTPResponse(http.MethodPost, path, response.Code,+ response.Header().Get("Content-Type"), response.Body.Bytes()); err != nil {+ t.Fatalf("lunar response violates contract: %v", err)+ }+}diff --git a/kernel/apicontract/av_calendar.go b/kernel/apicontract/av_calendar.goindex 8c5ed45e05..4f80bdb620 100644--- a/kernel/apicontract/av_calendar.go+++ b/kernel/apicontract/av_calendar.go@@ -7,6 +7,7 @@ type AVCalendarSettings struct {// 绑定一个 date、created 或 updated 字段;后两者不支持通过日历拖动修改。// date 字段有显示模板时,以模板输出的纯文本日期排布,保留原始 date 值,不允许通过日历改期。// 支持 YYYY-MM-DD、字段 dateFormat 指定的数字日期格式,以及当前语言的本地日期格式。+ // dateFormat 为 lunar 时也接受当前语言的农历显示文本,闰月和日期必须落在离线对照表覆盖范围内。// 可附加 HH:mm[:ss],以空格或 T 分隔;首尾空白忽略,斜杠日期按字段格式解释,不猜测日月顺序。// 按 CalendarRange 的时区解释,省略区间时使用内核本地时区;空值、无效日期和其他格式不显示,也不进入待安排列表。// 空字符串表示未绑定;字段缺失或类型变化时保留绑定,日历返回空行,不自动改绑或回填日期。diff --git a/kernel/apicontract/av_types.go b/kernel/apicontract/av_types.goindex d8ac5cf86e..1fe2665d8a 100644--- a/kernel/apicontract/av_types.go+++ b/kernel/apicontract/av_types.go@@ -220,14 +220,16 @@ type AVKey struct {Desc string `json:"desc" api:"optional,nullable"`Options []*AVSelectOption `json:"options,omitempty" api:"optional,nullable"`NumberFormat string `json:"numberFormat" api:"optional,nullable"`- DateFormat string `json:"dateFormat,omitempty" api:"optional,nullable,enum=|full|month-day-year|day-month-year|year-month-day"`- Template string `json:"template" api:"optional,nullable"`- RenderTemplate string `json:"renderTemplate,omitempty" api:"optional,nullable"`- Relation *AVRelation `json:"relation,omitempty" api:"optional,nullable"`- Rollup *AVRollup `json:"rollup,omitempty" api:"optional,nullable"`- Date *AVDate `json:"date,omitempty" api:"optional,nullable"`- Created *AVCreated `json:"created,omitempty" api:"optional,nullable"`- Updated *AVUpdated `json:"updated,omitempty" api:"optional,nullable"`+ // lunar 为日期字段的整列农历录入与显示设置,时间戳保持不变,旧格式及空值仍使用公历。+ // 离线对照表覆盖公历 1901-02-19 至 2100-12-31,范围外的旧值保留并显示范围提示。+ DateFormat string `json:"dateFormat,omitempty" api:"optional,nullable,enum=|full|month-day-year|day-month-year|year-month-day|lunar"`+ Template string `json:"template" api:"optional,nullable"`+ RenderTemplate string `json:"renderTemplate,omitempty" api:"optional,nullable"`+ Relation *AVRelation `json:"relation,omitempty" api:"optional,nullable"`+ Rollup *AVRollup `json:"rollup,omitempty" api:"optional,nullable"`+ Date *AVDate `json:"date,omitempty" api:"optional,nullable"`+ Created *AVCreated `json:"created,omitempty" api:"optional,nullable"`+ Updated *AVUpdated `json:"updated,omitempty" api:"optional,nullable"`}type AVSelectOption struct {@@ -288,24 +290,25 @@ type AVTableColumn struct {}type AVBaseInstanceField struct {- ID string `json:"id" api:"optional,nullable"`- Name string `json:"name" api:"optional,nullable"`- Type string `json:"type" api:"optional,nullable,enum=block|text|number|date|select|mSelect|url|email|phone|mAsset|template|created|updated|checkbox|relation|rollup|lineNumber"`- Icon string `json:"icon" api:"optional,nullable"`- Wrap bool `json:"wrap" api:"optional,nullable"`- Hidden bool `json:"hidden" api:"optional,nullable"`- Desc string `json:"desc" api:"optional,nullable"`- Calc *AVFieldCalc `json:"calc" api:"optional,nullable"`- Options []*AVSelectOption `json:"options,omitempty" api:"optional,nullable"`- NumberFormat string `json:"numberFormat" api:"optional,nullable"`- DateFormat string `json:"dateFormat,omitempty" api:"optional,nullable,enum=|full|month-day-year|day-month-year|year-month-day"`- Template string `json:"template" api:"optional,nullable"`- RenderTemplate string `json:"renderTemplate,omitempty" api:"optional,nullable"`- Relation *AVRelation `json:"relation,omitempty" api:"optional,nullable"`- Rollup *AVRollup `json:"rollup,omitempty" api:"optional,nullable"`- Date *AVDate `json:"date,omitempty" api:"optional,nullable"`- Created *AVCreated `json:"created,omitempty" api:"optional,nullable"`- Updated *AVUpdated `json:"updated,omitempty" api:"optional,nullable"`+ ID string `json:"id" api:"optional,nullable"`+ Name string `json:"name" api:"optional,nullable"`+ Type string `json:"type" api:"optional,nullable,enum=block|text|number|date|select|mSelect|url|email|phone|mAsset|template|created|updated|checkbox|relation|rollup|lineNumber"`+ Icon string `json:"icon" api:"optional,nullable"`+ Wrap bool `json:"wrap" api:"optional,nullable"`+ Hidden bool `json:"hidden" api:"optional,nullable"`+ Desc string `json:"desc" api:"optional,nullable"`+ Calc *AVFieldCalc `json:"calc" api:"optional,nullable"`+ Options []*AVSelectOption `json:"options,omitempty" api:"optional,nullable"`+ NumberFormat string `json:"numberFormat" api:"optional,nullable"`+ // lunar 按字段启用农历,单元格继续返回原始毫秒时间戳;范围与兼容语义见 AVKey.DateFormat。+ DateFormat string `json:"dateFormat,omitempty" api:"optional,nullable,enum=|full|month-day-year|day-month-year|year-month-day|lunar"`+ Template string `json:"template" api:"optional,nullable"`+ RenderTemplate string `json:"renderTemplate,omitempty" api:"optional,nullable"`+ Relation *AVRelation `json:"relation,omitempty" api:"optional,nullable"`+ Rollup *AVRollup `json:"rollup,omitempty" api:"optional,nullable"`+ Date *AVDate `json:"date,omitempty" api:"optional,nullable"`+ Created *AVCreated `json:"created,omitempty" api:"optional,nullable"`+ Updated *AVUpdated `json:"updated,omitempty" api:"optional,nullable"`}type AVTableRow struct {diff --git a/kernel/apicontract/schema.json b/kernel/apicontract/schema.jsonindex ec5f6082f5..76f27ee7e5 100644--- a/kernel/apicontract/schema.json+++ b/kernel/apicontract/schema.json@@ -8126,7 +8126,8 @@"full","month-day-year","day-month-year",- "year-month-day"+ "year-month-day",+ "lunar"]},"desc": {@@ -8828,7 +8829,8 @@"full","month-day-year","day-month-year",- "year-month-day"+ "year-month-day",+ "lunar"]},"desc": {@@ -9014,7 +9016,8 @@"full","month-day-year","day-month-year",- "year-month-day"+ "year-month-day",+ "lunar"]},"desc": {@@ -11662,7 +11665,8 @@"full","month-day-year","day-month-year",- "year-month-day"+ "year-month-day",+ "lunar"]},"desc": {diff --git a/kernel/av/layout_calendar.go b/kernel/av/layout_calendar.goindex 14b0abf65f..388a303536 100644--- a/kernel/av/layout_calendar.go+++ b/kernel/av/layout_calendar.go@@ -76,6 +76,10 @@ var calendarTemplateTimePattern = regexp.MustCompile(`[ T](\d{2}):(\d{2})(?::(\d// newCalendarTemplateDateParser 复用字段日期格式和当前语言的月份、日期模板,每次日历渲染只编译一次。func newCalendarTemplateDateParser(format DateDisplayFormat) func(string, *time.Location) *ValueDate {+ var lunarParser func(string, *time.Location) (time.Time, bool)+ if format == DateDisplayFormatLunar {+ lunarParser = newLunarDateParser()+ }layouts := []string{"2006-1-2"}switch format {case DateDisplayFormatMonthDayYear:@@ -108,8 +112,14 @@ func newCalendarTemplateDateParser(format DateDisplayFormat) func(string, *time.second, _ = strconv.Atoi(timeParts[3])content = strings.TrimSpace(content[:len(content)-len(timeParts[0])])}+ if lunarParser != nil {+ content = strings.TrimSuffix(content, " ("+GetAttributeViewI18n("lunarRange")+")")+ }var date time.Timefound := false+ if lunarParser != nil {+ date, found = lunarParser(content, location)+ }for _, layout := range layouts {if parsed, err := time.ParseInLocation(layout, content, location); err == nil {date = parseddiff --git a/kernel/av/lunar_calendar.go b/kernel/av/lunar_calendar.gonew file mode 100644index 0000000000..5af585e2ee--- /dev/null+++ b/kernel/av/lunar_calendar.go@@ -0,0 +1,111 @@+// SiYuan - From thought to insight, with agents+// Copyright (c) 2020-present, b3log.org+//+// This program is free software: you can redistribute it and/or modify+// it under the terms of the GNU Affero General Public License as published by+// the Free Software Foundation, either version 3 of the License, or+// (at your option) any later version.++package av++import (+ _ "embed"+ "encoding/json"+ "regexp"+ "sort"+ "strconv"+ "strings"+ "time"+)++// 前后端读取同一份离线对照表,避免设备历法库版本不同导致日期漂移。+//+//go:embed lunar_calendar_data.json+var lunarCalendarJSON []byte++var lunarCalendar = func() (data struct {+ FirstYear int `json:"firstYear"`+ LastYear int `json:"lastYear"`+ Months [][4]int `json:"months"`+}) {+ if err := json.Unmarshal(lunarCalendarJSON, &data); err != nil {+ panic(err)+ }+ return+}()++type lunarDate struct {+ year, month, day int+}++func solarToLunar(solar time.Time) (lunar lunarDate, ok bool) {+ day := int(time.Date(solar.Year(), solar.Month(), solar.Day(), 0, 0, 0, 0, time.UTC).Unix() / 86400)+ index := sort.Search(len(lunarCalendar.Months), func(i int) bool { return lunarCalendar.Months[i][2] > day }) - 1+ if index < 0 {+ return+ }+ month := lunarCalendar.Months[index]+ if day >= month[2]+month[3] {+ return+ }+ return lunarDate{month[0], month[1], day - month[2] + 1}, true+}++func lunarToSolar(lunar lunarDate, location *time.Location) (time.Time, bool) {+ for _, month := range lunarCalendar.Months {+ if month[0] == lunar.year && month[1] == lunar.month && lunar.day > 0 && lunar.day <= month[3] {+ civil := time.Unix(int64(month[2]+lunar.day-1)*86400, 0).UTC()+ return time.Date(civil.Year(), civil.Month(), civil.Day(), 0, 0, 0, 0, location), true+ }+ }+ return time.Time{}, false+}++func lunarMonthLabel(month int) string {+ index := month+ if index < 0 {+ index = -index+ }+ label := strings.Split(GetAttributeViewI18n("lunarMonths"), "|")[index-1]+ if month < 0 {+ label = strings.ReplaceAll(GetAttributeViewI18n("lunarLeapMonth"), "${month}", label)+ }+ return label+}++func formatLunarDate(lunar lunarDate) string {+ return strings.NewReplacer("${year}", strconv.Itoa(lunar.year), "${month}", lunarMonthLabel(lunar.month),+ "${day}", strings.Split(GetAttributeViewI18n("lunarDays"), "|")[lunar.day-1]).Replace(GetAttributeViewI18n("lunarDateTemplate"))+}++func newLunarDateParser() func(string, *time.Location) (time.Time, bool) {+ names := make([]string, 0, 24)+ monthValues := map[string]int{}+ for month := 1; month <= 12; month++ {+ for _, value := range []int{month, -month} {+ name := lunarMonthLabel(value)+ names = append(names, regexp.QuoteMeta(name))+ monthValues[name] = value+ }+ }+ days := strings.Split(GetAttributeViewI18n("lunarDays"), "|")+ dayNames := make([]string, len(days))+ dayValues := map[string]int{}+ for i, day := range days {+ dayNames[i] = regexp.QuoteMeta(day)+ dayValues[day] = i + 1+ }+ pattern := regexp.QuoteMeta(GetAttributeViewI18n("lunarDateTemplate"))+ pattern = strings.NewReplacer(regexp.QuoteMeta("${year}"), `(?P<year>\d{4})`,+ regexp.QuoteMeta("${month}"), "(?P<month>"+strings.Join(names, "|")+")",+ regexp.QuoteMeta("${day}"), "(?P<day>"+strings.Join(dayNames, "|")+")").Replace(pattern)+ parser := regexp.MustCompile("^" + pattern + "$")+ return func(content string, location *time.Location) (time.Time, bool) {+ parts := parser.FindStringSubmatch(content)+ if parts == nil {+ return time.Time{}, false+ }+ year, _ := strconv.Atoi(parts[parser.SubexpIndex("year")])+ return lunarToSolar(lunarDate{year, monthValues[parts[parser.SubexpIndex("month")]], dayValues[parts[parser.SubexpIndex("day")]]}, location)+ }+}diff --git a/kernel/av/lunar_calendar_data.json b/kernel/av/lunar_calendar_data.jsonnew file mode 100644index 0000000000..8fad525a97--- /dev/null+++ b/kernel/av/lunar_calendar_data.json@@ -0,0 +1,2480 @@+{+ "source": "https://www.hko.gov.hk/en/gts/time/calendar/text/files/T{}e.txt",+ "firstYear": 1901,+ "lastYear": 2100,+ "months": [+ [1901, 1, -25153, 29],+ [1901, 2, -25124, 30],+ [1901, 3, -25094, 29],+ [1901, 4, -25065, 29],+ [1901, 5, -25036, 30],+ [1901, 6, -25006, 29],+ [1901, 7, -24977, 30],+ [1901, 8, -24947, 29],+ [1901, 9, -24918, 30],+ [1901, 10, -24888, 30],+ [1901, 11, -24858, 30],+ [1901, 12, -24828, 29],+ [1902, 1, -24799, 30],+ [1902, 2, -24769, 29],+ [1902, 3, -24740, 30],+ [1902, 4, -24710, 29],+ [1902, 5, -24681, 29],+ [1902, 6, -24652, 30],+ [1902, 7, -24622, 29],+ [1902, 8, -24593, 30],+ [1902, 9, -24563, 29],+ [1902, 10, -24534, 30],+ [1902, 11, -24504, 30],+ [1902, 12, -24474, 30],+ [1903, 1, -24444, 29],+ [1903, 2, -24415, 30],+ [1903, 3, -24385, 29],+ [1903, 4, -24356, 30],+ [1903, 5, -24326, 29],+ [1903, -5, -24297, 29],+ [1903, 6, -24268, 30],+ [1903, 7, -24238, 29],+ [1903, 8, -24209, 29],+ [1903, 9, -24180, 30],+ [1903, 10, -24150, 30],+ [1903, 11, -24120, 29],+ [1903, 12, -24091, 30],+ [1904, 1, -24061, 30],+ [1904, 2, -24031, 30],+ [1904, 3, -24001, 29],+ [1904, 4, -23972, 30],+ [1904, 5, -23942, 29],+ [1904, 6, -23913, 29],+ [1904, 7, -23884, 30],+ [1904, 8, -23854, 29],+ [1904, 9, -23825, 29],+ [1904, 10, -23796, 30],+ [1904, 11, -23766, 30],+ [1904, 12, -23736, 29],+ [1905, 1, -23707, 30],+ [1905, 2, -23677, 30],+ [1905, 3, -23647, 29],+ [1905, 4, -23618, 30],+ [1905, 5, -23588, 30],+ [1905, 6, -23558, 29],+ [1905, 7, -23529, 29],+ [1905, 8, -23500, 30],+ [1905, 9, -23470, 29],+ [1905, 10, -23441, 30],+ [1905, 11, -23411, 29],+ [1905, 12, -23382, 30],+ [1906, 1, -23352, 29],+ [1906, 2, -23323, 30],+ [1906, 3, -23293, 30],+ [1906, 4, -23263, 29],+ [1906, -4, -23234, 30],+ [1906, 5, -23204, 29],+ [1906, 6, -23175, 30],+ [1906, 7, -23145, 29],+ [1906, 8, -23116, 30],+ [1906, 9, -23086, 29],+ [1906, 10, -23057, 30],+ [1906, 11, -23027, 29],+ [1906, 12, -22998, 30],+ [1907, 1, -22968, 29],+ [1907, 2, -22939, 30],+ [1907, 3, -22909, 29],+ [1907, 4, -22880, 30],+ [1907, 5, -22850, 29],+ [1907, 6, -22821, 30],+ [1907, 7, -22791, 30],+ [1907, 8, -22761, 29],+ [1907, 9, -22732, 30],+ [1907, 10, -22702, 29],+ [1907, 11, -22673, 30],+ [1907, 12, -22643, 29],+ [1908, 1, -22614, 30],+ [1908, 2, -22584, 29],+ [1908, 3, -22555, 29],+ [1908, 4, -22526, 30],+ [1908, 5, -22496, 30],+ [1908, 6, -22466, 29],+ [1908, 7, -22437, 30],+ [1908, 8, -22407, 29],+ [1908, 9, -22378, 30],+ [1908, 10, -22348, 30],+ [1908, 11, -22318, 29],+ [1908, 12, -22289, 30],+ [1909, 1, -22259, 29],+ [1909, 2, -22230, 30],+ [1909, -2, -22200, 29],+ [1909, 3, -22171, 29],+ [1909, 4, -22142, 30],+ [1909, 5, -22112, 29],+ [1909, 6, -22083, 30],+ [1909, 7, -22053, 29],+ [1909, 8, -22024, 30],+ [1909, 9, -21994, 30],+ [1909, 10, -21964, 30],+ [1909, 11, -21934, 29],+ [1909, 12, -21905, 30],+ [1910, 1, -21875, 29],+ [1910, 2, -21846, 30],+ [1910, 3, -21816, 29],+ [1910, 4, -21787, 29],+ [1910, 5, -21758, 30],+ [1910, 6, -21728, 29],+ [1910, 7, -21699, 30],+ [1910, 8, -21669, 29],+ [1910, 9, -21640, 30],+ [1910, 10, -21610, 30],+ [1910, 11, -21580, 30],+ [1910, 12, -21550, 29],+ [1911, 1, -21521, 30],+ [1911, 2, -21491, 29],+ [1911, 3, -21462, 30],+ [1911, 4, -21432, 29],+ [1911, 5, -21403, 29],+ [1911, 6, -21374, 30],+ [1911, -6, -21344, 29],+ [1911, 7, -21315, 29],+ [1911, 8, -21286, 30],+ [1911, 9, -21256, 30],+ [1911, 10, -21226, 29],+ [1911, 11, -21197, 30],+ [1911, 12, -21167, 30],+ [1912, 1, -21137, 30],+ [1912, 2, -21107, 29],+ [1912, 3, -21078, 30],+ [1912, 4, -21048, 29],+ [1912, 5, -21019, 29],+ [1912, 6, -20990, 30],+ [1912, 7, -20960, 29],+ [1912, 8, -20931, 29],+ [1912, 9, -20902, 30],+ [1912, 10, -20872, 30],+ [1912, 11, -20842, 29],+ [1912, 12, -20813, 30],+ [1913, 1, -20783, 30],+ [1913, 2, -20753, 30],+ [1913, 3, -20723, 29],+ [1913, 4, -20694, 30],+ [1913, 5, -20664, 29],+ [1913, 6, -20635, 29],+ [1913, 7, -20606, 30],+ [1913, 8, -20576, 29],+ [1913, 9, -20547, 29],+ [1913, 10, -20518, 30],+ [1913, 11, -20488, 29],+ [1913, 12, -20459, 30],+ [1914, 1, -20429, 30],+ [1914, 2, -20399, 30],+ [1914, 3, -20369, 29],+ [1914, 4, -20340, 30],+ [1914, 5, -20310, 29],+ [1914, -5, -20281, 30],+ [1914, 6, -20251, 29],+ [1914, 7, -20222, 30],+ [1914, 8, -20192, 29],+ [1914, 9, -20163, 29],+ [1914, 10, -20134, 30],+ [1914, 11, -20104, 29],+ [1914, 12, -20075, 30],+ [1915, 1, -20045, 30],+ [1915, 2, -20015, 29],+ [1915, 3, -19986, 30],+ [1915, 4, -19956, 30],+ [1915, 5, -19926, 29],+ [1915, 6, -19897, 30],+ [1915, 7, -19867, 29],+ [1915, 8, -19838, 30],+ [1915, 9, -19808, 29],+ [1915, 10, -19779, 30],+ [1915, 11, -19749, 29],+ [1915, 12, -19720, 29],+ [1916, 1, -19691, 30],+ [1916, 2, -19661, 30],+ [1916, 3, -19631, 29],+ [1916, 4, -19602, 30],+ [1916, 5, -19572, 29],+ [1916, 6, -19543, 30],+ [1916, 7, -19513, 30],+ [1916, 8, -19483, 29],+ [1916, 9, -19454, 30],+ [1916, 10, -19424, 29],+ [1916, 11, -19395, 30],+ [1916, 12, -19365, 29],+ [1917, 1, -19336, 30],+ [1917, 2, -19306, 29],+ [1917, -2, -19277, 29],+ [1917, 3, -19248, 30],+ [1917, 4, -19218, 29],+ [1917, 5, -19189, 30],+ [1917, 6, -19159, 30],+ [1917, 7, -19129, 29],+ [1917, 8, -19100, 30],+ [1917, 9, -19070, 30],+ [1917, 10, -19040, 29],+ [1917, 11, -19011, 30],+ [1917, 12, -18981, 29],+ [1918, 1, -18952, 30],+ [1918, 2, -18922, 29],+ [1918, 3, -18893, 29],+ [1918, 4, -18864, 30],+ [1918, 5, -18834, 29],+ [1918, 6, -18805, 30],+ [1918, 7, -18775, 29],+ [1918, 8, -18746, 30],+ [1918, 9, -18716, 30],+ [1918, 10, -18686, 29],+ [1918, 11, -18657, 30],+ [1918, 12, -18627, 30],+ [1919, 1, -18597, 29],+ [1919, 2, -18568, 30],+ [1919, 3, -18538, 29],+ [1919, 4, -18509, 29],+ [1919, 5, -18480, 30],+ [1919, 6, -18450, 29],+ [1919, 7, -18421, 29],+ [1919, -7, -18392, 30],+ [1919, 8, -18362, 30],+ [1919, 9, -18332, 29],+ [1919, 10, -18303, 30],+ [1919, 11, -18273, 30],+ [1919, 12, -18243, 30],+ [1920, 1, -18213, 29],+ [1920, 2, -18184, 30],+ [1920, 3, -18154, 29],+ [1920, 4, -18125, 29],+ [1920, 5, -18096, 30],+ [1920, 6, -18066, 29],+ [1920, 7, -18037, 29],+ [1920, 8, -18008, 30],+ [1920, 9, -17978, 29],+ [1920, 10, -17949, 30],+ [1920, 11, -17919, 30],+ [1920, 12, -17889, 30],+ [1921, 1, -17859, 30],+ [1921, 2, -17829, 29],+ [1921, 3, -17800, 30],+ [1921, 4, -17770, 29],+ [1921, 5, -17741, 29],+ [1921, 6, -17712, 30],+ [1921, 7, -17682, 29],+ [1921, 8, -17653, 29],+ [1921, 9, -17624, 30],+ [1921, 10, -17594, 29],+ [1921, 11, -17565, 30],+ [1921, 12, -17535, 30],+ [1922, 1, -17505, 30],+ [1922, 2, -17475, 29],+ [1922, 3, -17446, 30],+ [1922, 4, -17416, 30],+ [1922, 5, -17386, 29],+ [1922, -5, -17357, 29],+ [1922, 6, -17328, 30],+ [1922, 7, -17298, 29],+ [1922, 8, -17269, 29],+ [1922, 9, -17240, 30],+ [1922, 10, -17210, 29],+ [1922, 11, -17181, 30],+ [1922, 12, -17151, 30],+ [1923, 1, -17121, 29],+ [1923, 2, -17092, 30],+ [1923, 3, -17062, 30],+ [1923, 4, -17032, 29],+ [1923, 5, -17003, 30],+ [1923, 6, -16973, 29],+ [1923, 7, -16944, 30],+ [1923, 8, -16914, 29],+ [1923, 9, -16885, 29],+ [1923, 10, -16856, 30],+ [1923, 11, -16826, 29],+ [1923, 12, -16797, 30],+ [1924, 1, -16767, 29],+ [1924, 2, -16738, 30],+ [1924, 3, -16708, 30],+ [1924, 4, -16678, 29],+ [1924, 5, -16649, 30],+ [1924, 6, -16619, 30],+ [1924, 7, -16589, 29],+ [1924, 8, -16560, 30],+ [1924, 9, -16530, 29],+ [1924, 10, -16501, 30],+ [1924, 11, -16471, 29],+ [1924, 12, -16442, 29],+ [1925, 1, -16413, 30],+ [1925, 2, -16383, 29],+ [1925, 3, -16354, 30],+ [1925, 4, -16324, 29],+ [1925, -4, -16295, 30],+ [1925, 5, -16265, 30],+ [1925, 6, -16235, 29],+ [1925, 7, -16206, 30],+ [1925, 8, -16176, 30],+ [1925, 9, -16146, 29],+ [1925, 10, -16117, 30],+ [1925, 11, -16087, 29],+ [1925, 12, -16058, 30],+ [1926, 1, -16028, 29],+ [1926, 2, -15999, 29],+ [1926, 3, -15970, 30],+ [1926, 4, -15940, 29],+ [1926, 5, -15911, 30],+ [1926, 6, -15881, 29],+ [1926, 7, -15852, 30],+ [1926, 8, -15822, 30],+ [1926, 9, -15792, 29],+ [1926, 10, -15763, 30],+ [1926, 11, -15733, 30],+ [1926, 12, -15703, 29],+ [1927, 1, -15674, 30],+ [1927, 2, -15644, 29],+ [1927, 3, -15615, 29],+ [1927, 4, -15586, 30],+ [1927, 5, -15556, 29],+ [1927, 6, -15527, 30],+ [1927, 7, -15497, 29],+ [1927, 8, -15468, 30],+ [1927, 9, -15438, 29],+ [1927, 10, -15409, 30],+ [1927, 11, -15379, 30],+ [1927, 12, -15349, 30],+ [1928, 1, -15319, 29],+ [1928, 2, -15290, 30],+ [1928, -2, -15260, 29],+ [1928, 3, -15231, 29],+ [1928, 4, -15202, 30],+ [1928, 5, -15172, 29],+ [1928, 6, -15143, 29],+ [1928, 7, -15114, 30],+ [1928, 8, -15084, 29],+ [1928, 9, -15055, 30],+ [1928, 10, -15025, 30],+ [1928, 11, -14995, 30],+ [1928, 12, -14965, 30],+ [1929, 1, -14935, 29],+ [1929, 2, -14906, 30],+ [1929, 3, -14876, 29],+ [1929, 4, -14847, 29],+ [1929, 5, -14818, 30],+ [1929, 6, -14788, 29],+ [1929, 7, -14759, 29],+ [1929, 8, -14730, 30],+ [1929, 9, -14700, 29],+ [1929, 10, -14671, 30],+ [1929, 11, -14641, 30],+ [1929, 12, -14611, 30],+ [1930, 1, -14581, 29],+ [1930, 2, -14552, 30],+ [1930, 3, -14522, 30],+ [1930, 4, -14492, 29],+ [1930, 5, -14463, 29],+ [1930, 6, -14434, 30],+ [1930, -6, -14404, 29],+ [1930, 7, -14375, 29],+ [1930, 8, -14346, 30],+ [1930, 9, -14316, 29],+ [1930, 10, -14287, 30],+ [1930, 11, -14257, 30],+ [1930, 12, -14227, 29],+ [1931, 1, -14198, 30],+ [1931, 2, -14168, 30],+ [1931, 3, -14138, 29],+ [1931, 4, -14109, 30],+ [1931, 5, -14079, 29],+ [1931, 6, -14050, 30],+ [1931, 7, -14020, 29],+ [1931, 8, -13991, 29],+ [1931, 9, -13962, 30],+ [1931, 10, -13932, 29],+ [1931, 11, -13903, 30],+ [1931, 12, -13873, 29],+ [1932, 1, -13844, 30],+ [1932, 2, -13814, 30],+ [1932, 3, -13784, 30],+ [1932, 4, -13754, 29],+ [1932, 5, -13725, 30],+ [1932, 6, -13695, 29],+ [1932, 7, -13666, 30],+ [1932, 8, -13636, 29],+ [1932, 9, -13607, 29],+ [1932, 10, -13578, 30],+ [1932, 11, -13548, 29],+ [1932, 12, -13519, 30],+ [1933, 1, -13489, 29],+ [1933, 2, -13460, 30],+ [1933, 3, -13430, 30],+ [1933, 4, -13400, 29],+ [1933, 5, -13371, 30],+ [1933, -5, -13341, 30],+ [1933, 6, -13311, 29],+ [1933, 7, -13282, 30],+ [1933, 8, -13252, 29],+ [1933, 9, -13223, 30],+ [1933, 10, -13193, 29],+ [1933, 11, -13164, 29],+ [1933, 12, -13135, 30],+ [1934, 1, -13105, 29],+ [1934, 2, -13076, 30],+ [1934, 3, -13046, 29],+ [1934, 4, -13017, 30],+ [1934, 5, -12987, 30],+ [1934, 6, -12957, 29],+ [1934, 7, -12928, 30],+ [1934, 8, -12898, 29],+ [1934, 9, -12869, 30],+ [1934, 10, -12839, 30],+ [1934, 11, -12809, 29],+ [1934, 12, -12780, 30],+ [1935, 1, -12750, 29],+ [1935, 2, -12721, 29],+ [1935, 3, -12692, 30],+ [1935, 4, -12662, 29],+ [1935, 5, -12633, 30],+ [1935, 6, -12603, 29],+ [1935, 7, -12574, 30],+ [1935, 8, -12544, 30],+ [1935, 9, -12514, 29],+ [1935, 10, -12485, 30],+ [1935, 11, -12455, 30],+ [1935, 12, -12425, 29],+ [1936, 1, -12396, 30],+ [1936, 2, -12366, 29],+ [1936, 3, -12337, 29],+ [1936, -3, -12308, 30],+ [1936, 4, -12278, 29],+ [1936, 5, -12249, 29],+ [1936, 6, -12220, 30],+ [1936, 7, -12190, 30],+ [1936, 8, -12160, 29],+ [1936, 9, -12131, 30],+ [1936, 10, -12101, 30],+ [1936, 11, -12071, 30],+ [1936, 12, -12041, 29],+ [1937, 1, -12012, 30],+ [1937, 2, -11982, 29],+ [1937, 3, -11953, 29],+ [1937, 4, -11924, 30],+ [1937, 5, -11894, 29],+ [1937, 6, -11865, 29],+ [1937, 7, -11836, 30],+ [1937, 8, -11806, 29],+ [1937, 9, -11777, 30],+ [1937, 10, -11747, 30],+ [1937, 11, -11717, 30],+ [1937, 12, -11687, 29],+ [1938, 1, -11658, 30],+ [1938, 2, -11628, 30],+ [1938, 3, -11598, 29],+ [1938, 4, -11569, 29],+ [1938, 5, -11540, 30],+ [1938, 6, -11510, 29],+ [1938, 7, -11481, 29],+ [1938, -7, -11452, 30],+ [1938, 8, -11422, 29],+ [1938, 9, -11393, 30],+ [1938, 10, -11363, 30],+ [1938, 11, -11333, 29],+ [1938, 12, -11304, 30],+ [1939, 1, -11274, 30],+ [1939, 2, -11244, 30],+ [1939, 3, -11214, 29],+ [1939, 4, -11185, 29],+ [1939, 5, -11156, 30],+ [1939, 6, -11126, 29],+ [1939, 7, -11097, 29],+ [1939, 8, -11068, 30],+ [1939, 9, -11038, 29],+ [1939, 10, -11009, 30],+ [1939, 11, -10979, 29],+ [1939, 12, -10950, 30],+ [1940, 1, -10920, 30],+ [1940, 2, -10890, 30],+ [1940, 3, -10860, 29],+ [1940, 4, -10831, 30],+ [1940, 5, -10801, 29],+ [1940, 6, -10772, 30],+ [1940, 7, -10742, 29],+ [1940, 8, -10713, 29],+ [1940, 9, -10684, 30],+ [1940, 10, -10654, 29],+ [1940, 11, -10625, 30],+ [1940, 12, -10595, 29],+ [1941, 1, -10566, 30],+ [1941, 2, -10536, 30],+ [1941, 3, -10506, 29],+ [1941, 4, -10477, 30],+ [1941, 5, -10447, 30],+ [1941, 6, -10417, 29],+ [1941, -6, -10388, 30],+ [1941, 7, -10358, 29],+ [1941, 8, -10329, 29],+ [1941, 9, -10300, 30],+ [1941, 10, -10270, 29],+ [1941, 11, -10241, 30],+ [1941, 12, -10211, 29],+ [1942, 1, -10182, 30],+ [1942, 2, -10152, 29],+ [1942, 3, -10123, 30],+ [1942, 4, -10093, 30],+ [1942, 5, -10063, 29],+ [1942, 6, -10034, 30],+ [1942, 7, -10004, 29],+ [1942, 8, -9975, 30],+ [1942, 9, -9945, 29],+ [1942, 10, -9916, 30],+ [1942, 11, -9886, 29],+ [1942, 12, -9857, 30],+ [1943, 1, -9827, 29],+ [1943, 2, -9798, 30],+ [1943, 3, -9768, 29],+ [1943, 4, -9739, 30],+ [1943, 5, -9709, 29],+ [1943, 6, -9680, 30],+ [1943, 7, -9650, 30],+ [1943, 8, -9620, 29],+ [1943, 9, -9591, 30],+ [1943, 10, -9561, 29],+ [1943, 11, -9532, 30],+ [1943, 12, -9502, 29],+ [1944, 1, -9473, 30],+ [1944, 2, -9443, 29],+ [1944, 3, -9414, 30],+ [1944, 4, -9384, 29],+ [1944, -4, -9355, 30],+ [1944, 5, -9325, 29],+ [1944, 6, -9296, 30],+ [1944, 7, -9266, 29],+ [1944, 8, -9237, 30],+ [1944, 9, -9207, 30],+ [1944, 10, -9177, 29],+ [1944, 11, -9148, 30],+ [1944, 12, -9118, 30],+ [1945, 1, -9088, 29],+ [1945, 2, -9059, 29],+ [1945, 3, -9030, 30],+ [1945, 4, -9000, 29],+ [1945, 5, -8971, 29],+ [1945, 6, -8942, 30],+ [1945, 7, -8912, 29],+ [1945, 8, -8883, 30],+ [1945, 9, -8853, 30],+ [1945, 10, -8823, 30],+ [1945, 11, -8793, 29],+ [1945, 12, -8764, 30],+ [1946, 1, -8734, 30],+ [1946, 2, -8704, 29],+ [1946, 3, -8675, 29],+ [1946, 4, -8646, 30],+ [1946, 5, -8616, 29],+ [1946, 6, -8587, 29],+ [1946, 7, -8558, 30],+ [1946, 8, -8528, 29],+ [1946, 9, -8499, 30],+ [1946, 10, -8469, 30],+ [1946, 11, -8439, 29],+ [1946, 12, -8410, 30],+ [1947, 1, -8380, 30],+ [1947, 2, -8350, 30],+ [1947, -2, -8320, 29],+ [1947, 3, -8291, 29],+ [1947, 4, -8262, 30],+ [1947, 5, -8232, 29],+ [1947, 6, -8203, 29],+ [1947, 7, -8174, 30],+ [1947, 8, -8144, 29],+ [1947, 9, -8115, 30],+ [1947, 10, -8085, 29],+ [1947, 11, -8056, 30],+ [1947, 12, -8026, 30],+ [1948, 1, -7996, 30],+ [1948, 2, -7966, 29],+ [1948, 3, -7937, 30],+ [1948, 4, -7907, 29],+ [1948, 5, -7878, 30],+ [1948, 6, -7848, 29],+ [1948, 7, -7819, 29],+ [1948, 8, -7790, 30],+ [1948, 9, -7760, 29],+ [1948, 10, -7731, 30],+ [1948, 11, -7701, 29],+ [1948, 12, -7672, 30],+ [1949, 1, -7642, 30],+ [1949, 2, -7612, 29],+ [1949, 3, -7583, 30],+ [1949, 4, -7553, 30],+ [1949, 5, -7523, 29],+ [1949, 6, -7494, 30],+ [1949, 7, -7464, 29],+ [1949, -7, -7435, 29],+ [1949, 8, -7406, 30],+ [1949, 9, -7376, 29],+ [1949, 10, -7347, 30],+ [1949, 11, -7317, 29],+ [1949, 12, -7288, 30],+ [1950, 1, -7258, 29],+ [1950, 2, -7229, 30],+ [1950, 3, -7199, 30],+ [1950, 4, -7169, 29],+ [1950, 5, -7140, 30],+ [1950, 6, -7110, 30],+ [1950, 7, -7080, 29],+ [1950, 8, -7051, 29],+ [1950, 9, -7022, 30],+ [1950, 10, -6992, 29],+ [1950, 11, -6963, 30],+ [1950, 12, -6933, 29],+ [1951, 1, -6904, 30],+ [1951, 2, -6874, 29],+ [1951, 3, -6845, 30],+ [1951, 4, -6815, 30],+ [1951, 5, -6785, 29],+ [1951, 6, -6756, 30],+ [1951, 7, -6726, 29],+ [1951, 8, -6697, 30],+ [1951, 9, -6667, 29],+ [1951, 10, -6638, 30],+ [1951, 11, -6608, 29],+ [1951, 12, -6579, 30],+ [1952, 1, -6549, 29],+ [1952, 2, -6520, 30],+ [1952, 3, -6490, 29],+ [1952, 4, -6461, 30],+ [1952, 5, -6431, 29],+ [1952, -5, -6402, 30],+ [1952, 6, -6372, 29],+ [1952, 7, -6343, 30],+ [1952, 8, -6313, 30],+ [1952, 9, -6283, 29],+ [1952, 10, -6254, 30],+ [1952, 11, -6224, 29],+ [1952, 12, -6195, 30],+ [1953, 1, -6165, 29],+ [1953, 2, -6136, 30],+ [1953, 3, -6106, 29],+ [1953, 4, -6077, 29],+ [1953, 5, -6048, 30],+ [1953, 6, -6018, 30],+ [1953, 7, -5988, 29],+ [1953, 8, -5959, 30],+ [1953, 9, -5929, 30],+ [1953, 10, -5899, 29],+ [1953, 11, -5870, 30],+ [1953, 12, -5840, 29],+ [1954, 1, -5811, 30],+ [1954, 2, -5781, 29],+ [1954, 3, -5752, 30],+ [1954, 4, -5722, 29],+ [1954, 5, -5693, 29],+ [1954, 6, -5664, 30],+ [1954, 7, -5634, 29],+ [1954, 8, -5605, 30],+ [1954, 9, -5575, 30],+ [1954, 10, -5545, 29],+ [1954, 11, -5516, 30],+ [1954, 12, -5486, 30],+ [1955, 1, -5456, 29],+ [1955, 2, -5427, 30],+ [1955, 3, -5397, 29],+ [1955, -3, -5368, 30],+ [1955, 4, -5338, 29],+ [1955, 5, -5309, 29],+ [1955, 6, -5280, 30],+ [1955, 7, -5250, 29],+ [1955, 8, -5221, 30],+ [1955, 9, -5191, 29],+ [1955, 10, -5162, 30],+ [1955, 11, -5132, 30],+ [1955, 12, -5102, 30],+ [1956, 1, -5072, 29],+ [1956, 2, -5043, 30],+ [1956, 3, -5013, 29],+ [1956, 4, -4984, 30],+ [1956, 5, -4954, 29],+ [1956, 6, -4925, 29],+ [1956, 7, -4896, 30],+ [1956, 8, -4866, 29],+ [1956, 9, -4837, 30],+ [1956, 10, -4807, 29],+ [1956, 11, -4778, 30],+ [1956, 12, -4748, 30],+ [1957, 1, -4718, 30],+ [1957, 2, -4688, 29],+ [1957, 3, -4659, 30],+ [1957, 4, -4629, 29],+ [1957, 5, -4600, 30],+ [1957, 6, -4570, 29],+ [1957, 7, -4541, 29],+ [1957, 8, -4512, 30],+ [1957, -8, -4482, 29],+ [1957, 9, -4453, 30],+ [1957, 10, -4423, 29],+ [1957, 11, -4394, 30],+ [1957, 12, -4364, 29],+ [1958, 1, -4335, 30],+ [1958, 2, -4305, 30],+ [1958, 3, -4275, 30],+ [1958, 4, -4245, 29],+ [1958, 5, -4216, 30],+ [1958, 6, -4186, 29],+ [1958, 7, -4157, 29],+ [1958, 8, -4128, 30],+ [1958, 9, -4098, 29],+ [1958, 10, -4069, 30],+ [1958, 11, -4039, 29],+ [1958, 12, -4010, 30],+ [1959, 1, -3980, 29],+ [1959, 2, -3951, 30],+ [1959, 3, -3921, 30],+ [1959, 4, -3891, 29],+ [1959, 5, -3862, 30],+ [1959, 6, -3832, 29],+ [1959, 7, -3803, 30],+ [1959, 8, -3773, 29],+ [1959, 9, -3744, 30],+ [1959, 10, -3714, 29],+ [1959, 11, -3685, 30],+ [1959, 12, -3655, 29],+ [1960, 1, -3626, 30],+ [1960, 2, -3596, 29],+ [1960, 3, -3567, 30],+ [1960, 4, -3537, 29],+ [1960, 5, -3508, 30],+ [1960, 6, -3478, 30],+ [1960, -6, -3448, 29],+ [1960, 7, -3419, 30],+ [1960, 8, -3389, 29],+ [1960, 9, -3360, 30],+ [1960, 10, -3330, 29],+ [1960, 11, -3301, 30],+ [1960, 12, -3271, 29],+ [1961, 1, -3242, 30],+ [1961, 2, -3212, 29],+ [1961, 3, -3183, 30],+ [1961, 4, -3153, 29],+ [1961, 5, -3124, 30],+ [1961, 6, -3094, 29],+ [1961, 7, -3065, 30],+ [1961, 8, -3035, 30],+ [1961, 9, -3005, 29],+ [1961, 10, -2976, 30],+ [1961, 11, -2946, 29],+ [1961, 12, -2917, 30],+ [1962, 1, -2887, 29],+ [1962, 2, -2858, 30],+ [1962, 3, -2828, 29],+ [1962, 4, -2799, 29],+ [1962, 5, -2770, 30],+ [1962, 6, -2740, 29],+ [1962, 7, -2711, 30],+ [1962, 8, -2681, 30],+ [1962, 9, -2651, 29],+ [1962, 10, -2622, 30],+ [1962, 11, -2592, 30],+ [1962, 12, -2562, 29],+ [1963, 1, -2533, 30],+ [1963, 2, -2503, 29],+ [1963, 3, -2474, 30],+ [1963, 4, -2444, 29],+ [1963, -4, -2415, 29],+ [1963, 5, -2386, 30],+ [1963, 6, -2356, 29],+ [1963, 7, -2327, 30],+ [1963, 8, -2297, 29],+ [1963, 9, -2268, 30],+ [1963, 10, -2238, 30],+ [1963, 11, -2208, 30],+ [1963, 12, -2178, 29],+ [1964, 1, -2149, 30],+ [1964, 2, -2119, 29],+ [1964, 3, -2090, 30],+ [1964, 4, -2060, 29],+ [1964, 5, -2031, 29],+ [1964, 6, -2002, 30],+ [1964, 7, -1972, 29],+ [1964, 8, -1943, 30],+ [1964, 9, -1913, 29],+ [1964, 10, -1884, 30],+ [1964, 11, -1854, 30],+ [1964, 12, -1824, 30],+ [1965, 1, -1794, 29],+ [1965, 2, -1765, 30],+ [1965, 3, -1735, 29],+ [1965, 4, -1706, 30],+ [1965, 5, -1676, 29],+ [1965, 6, -1647, 29],+ [1965, 7, -1618, 30],+ [1965, 8, -1588, 29],+ [1965, 9, -1559, 29],+ [1965, 10, -1530, 30],+ [1965, 11, -1500, 30],+ [1965, 12, -1470, 29],+ [1966, 1, -1441, 30],+ [1966, 2, -1411, 30],+ [1966, 3, -1381, 30],+ [1966, -3, -1351, 29],+ [1966, 4, -1322, 30],+ [1966, 5, -1292, 29],+ [1966, 6, -1263, 29],+ [1966, 7, -1234, 30],+ [1966, 8, -1204, 29],+ [1966, 9, -1175, 29],+ [1966, 10, -1146, 30],+ [1966, 11, -1116, 30],+ [1966, 12, -1086, 29],+ [1967, 1, -1057, 30],+ [1967, 2, -1027, 30],+ [1967, 3, -997, 29],+ [1967, 4, -968, 30],+ [1967, 5, -938, 30],+ [1967, 6, -908, 29],+ [1967, 7, -879, 29],+ [1967, 8, -850, 30],+ [1967, 9, -820, 29],+ [1967, 10, -791, 30],+ [1967, 11, -761, 29],+ [1967, 12, -732, 30],+ [1968, 1, -702, 29],+ [1968, 2, -673, 30],+ [1968, 3, -643, 29],+ [1968, 4, -614, 30],+ [1968, 5, -584, 30],+ [1968, 6, -554, 29],+ [1968, 7, -525, 30],+ [1968, -7, -495, 29],+ [1968, 8, -466, 30],+ [1968, 9, -436, 29],+ [1968, 10, -407, 30],+ [1968, 11, -377, 29],+ [1968, 12, -348, 30],+ [1969, 1, -318, 29],+ [1969, 2, -289, 30],+ [1969, 3, -259, 29],+ [1969, 4, -230, 30],+ [1969, 5, -200, 29],+ [1969, 6, -171, 30],+ [1969, 7, -141, 30],+ [1969, 8, -111, 29],+ [1969, 9, -82, 30],+ [1969, 10, -52, 29],+ [1969, 11, -23, 30],+ [1969, 12, 7, 29],+ [1970, 1, 36, 30],+ [1970, 2, 66, 29],+ [1970, 3, 95, 29],+ [1970, 4, 124, 30],+ [1970, 5, 154, 29],+ [1970, 6, 183, 30],+ [1970, 7, 213, 30],+ [1970, 8, 243, 29],+ [1970, 9, 272, 30],+ [1970, 10, 302, 30],+ [1970, 11, 332, 29],+ [1970, 12, 361, 30],+ [1971, 1, 391, 29],+ [1971, 2, 420, 30],+ [1971, 3, 450, 29],+ [1971, 4, 479, 29],+ [1971, 5, 508, 30],+ [1971, -5, 538, 29],+ [1971, 6, 567, 30],+ [1971, 7, 597, 29],+ [1971, 8, 626, 30],+ [1971, 9, 656, 30],+ [1971, 10, 686, 30],+ [1971, 11, 716, 29],+ [1971, 12, 745, 30],+ [1972, 1, 775, 29],+ [1972, 2, 804, 30],+ [1972, 3, 834, 29],+ [1972, 4, 863, 29],+ [1972, 5, 892, 30],+ [1972, 6, 922, 29],+ [1972, 7, 951, 30],+ [1972, 8, 981, 29],+ [1972, 9, 1010, 30],+ [1972, 10, 1040, 30],+ [1972, 11, 1070, 29],+ [1972, 12, 1099, 30],+ [1973, 1, 1129, 30],+ [1973, 2, 1159, 29],+ [1973, 3, 1188, 30],+ [1973, 4, 1218, 29],+ [1973, 5, 1247, 29],+ [1973, 6, 1276, 30],+ [1973, 7, 1306, 29],+ [1973, 8, 1335, 29],+ [1973, 9, 1364, 30],+ [1973, 10, 1394, 30],+ [1973, 11, 1424, 29],+ [1973, 12, 1453, 30],+ [1974, 1, 1483, 30],+ [1974, 2, 1513, 30],+ [1974, 3, 1543, 29],+ [1974, 4, 1572, 30],+ [1974, -4, 1602, 29],+ [1974, 5, 1631, 29],+ [1974, 6, 1660, 30],+ [1974, 7, 1690, 29],+ [1974, 8, 1719, 29],+ [1974, 9, 1748, 30],+ [1974, 10, 1778, 30],+ [1974, 11, 1808, 29],+ [1974, 12, 1837, 30],+ [1975, 1, 1867, 30],+ [1975, 2, 1897, 30],+ [1975, 3, 1927, 29],+ [1975, 4, 1956, 30],+ [1975, 5, 1986, 29],+ [1975, 6, 2015, 29],+ [1975, 7, 2044, 30],+ [1975, 8, 2074, 29],+ [1975, 9, 2103, 29],+ [1975, 10, 2132, 30],+ [1975, 11, 2162, 29],+ [1975, 12, 2191, 30],+ [1976, 1, 2221, 30],+ [1976, 2, 2251, 30],+ [1976, 3, 2281, 29],+ [1976, 4, 2310, 30],+ [1976, 5, 2340, 29],+ [1976, 6, 2369, 30],+ [1976, 7, 2399, 29],+ [1976, 8, 2428, 30],+ [1976, -8, 2458, 29],+ [1976, 9, 2487, 29],+ [1976, 10, 2516, 30],+ [1976, 11, 2546, 29],+ [1976, 12, 2575, 30],+ [1977, 1, 2605, 30],+ [1977, 2, 2635, 29],+ [1977, 3, 2664, 30],+ [1977, 4, 2694, 30],+ [1977, 5, 2724, 29],+ [1977, 6, 2753, 30],+ [1977, 7, 2783, 29],+ [1977, 8, 2812, 30],+ [1977, 9, 2842, 29],+ [1977, 10, 2871, 30],+ [1977, 11, 2901, 29],+ [1977, 12, 2930, 29],+ [1978, 1, 2959, 30],+ [1978, 2, 2989, 29],+ [1978, 3, 3018, 30],+ [1978, 4, 3048, 30],+ [1978, 5, 3078, 29],+ [1978, 6, 3107, 30],+ [1978, 7, 3137, 30],+ [1978, 8, 3167, 29],+ [1978, 9, 3196, 30],+ [1978, 10, 3226, 29],+ [1978, 11, 3255, 30],+ [1978, 12, 3285, 29],+ [1979, 1, 3314, 30],+ [1979, 2, 3344, 29],+ [1979, 3, 3373, 29],+ [1979, 4, 3402, 30],+ [1979, 5, 3432, 29],+ [1979, 6, 3461, 30],+ [1979, -6, 3491, 30],+ [1979, 7, 3521, 29],+ [1979, 8, 3550, 30],+ [1979, 9, 3580, 30],+ [1979, 10, 3610, 29],+ [1979, 11, 3639, 30],+ [1979, 12, 3669, 29],+ [1980, 1, 3698, 30],+ [1980, 2, 3728, 29],+ [1980, 3, 3757, 29],+ [1980, 4, 3786, 30],+ [1980, 5, 3816, 29],+ [1980, 6, 3845, 30],+ [1980, 7, 3875, 29],+ [1980, 8, 3904, 30],+ [1980, 9, 3934, 30],+ [1980, 10, 3964, 29],+ [1980, 11, 3993, 30],+ [1980, 12, 4023, 30],+ [1981, 1, 4053, 29],+ [1981, 2, 4082, 30],+ [1981, 3, 4112, 29],+ [1981, 4, 4141, 29],+ [1981, 5, 4170, 30],+ [1981, 6, 4200, 29],+ [1981, 7, 4229, 29],+ [1981, 8, 4258, 30],+ [1981, 9, 4288, 30],+ [1981, 10, 4318, 29],+ [1981, 11, 4347, 30],+ [1981, 12, 4377, 30],+ [1982, 1, 4407, 30],+ [1982, 2, 4437, 29],+ [1982, 3, 4466, 30],+ [1982, 4, 4496, 29],+ [1982, -4, 4525, 29],+ [1982, 5, 4554, 30],+ [1982, 6, 4584, 29],+ [1982, 7, 4613, 29],+ [1982, 8, 4642, 30],+ [1982, 9, 4672, 29],+ [1982, 10, 4701, 30],+ [1982, 11, 4731, 30],+ [1982, 12, 4761, 30],+ [1983, 1, 4791, 30],+ [1983, 2, 4821, 29],+ [1983, 3, 4850, 30],+ [1983, 4, 4880, 29],+ [1983, 5, 4909, 29],+ [1983, 6, 4938, 30],+ [1983, 7, 4968, 29],+ [1983, 8, 4997, 29],+ [1983, 9, 5026, 30],+ [1983, 10, 5056, 29],+ [1983, 11, 5085, 30],+ [1983, 12, 5115, 30],+ [1984, 1, 5145, 30],+ [1984, 2, 5175, 29],+ [1984, 3, 5204, 30],+ [1984, 4, 5234, 30],+ [1984, 5, 5264, 29],+ [1984, 6, 5293, 29],+ [1984, 7, 5322, 30],+ [1984, 8, 5352, 29],+ [1984, 9, 5381, 29],+ [1984, 10, 5410, 30],+ [1984, -10, 5440, 29],+ [1984, 11, 5469, 30],+ [1984, 12, 5499, 30],+ [1985, 1, 5529, 29],+ [1985, 2, 5558, 30],+ [1985, 3, 5588, 30],+ [1985, 4, 5618, 29],+ [1985, 5, 5647, 30],+ [1985, 6, 5677, 29],+ [1985, 7, 5706, 30],+ [1985, 8, 5736, 29],+ [1985, 9, 5765, 29],+ [1985, 10, 5794, 30],+ [1985, 11, 5824, 29],+ [1985, 12, 5853, 30],+ [1986, 1, 5883, 29],+ [1986, 2, 5912, 30],+ [1986, 3, 5942, 30],+ [1986, 4, 5972, 29],+ [1986, 5, 6001, 30],+ [1986, 6, 6031, 30],+ [1986, 7, 6061, 29],+ [1986, 8, 6090, 30],+ [1986, 9, 6120, 29],+ [1986, 10, 6149, 30],+ [1986, 11, 6179, 29],+ [1986, 12, 6208, 29],+ [1987, 1, 6237, 30],+ [1987, 2, 6267, 29],+ [1987, 3, 6296, 30],+ [1987, 4, 6326, 29],+ [1987, 5, 6355, 30],+ [1987, 6, 6385, 30],+ [1987, -6, 6415, 29],+ [1987, 7, 6444, 30],+ [1987, 8, 6474, 30],+ [1987, 9, 6504, 29],+ [1987, 10, 6533, 30],+ [1987, 11, 6563, 29],+ [1987, 12, 6592, 29],+ [1988, 1, 6621, 30],+ [1988, 2, 6651, 29],+ [1988, 3, 6680, 30],+ [1988, 4, 6710, 29],+ [1988, 5, 6739, 30],+ [1988, 6, 6769, 29],+ [1988, 7, 6798, 30],+ [1988, 8, 6828, 30],+ [1988, 9, 6858, 29],+ [1988, 10, 6887, 30],+ [1988, 11, 6917, 30],+ [1988, 12, 6947, 29],+ [1989, 1, 6976, 30],+ [1989, 2, 7006, 29],+ [1989, 3, 7035, 29],+ [1989, 4, 7064, 30],+ [1989, 5, 7094, 29],+ [1989, 6, 7123, 30],+ [1989, 7, 7153, 29],+ [1989, 8, 7182, 30],+ [1989, 9, 7212, 29],+ [1989, 10, 7241, 30],+ [1989, 11, 7271, 30],+ [1989, 12, 7301, 30],+ [1990, 1, 7331, 29],+ [1990, 2, 7360, 30],+ [1990, 3, 7390, 29],+ [1990, 4, 7419, 29],+ [1990, 5, 7448, 30],+ [1990, -5, 7478, 29],+ [1990, 6, 7507, 29],+ [1990, 7, 7536, 30],+ [1990, 8, 7566, 29],+ [1990, 9, 7595, 30],+ [1990, 10, 7625, 30],+ [1990, 11, 7655, 30],+ [1990, 12, 7685, 30],+ [1991, 1, 7715, 29],+ [1991, 2, 7744, 30],+ [1991, 3, 7774, 29],+ [1991, 4, 7803, 29],+ [1991, 5, 7832, 30],+ [1991, 6, 7862, 29],+ [1991, 7, 7891, 29],+ [1991, 8, 7920, 30],+ [1991, 9, 7950, 29],+ [1991, 10, 7979, 30],+ [1991, 11, 8009, 30],+ [1991, 12, 8039, 30],+ [1992, 1, 8069, 29],+ [1992, 2, 8098, 30],+ [1992, 3, 8128, 30],+ [1992, 4, 8158, 29],+ [1992, 5, 8187, 29],+ [1992, 6, 8216, 30],+ [1992, 7, 8246, 29],+ [1992, 8, 8275, 29],+ [1992, 9, 8304, 30],+ [1992, 10, 8334, 29],+ [1992, 11, 8363, 30],+ [1992, 12, 8393, 30],+ [1993, 1, 8423, 29],+ [1993, 2, 8452, 30],+ [1993, 3, 8482, 30],+ [1993, -3, 8512, 29],+ [1993, 4, 8541, 30],+ [1993, 5, 8571, 29],+ [1993, 6, 8600, 30],+ [1993, 7, 8630, 29],+ [1993, 8, 8659, 29],+ [1993, 9, 8688, 30],+ [1993, 10, 8718, 29],+ [1993, 11, 8747, 30],+ [1993, 12, 8777, 29],+ [1994, 1, 8806, 30],+ [1994, 2, 8836, 30],+ [1994, 3, 8866, 30],+ [1994, 4, 8896, 29],+ [1994, 5, 8925, 30],+ [1994, 6, 8955, 29],+ [1994, 7, 8984, 30],+ [1994, 8, 9014, 29],+ [1994, 9, 9043, 29],+ [1994, 10, 9072, 30],+ [1994, 11, 9102, 29],+ [1994, 12, 9131, 30],+ [1995, 1, 9161, 29],+ [1995, 2, 9190, 30],+ [1995, 3, 9220, 30],+ [1995, 4, 9250, 29],+ [1995, 5, 9279, 30],+ [1995, 6, 9309, 29],+ [1995, 7, 9338, 30],+ [1995, 8, 9368, 30],+ [1995, -8, 9398, 29],+ [1995, 9, 9427, 29],+ [1995, 10, 9456, 30],+ [1995, 11, 9486, 29],+ [1995, 12, 9515, 30],+ [1996, 1, 9545, 29],+ [1996, 2, 9574, 30],+ [1996, 3, 9604, 29],+ [1996, 4, 9633, 30],+ [1996, 5, 9663, 30],+ [1996, 6, 9693, 29],+ [1996, 7, 9722, 30],+ [1996, 8, 9752, 29],+ [1996, 9, 9781, 30],+ [1996, 10, 9811, 30],+ [1996, 11, 9841, 29],+ [1996, 12, 9870, 29],+ [1997, 1, 9899, 30],+ [1997, 2, 9929, 29],+ [1997, 3, 9958, 30],+ [1997, 4, 9988, 29],+ [1997, 5, 10017, 30],+ [1997, 6, 10047, 29],+ [1997, 7, 10076, 30],+ [1997, 8, 10106, 30],+ [1997, 9, 10136, 29],+ [1997, 10, 10165, 30],+ [1997, 11, 10195, 30],+ [1997, 12, 10225, 29],+ [1998, 1, 10254, 30],+ [1998, 2, 10284, 29],+ [1998, 3, 10313, 29],+ [1998, 4, 10342, 30],+ [1998, 5, 10372, 29],+ [1998, -5, 10401, 29],+ [1998, 6, 10430, 30],+ [1998, 7, 10460, 30],+ [1998, 8, 10490, 29],+ [1998, 9, 10519, 30],+ [1998, 10, 10549, 30],+ [1998, 11, 10579, 29],+ [1998, 12, 10608, 30],+ [1999, 1, 10638, 30],+ [1999, 2, 10668, 29],+ [1999, 3, 10697, 29],+ [1999, 4, 10726, 30],+ [1999, 5, 10756, 29],+ [1999, 6, 10785, 29],+ [1999, 7, 10814, 30],+ [1999, 8, 10844, 29],+ [1999, 9, 10873, 30],+ [1999, 10, 10903, 30],+ [1999, 11, 10933, 30],+ [1999, 12, 10963, 29],+ [2000, 1, 10992, 30],+ [2000, 2, 11022, 30],+ [2000, 3, 11052, 29],+ [2000, 4, 11081, 29],+ [2000, 5, 11110, 30],+ [2000, 6, 11140, 29],+ [2000, 7, 11169, 29],+ [2000, 8, 11198, 30],+ [2000, 9, 11228, 29],+ [2000, 10, 11257, 30],+ [2000, 11, 11287, 30],+ [2000, 12, 11317, 29],+ [2001, 1, 11346, 30],+ [2001, 2, 11376, 30],+ [2001, 3, 11406, 29],+ [2001, 4, 11435, 30],+ [2001, -4, 11465, 29],+ [2001, 5, 11494, 30],+ [2001, 6, 11524, 29],+ [2001, 7, 11553, 29],+ [2001, 8, 11582, 30],+ [2001, 9, 11612, 29],+ [2001, 10, 11641, 30],+ [2001, 11, 11671, 29],+ [2001, 12, 11700, 30],+ [2002, 1, 11730, 30],+ [2002, 2, 11760, 30],+ [2002, 3, 11790, 29],+ [2002, 4, 11819, 30],+ [2002, 5, 11849, 29],+ [2002, 6, 11878, 30],+ [2002, 7, 11908, 29],+ [2002, 8, 11937, 29],+ [2002, 9, 11966, 30],+ [2002, 10, 11996, 29],+ [2002, 11, 12025, 30],+ [2002, 12, 12055, 29],+ [2003, 1, 12084, 30],+ [2003, 2, 12114, 30],+ [2003, 3, 12144, 29],+ [2003, 4, 12173, 30],+ [2003, 5, 12203, 30],+ [2003, 6, 12233, 29],+ [2003, 7, 12262, 30],+ [2003, 8, 12292, 29],+ [2003, 9, 12321, 29],+ [2003, 10, 12350, 30],+ [2003, 11, 12380, 29],+ [2003, 12, 12409, 30],+ [2004, 1, 12439, 29],+ [2004, 2, 12468, 30],+ [2004, -2, 12498, 29],+ [2004, 3, 12527, 30],+ [2004, 4, 12557, 30],+ [2004, 5, 12587, 29],+ [2004, 6, 12616, 30],+ [2004, 7, 12646, 29],+ [2004, 8, 12675, 30],+ [2004, 9, 12705, 29],+ [2004, 10, 12734, 30],+ [2004, 11, 12764, 29],+ [2004, 12, 12793, 30],+ [2005, 1, 12823, 29],+ [2005, 2, 12852, 30],+ [2005, 3, 12882, 29],+ [2005, 4, 12911, 30],+ [2005, 5, 12941, 29],+ [2005, 6, 12970, 30],+ [2005, 7, 13000, 30],+ [2005, 8, 13030, 29],+ [2005, 9, 13059, 30],+ [2005, 10, 13089, 29],+ [2005, 11, 13118, 30],+ [2005, 12, 13148, 29],+ [2006, 1, 13177, 30],+ [2006, 2, 13207, 29],+ [2006, 3, 13236, 30],+ [2006, 4, 13266, 29],+ [2006, 5, 13295, 30],+ [2006, 6, 13325, 29],+ [2006, 7, 13354, 30],+ [2006, -7, 13384, 29],+ [2006, 8, 13413, 30],+ [2006, 9, 13443, 30],+ [2006, 10, 13473, 29],+ [2006, 11, 13502, 30],+ [2006, 12, 13532, 30],+ [2007, 1, 13562, 29],+ [2007, 2, 13591, 29],+ [2007, 3, 13620, 30],+ [2007, 4, 13650, 29],+ [2007, 5, 13679, 29],+ [2007, 6, 13708, 30],+ [2007, 7, 13738, 29],+ [2007, 8, 13767, 30],+ [2007, 9, 13797, 30],+ [2007, 10, 13827, 30],+ [2007, 11, 13857, 29],+ [2007, 12, 13886, 30],+ [2008, 1, 13916, 30],+ [2008, 2, 13946, 29],+ [2008, 3, 13975, 29],+ [2008, 4, 14004, 30],+ [2008, 5, 14034, 29],+ [2008, 6, 14063, 29],+ [2008, 7, 14092, 30],+ [2008, 8, 14122, 29],+ [2008, 9, 14151, 30],+ [2008, 10, 14181, 30],+ [2008, 11, 14211, 29],+ [2008, 12, 14240, 30],+ [2009, 1, 14270, 30],+ [2009, 2, 14300, 30],+ [2009, 3, 14330, 29],+ [2009, 4, 14359, 29],+ [2009, 5, 14388, 30],+ [2009, -5, 14418, 29],+ [2009, 6, 14447, 29],+ [2009, 7, 14476, 30],+ [2009, 8, 14506, 29],+ [2009, 9, 14535, 30],+ [2009, 10, 14565, 29],+ [2009, 11, 14594, 30],+ [2009, 12, 14624, 30],+ [2010, 1, 14654, 30],+ [2010, 2, 14684, 29],+ [2010, 3, 14713, 30],+ [2010, 4, 14743, 29],+ [2010, 5, 14772, 30],+ [2010, 6, 14802, 29],+ [2010, 7, 14831, 29],+ [2010, 8, 14860, 30],+ [2010, 9, 14890, 29],+ [2010, 10, 14919, 30],+ [2010, 11, 14949, 29],+ [2010, 12, 14978, 30],+ [2011, 1, 15008, 30],+ [2011, 2, 15038, 29],+ [2011, 3, 15067, 30],+ [2011, 4, 15097, 30],+ [2011, 5, 15127, 29],+ [2011, 6, 15156, 30],+ [2011, 7, 15186, 29],+ [2011, 8, 15215, 29],+ [2011, 9, 15244, 30],+ [2011, 10, 15274, 29],+ [2011, 11, 15303, 30],+ [2011, 12, 15333, 29],+ [2012, 1, 15362, 30],+ [2012, 2, 15392, 29],+ [2012, 3, 15421, 30],+ [2012, 4, 15451, 30],+ [2012, -4, 15481, 29],+ [2012, 5, 15510, 30],+ [2012, 6, 15540, 29],+ [2012, 7, 15569, 30],+ [2012, 8, 15599, 29],+ [2012, 9, 15628, 30],+ [2012, 10, 15658, 29],+ [2012, 11, 15687, 30],+ [2012, 12, 15717, 29],+ [2013, 1, 15746, 30],+ [2013, 2, 15776, 29],+ [2013, 3, 15805, 30],+ [2013, 4, 15835, 29],+ [2013, 5, 15864, 30],+ [2013, 6, 15894, 30],+ [2013, 7, 15924, 29],+ [2013, 8, 15953, 30],+ [2013, 9, 15983, 29],+ [2013, 10, 16012, 30],+ [2013, 11, 16042, 29],+ [2013, 12, 16071, 30],+ [2014, 1, 16101, 29],+ [2014, 2, 16130, 30],+ [2014, 3, 16160, 29],+ [2014, 4, 16189, 30],+ [2014, 5, 16219, 29],+ [2014, 6, 16248, 30],+ [2014, 7, 16278, 29],+ [2014, 8, 16307, 30],+ [2014, 9, 16337, 30],+ [2014, -9, 16367, 29],+ [2014, 10, 16396, 30],+ [2014, 11, 16426, 29],+ [2014, 12, 16455, 30],+ [2015, 1, 16485, 29],+ [2015, 2, 16514, 30],+ [2015, 3, 16544, 29],+ [2015, 4, 16573, 29],+ [2015, 5, 16602, 30],+ [2015, 6, 16632, 29],+ [2015, 7, 16661, 30],+ [2015, 8, 16691, 30],+ [2015, 9, 16721, 30],+ [2015, 10, 16751, 29],+ [2015, 11, 16780, 30],+ [2015, 12, 16810, 29],+ [2016, 1, 16839, 30],+ [2016, 2, 16869, 29],+ [2016, 3, 16898, 30],+ [2016, 4, 16928, 29],+ [2016, 5, 16957, 29],+ [2016, 6, 16986, 30],+ [2016, 7, 17016, 29],+ [2016, 8, 17045, 30],+ [2016, 9, 17075, 30],+ [2016, 10, 17105, 29],+ [2016, 11, 17134, 30],+ [2016, 12, 17164, 30],+ [2017, 1, 17194, 29],+ [2017, 2, 17223, 30],+ [2017, 3, 17253, 29],+ [2017, 4, 17282, 30],+ [2017, 5, 17312, 29],+ [2017, 6, 17341, 29],+ [2017, -6, 17370, 30],+ [2017, 7, 17400, 29],+ [2017, 8, 17429, 30],+ [2017, 9, 17459, 29],+ [2017, 10, 17488, 30],+ [2017, 11, 17518, 30],+ [2017, 12, 17548, 30],+ [2018, 1, 17578, 29],+ [2018, 2, 17607, 30],+ [2018, 3, 17637, 29],+ [2018, 4, 17666, 30],+ [2018, 5, 17696, 29],+ [2018, 6, 17725, 29],+ [2018, 7, 17754, 30],+ [2018, 8, 17784, 29],+ [2018, 9, 17813, 30],+ [2018, 10, 17843, 29],+ [2018, 11, 17872, 30],+ [2018, 12, 17902, 30],+ [2019, 1, 17932, 30],+ [2019, 2, 17962, 29],+ [2019, 3, 17991, 30],+ [2019, 4, 18021, 29],+ [2019, 5, 18050, 30],+ [2019, 6, 18080, 29],+ [2019, 7, 18109, 29],+ [2019, 8, 18138, 30],+ [2019, 9, 18168, 29],+ [2019, 10, 18197, 29],+ [2019, 11, 18226, 30],+ [2019, 12, 18256, 30],+ [2020, 1, 18286, 29],+ [2020, 2, 18315, 30],+ [2020, 3, 18345, 30],+ [2020, 4, 18375, 30],+ [2020, -4, 18405, 29],+ [2020, 5, 18434, 30],+ [2020, 6, 18464, 29],+ [2020, 7, 18493, 29],+ [2020, 8, 18522, 30],+ [2020, 9, 18552, 29],+ [2020, 10, 18581, 30],+ [2020, 11, 18611, 29],+ [2020, 12, 18640, 30],+ [2021, 1, 18670, 29],+ [2021, 2, 18699, 30],+ [2021, 3, 18729, 30],+ [2021, 4, 18759, 29],+ [2021, 5, 18788, 30],+ [2021, 6, 18818, 29],+ [2021, 7, 18847, 30],+ [2021, 8, 18877, 29],+ [2021, 9, 18906, 30],+ [2021, 10, 18936, 29],+ [2021, 11, 18965, 30],+ [2021, 12, 18995, 29],+ [2022, 1, 19024, 30],+ [2022, 2, 19054, 29],+ [2022, 3, 19083, 30],+ [2022, 4, 19113, 29],+ [2022, 5, 19142, 30],+ [2022, 6, 19172, 30],+ [2022, 7, 19202, 29],+ [2022, 8, 19231, 30],+ [2022, 9, 19261, 29],+ [2022, 10, 19290, 30],+ [2022, 11, 19320, 29],+ [2022, 12, 19349, 30],+ [2023, 1, 19379, 29],+ [2023, 2, 19408, 30],+ [2023, -2, 19438, 29],+ [2023, 3, 19467, 29],+ [2023, 4, 19496, 30],+ [2023, 5, 19526, 30],+ [2023, 6, 19556, 29],+ [2023, 7, 19585, 30],+ [2023, 8, 19615, 30],+ [2023, 9, 19645, 29],+ [2023, 10, 19674, 30],+ [2023, 11, 19704, 29],+ [2023, 12, 19733, 30],+ [2024, 1, 19763, 29],+ [2024, 2, 19792, 30],+ [2024, 3, 19822, 29],+ [2024, 4, 19851, 29],+ [2024, 5, 19880, 30],+ [2024, 6, 19910, 29],+ [2024, 7, 19939, 30],+ [2024, 8, 19969, 30],+ [2024, 9, 19999, 29],+ [2024, 10, 20028, 30],+ [2024, 11, 20058, 30],+ [2024, 12, 20088, 29],+ [2025, 1, 20117, 30],+ [2025, 2, 20147, 29],+ [2025, 3, 20176, 30],+ [2025, 4, 20206, 29],+ [2025, 5, 20235, 29],+ [2025, 6, 20264, 30],+ [2025, -6, 20294, 29],+ [2025, 7, 20323, 30],+ [2025, 8, 20353, 29],+ [2025, 9, 20382, 30],+ [2025, 10, 20412, 30],+ [2025, 11, 20442, 30],+ [2025, 12, 20472, 29],+ [2026, 1, 20501, 30],+ [2026, 2, 20531, 29],+ [2026, 3, 20560, 30],+ [2026, 4, 20590, 29],+ [2026, 5, 20619, 29],+ [2026, 6, 20648, 30],+ [2026, 7, 20678, 29],+ [2026, 8, 20707, 29],+ [2026, 9, 20736, 30],+ [2026, 10, 20766, 30],+ [2026, 11, 20796, 30],+ [2026, 12, 20826, 29],+ [2027, 1, 20855, 30],+ [2027, 2, 20885, 30],+ [2027, 3, 20915, 29],+ [2027, 4, 20944, 30],+ [2027, 5, 20974, 29],+ [2027, 6, 21003, 29],+ [2027, 7, 21032, 30],+ [2027, 8, 21062, 29],+ [2027, 9, 21091, 29],+ [2027, 10, 21120, 30],+ [2027, 11, 21150, 30],+ [2027, 12, 21180, 29],+ [2028, 1, 21209, 30],+ [2028, 2, 21239, 30],+ [2028, 3, 21269, 30],+ [2028, 4, 21299, 29],+ [2028, 5, 21328, 30],+ [2028, -5, 21358, 29],+ [2028, 6, 21387, 29],+ [2028, 7, 21416, 30],+ [2028, 8, 21446, 29],+ [2028, 9, 21475, 29],+ [2028, 10, 21504, 30],+ [2028, 11, 21534, 30],+ [2028, 12, 21564, 29],+ [2029, 1, 21593, 30],+ [2029, 2, 21623, 30],+ [2029, 3, 21653, 29],+ [2029, 4, 21682, 30],+ [2029, 5, 21712, 29],+ [2029, 6, 21741, 30],+ [2029, 7, 21771, 29],+ [2029, 8, 21800, 30],+ [2029, 9, 21830, 29],+ [2029, 10, 21859, 29],+ [2029, 11, 21888, 30],+ [2029, 12, 21918, 30],+ [2030, 1, 21948, 29],+ [2030, 2, 21977, 30],+ [2030, 3, 22007, 29],+ [2030, 4, 22036, 30],+ [2030, 5, 22066, 30],+ [2030, 6, 22096, 29],+ [2030, 7, 22125, 30],+ [2030, 8, 22155, 29],+ [2030, 9, 22184, 30],+ [2030, 10, 22214, 29],+ [2030, 11, 22243, 30],+ [2030, 12, 22273, 29],+ [2031, 1, 22302, 29],+ [2031, 2, 22331, 30],+ [2031, 3, 22361, 30],+ [2031, -3, 22391, 29],+ [2031, 4, 22420, 30],+ [2031, 5, 22450, 29],+ [2031, 6, 22479, 30],+ [2031, 7, 22509, 30],+ [2031, 8, 22539, 29],+ [2031, 9, 22568, 30],+ [2031, 10, 22598, 29],+ [2031, 11, 22627, 30],+ [2031, 12, 22657, 29],+ [2032, 1, 22686, 30],+ [2032, 2, 22716, 29],+ [2032, 3, 22745, 29],+ [2032, 4, 22774, 30],+ [2032, 5, 22804, 29],+ [2032, 6, 22833, 30],+ [2032, 7, 22863, 30],+ [2032, 8, 22893, 29],+ [2032, 9, 22922, 30],+ [2032, 10, 22952, 30],+ [2032, 11, 22982, 29],+ [2032, 12, 23011, 30],+ [2033, 1, 23041, 29],+ [2033, 2, 23070, 30],+ [2033, 3, 23100, 29],+ [2033, 4, 23129, 29],+ [2033, 5, 23158, 30],+ [2033, 6, 23188, 29],+ [2033, 7, 23217, 30],+ [2033, 8, 23247, 29],+ [2033, 9, 23276, 30],+ [2033, 10, 23306, 30],+ [2033, 11, 23336, 30],+ [2033, -11, 23366, 29],+ [2033, 12, 23395, 30],+ [2034, 1, 23425, 29],+ [2034, 2, 23454, 30],+ [2034, 3, 23484, 29],+ [2034, 4, 23513, 29],+ [2034, 5, 23542, 30],+ [2034, 6, 23572, 29],+ [2034, 7, 23601, 30],+ [2034, 8, 23631, 29],+ [2034, 9, 23660, 30],+ [2034, 10, 23690, 30],+ [2034, 11, 23720, 29],+ [2034, 12, 23749, 30],+ [2035, 1, 23779, 30],+ [2035, 2, 23809, 29],+ [2035, 3, 23838, 30],+ [2035, 4, 23868, 29],+ [2035, 5, 23897, 29],+ [2035, 6, 23926, 30],+ [2035, 7, 23956, 29],+ [2035, 8, 23985, 29],+ [2035, 9, 24014, 30],+ [2035, 10, 24044, 30],+ [2035, 11, 24074, 29],+ [2035, 12, 24103, 30],+ [2036, 1, 24133, 30],+ [2036, 2, 24163, 30],+ [2036, 3, 24193, 29],+ [2036, 4, 24222, 30],+ [2036, 5, 24252, 29],+ [2036, 6, 24281, 29],+ [2036, -6, 24310, 30],+ [2036, 7, 24340, 29],+ [2036, 8, 24369, 29],+ [2036, 9, 24398, 30],+ [2036, 10, 24428, 29],+ [2036, 11, 24457, 30],+ [2036, 12, 24487, 30],+ [2037, 1, 24517, 30],+ [2037, 2, 24547, 30],+ [2037, 3, 24577, 29],+ [2037, 4, 24606, 30],+ [2037, 5, 24636, 29],+ [2037, 6, 24665, 29],+ [2037, 7, 24694, 30],+ [2037, 8, 24724, 29],+ [2037, 9, 24753, 29],+ [2037, 10, 24782, 30],+ [2037, 11, 24812, 29],+ [2037, 12, 24841, 30],+ [2038, 1, 24871, 30],+ [2038, 2, 24901, 30],+ [2038, 3, 24931, 29],+ [2038, 4, 24960, 30],+ [2038, 5, 24990, 29],+ [2038, 6, 25019, 30],+ [2038, 7, 25049, 29],+ [2038, 8, 25078, 30],+ [2038, 9, 25108, 29],+ [2038, 10, 25137, 29],+ [2038, 11, 25166, 30],+ [2038, 12, 25196, 29],+ [2039, 1, 25225, 30],+ [2039, 2, 25255, 30],+ [2039, 3, 25285, 29],+ [2039, 4, 25314, 30],+ [2039, 5, 25344, 30],+ [2039, -5, 25374, 29],+ [2039, 6, 25403, 30],+ [2039, 7, 25433, 29],+ [2039, 8, 25462, 30],+ [2039, 9, 25492, 29],+ [2039, 10, 25521, 30],+ [2039, 11, 25551, 29],+ [2039, 12, 25580, 29],+ [2040, 1, 25609, 30],+ [2040, 2, 25639, 29],+ [2040, 3, 25668, 30],+ [2040, 4, 25698, 30],+ [2040, 5, 25728, 29],+ [2040, 6, 25757, 30],+ [2040, 7, 25787, 29],+ [2040, 8, 25816, 30],+ [2040, 9, 25846, 30],+ [2040, 10, 25876, 29],+ [2040, 11, 25905, 30],+ [2040, 12, 25935, 29],+ [2041, 1, 25964, 29],+ [2041, 2, 25993, 30],+ [2041, 3, 26023, 29],+ [2041, 4, 26052, 30],+ [2041, 5, 26082, 29],+ [2041, 6, 26111, 30],+ [2041, 7, 26141, 30],+ [2041, 8, 26171, 29],+ [2041, 9, 26200, 30],+ [2041, 10, 26230, 30],+ [2041, 11, 26260, 29],+ [2041, 12, 26289, 30],+ [2042, 1, 26319, 29],+ [2042, 2, 26348, 30],+ [2042, -2, 26378, 29],+ [2042, 3, 26407, 29],+ [2042, 4, 26436, 30],+ [2042, 5, 26466, 29],+ [2042, 6, 26495, 30],+ [2042, 7, 26525, 29],+ [2042, 8, 26554, 30],+ [2042, 9, 26584, 30],+ [2042, 10, 26614, 29],+ [2042, 11, 26643, 30],+ [2042, 12, 26673, 30],+ [2043, 1, 26703, 29],+ [2043, 2, 26732, 30],+ [2043, 3, 26762, 29],+ [2043, 4, 26791, 29],+ [2043, 5, 26820, 30],+ [2043, 6, 26850, 29],+ [2043, 7, 26879, 29],+ [2043, 8, 26908, 30],+ [2043, 9, 26938, 30],+ [2043, 10, 26968, 29],+ [2043, 11, 26997, 30],+ [2043, 12, 27027, 30],+ [2044, 1, 27057, 30],+ [2044, 2, 27087, 29],+ [2044, 3, 27116, 30],+ [2044, 4, 27146, 29],+ [2044, 5, 27175, 29],+ [2044, 6, 27204, 30],+ [2044, 7, 27234, 29],+ [2044, -7, 27263, 29],+ [2044, 8, 27292, 30],+ [2044, 9, 27322, 29],+ [2044, 10, 27351, 30],+ [2044, 11, 27381, 30],+ [2044, 12, 27411, 30],+ [2045, 1, 27441, 30],+ [2045, 2, 27471, 29],+ [2045, 3, 27500, 30],+ [2045, 4, 27530, 29],+ [2045, 5, 27559, 29],+ [2045, 6, 27588, 30],+ [2045, 7, 27618, 29],+ [2045, 8, 27647, 29],+ [2045, 9, 27676, 30],+ [2045, 10, 27706, 29],+ [2045, 11, 27735, 30],+ [2045, 12, 27765, 30],+ [2046, 1, 27795, 30],+ [2046, 2, 27825, 29],+ [2046, 3, 27854, 30],+ [2046, 4, 27884, 29],+ [2046, 5, 27913, 30],+ [2046, 6, 27943, 29],+ [2046, 7, 27972, 30],+ [2046, 8, 28002, 29],+ [2046, 9, 28031, 29],+ [2046, 10, 28060, 30],+ [2046, 11, 28090, 29],+ [2046, 12, 28119, 30],+ [2047, 1, 28149, 30],+ [2047, 2, 28179, 29],+ [2047, 3, 28208, 30],+ [2047, 4, 28238, 30],+ [2047, 5, 28268, 29],+ [2047, -5, 28297, 30],+ [2047, 6, 28327, 29],+ [2047, 7, 28356, 30],+ [2047, 8, 28386, 29],+ [2047, 9, 28415, 29],+ [2047, 10, 28444, 30],+ [2047, 11, 28474, 29],+ [2047, 12, 28503, 30],+ [2048, 1, 28533, 29],+ [2048, 2, 28562, 30],+ [2048, 3, 28592, 30],+ [2048, 4, 28622, 29],+ [2048, 5, 28651, 30],+ [2048, 6, 28681, 30],+ [2048, 7, 28711, 29],+ [2048, 8, 28740, 30],+ [2048, 9, 28770, 29],+ [2048, 10, 28799, 29],+ [2048, 11, 28828, 30],+ [2048, 12, 28858, 29],+ [2049, 1, 28887, 30],+ [2049, 2, 28917, 29],+ [2049, 3, 28946, 30],+ [2049, 4, 28976, 29],+ [2049, 5, 29005, 30],+ [2049, 6, 29035, 30],+ [2049, 7, 29065, 29],+ [2049, 8, 29094, 30],+ [2049, 9, 29124, 30],+ [2049, 10, 29154, 29],+ [2049, 11, 29183, 30],+ [2049, 12, 29213, 29],+ [2050, 1, 29242, 29],+ [2050, 2, 29271, 30],+ [2050, 3, 29301, 29],+ [2050, -3, 29330, 30],+ [2050, 4, 29360, 29],+ [2050, 5, 29389, 30],+ [2050, 6, 29419, 29],+ [2050, 7, 29448, 30],+ [2050, 8, 29478, 30],+ [2050, 9, 29508, 29],+ [2050, 10, 29537, 30],+ [2050, 11, 29567, 30],+ [2050, 12, 29597, 29],+ [2051, 1, 29626, 30],+ [2051, 2, 29656, 29],+ [2051, 3, 29685, 29],+ [2051, 4, 29714, 30],+ [2051, 5, 29744, 29],+ [2051, 6, 29773, 29],+ [2051, 7, 29802, 30],+ [2051, 8, 29832, 30],+ [2051, 9, 29862, 29],+ [2051, 10, 29891, 30],+ [2051, 11, 29921, 30],+ [2051, 12, 29951, 30],+ [2052, 1, 29981, 29],+ [2052, 2, 30010, 30],+ [2052, 3, 30040, 29],+ [2052, 4, 30069, 29],+ [2052, 5, 30098, 30],+ [2052, 6, 30128, 29],+ [2052, 7, 30157, 29],+ [2052, 8, 30186, 30],+ [2052, -8, 30216, 29],+ [2052, 9, 30245, 30],+ [2052, 10, 30275, 30],+ [2052, 11, 30305, 30],+ [2052, 12, 30335, 30],+ [2053, 1, 30365, 29],+ [2053, 2, 30394, 30],+ [2053, 3, 30424, 29],+ [2053, 4, 30453, 29],+ [2053, 5, 30482, 30],+ [2053, 6, 30512, 29],+ [2053, 7, 30541, 29],+ [2053, 8, 30570, 30],+ [2053, 9, 30600, 29],+ [2053, 10, 30629, 30],+ [2053, 11, 30659, 30],+ [2053, 12, 30689, 30],+ [2054, 1, 30719, 29],+ [2054, 2, 30748, 30],+ [2054, 3, 30778, 30],+ [2054, 4, 30808, 29],+ [2054, 5, 30837, 29],+ [2054, 6, 30866, 30],+ [2054, 7, 30896, 29],+ [2054, 8, 30925, 29],+ [2054, 9, 30954, 30],+ [2054, 10, 30984, 29],+ [2054, 11, 31013, 30],+ [2054, 12, 31043, 30],+ [2055, 1, 31073, 29],+ [2055, 2, 31102, 30],+ [2055, 3, 31132, 30],+ [2055, 4, 31162, 29],+ [2055, 5, 31191, 30],+ [2055, 6, 31221, 29],+ [2055, -6, 31250, 30],+ [2055, 7, 31280, 29],+ [2055, 8, 31309, 29],+ [2055, 9, 31338, 30],+ [2055, 10, 31368, 29],+ [2055, 11, 31397, 30],+ [2055, 12, 31427, 29],+ [2056, 1, 31456, 30],+ [2056, 2, 31486, 30],+ [2056, 3, 31516, 30],+ [2056, 4, 31546, 29],+ [2056, 5, 31575, 30],+ [2056, 6, 31605, 29],+ [2056, 7, 31634, 30],+ [2056, 8, 31664, 29],+ [2056, 9, 31693, 29],+ [2056, 10, 31722, 30],+ [2056, 11, 31752, 29],+ [2056, 12, 31781, 30],+ [2057, 1, 31811, 29],+ [2057, 2, 31840, 30],+ [2057, 3, 31870, 30],+ [2057, 4, 31900, 29],+ [2057, 5, 31929, 30],+ [2057, 6, 31959, 29],+ [2057, 7, 31988, 30],+ [2057, 8, 32018, 29],+ [2057, 9, 32047, 30],+ [2057, 10, 32077, 29],+ [2057, 11, 32106, 30],+ [2057, 12, 32136, 29],+ [2058, 1, 32165, 30],+ [2058, 2, 32195, 29],+ [2058, 3, 32224, 30],+ [2058, 4, 32254, 29],+ [2058, -4, 32283, 30],+ [2058, 5, 32313, 29],+ [2058, 6, 32342, 30],+ [2058, 7, 32372, 30],+ [2058, 8, 32402, 29],+ [2058, 9, 32431, 30],+ [2058, 10, 32461, 30],+ [2058, 11, 32491, 29],+ [2058, 12, 32520, 29],+ [2059, 1, 32549, 30],+ [2059, 2, 32579, 29],+ [2059, 3, 32608, 30],+ [2059, 4, 32638, 29],+ [2059, 5, 32667, 30],+ [2059, 6, 32697, 29],+ [2059, 7, 32726, 30],+ [2059, 8, 32756, 29],+ [2059, 9, 32785, 30],+ [2059, 10, 32815, 30],+ [2059, 11, 32845, 30],+ [2059, 12, 32875, 29],+ [2060, 1, 32904, 30],+ [2060, 2, 32934, 29],+ [2060, 3, 32963, 29],+ [2060, 4, 32992, 30],+ [2060, 5, 33022, 29],+ [2060, 6, 33051, 29],+ [2060, 7, 33080, 30],+ [2060, 8, 33110, 29],+ [2060, 9, 33139, 30],+ [2060, 10, 33169, 30],+ [2060, 11, 33199, 30],+ [2060, 12, 33229, 29],+ [2061, 1, 33258, 30],+ [2061, 2, 33288, 30],+ [2061, 3, 33318, 29],+ [2061, -3, 33347, 29],+ [2061, 4, 33376, 30],+ [2061, 5, 33406, 29],+ [2061, 6, 33435, 29],+ [2061, 7, 33464, 30],+ [2061, 8, 33494, 29],+ [2061, 9, 33523, 30],+ [2061, 10, 33553, 30],+ [2061, 11, 33583, 30],+ [2061, 12, 33613, 29],+ [2062, 1, 33642, 30],+ [2062, 2, 33672, 30],+ [2062, 3, 33702, 29],+ [2062, 4, 33731, 29],+ [2062, 5, 33760, 30],+ [2062, 6, 33790, 29],+ [2062, 7, 33819, 29],+ [2062, 8, 33848, 30],+ [2062, 9, 33878, 29],+ [2062, 10, 33907, 30],+ [2062, 11, 33937, 30],+ [2062, 12, 33967, 29],+ [2063, 1, 33996, 30],+ [2063, 2, 34026, 30],+ [2063, 3, 34056, 29],+ [2063, 4, 34085, 30],+ [2063, 5, 34115, 29],+ [2063, 6, 34144, 30],+ [2063, 7, 34174, 29],+ [2063, -7, 34203, 29],+ [2063, 8, 34232, 30],+ [2063, 9, 34262, 29],+ [2063, 10, 34291, 30],+ [2063, 11, 34321, 29],+ [2063, 12, 34350, 30],+ [2064, 1, 34380, 30],+ [2064, 2, 34410, 30],+ [2064, 3, 34440, 29],+ [2064, 4, 34469, 30],+ [2064, 5, 34499, 29],+ [2064, 6, 34528, 30],+ [2064, 7, 34558, 29],+ [2064, 8, 34587, 29],+ [2064, 9, 34616, 30],+ [2064, 10, 34646, 29],+ [2064, 11, 34675, 30],+ [2064, 12, 34705, 29],+ [2065, 1, 34734, 30],+ [2065, 2, 34764, 30],+ [2065, 3, 34794, 29],+ [2065, 4, 34823, 30],+ [2065, 5, 34853, 30],+ [2065, 6, 34883, 29],+ [2065, 7, 34912, 30],+ [2065, 8, 34942, 29],+ [2065, 9, 34971, 29],+ [2065, 10, 35000, 30],+ [2065, 11, 35030, 29],+ [2065, 12, 35059, 30],+ [2066, 1, 35089, 29],+ [2066, 2, 35118, 30],+ [2066, 3, 35148, 29],+ [2066, 4, 35177, 30],+ [2066, 5, 35207, 30],+ [2066, -5, 35237, 29],+ [2066, 6, 35266, 30],+ [2066, 7, 35296, 29],+ [2066, 8, 35325, 30],+ [2066, 9, 35355, 29],+ [2066, 10, 35384, 30],+ [2066, 11, 35414, 29],+ [2066, 12, 35443, 30],+ [2067, 1, 35473, 29],+ [2067, 2, 35502, 30],+ [2067, 3, 35532, 29],+ [2067, 4, 35561, 30],+ [2067, 5, 35591, 29],+ [2067, 6, 35620, 30],+ [2067, 7, 35650, 30],+ [2067, 8, 35680, 29],+ [2067, 9, 35709, 30],+ [2067, 10, 35739, 29],+ [2067, 11, 35768, 30],+ [2067, 12, 35798, 29],+ [2068, 1, 35827, 30],+ [2068, 2, 35857, 29],+ [2068, 3, 35886, 30],+ [2068, 4, 35916, 29],+ [2068, 5, 35945, 29],+ [2068, 6, 35974, 30],+ [2068, 7, 36004, 30],+ [2068, 8, 36034, 29],+ [2068, 9, 36063, 30],+ [2068, 10, 36093, 30],+ [2068, 11, 36123, 29],+ [2068, 12, 36152, 30],+ [2069, 1, 36182, 29],+ [2069, 2, 36211, 30],+ [2069, 3, 36241, 29],+ [2069, 4, 36270, 30],+ [2069, -4, 36300, 29],+ [2069, 5, 36329, 29],+ [2069, 6, 36358, 30],+ [2069, 7, 36388, 29],+ [2069, 8, 36417, 30],+ [2069, 9, 36447, 30],+ [2069, 10, 36477, 30],+ [2069, 11, 36507, 29],+ [2069, 12, 36536, 30],+ [2070, 1, 36566, 29],+ [2070, 2, 36595, 30],+ [2070, 3, 36625, 29],+ [2070, 4, 36654, 30],+ [2070, 5, 36684, 29],+ [2070, 6, 36713, 29],+ [2070, 7, 36742, 30],+ [2070, 8, 36772, 29],+ [2070, 9, 36801, 30],+ [2070, 10, 36831, 30],+ [2070, 11, 36861, 29],+ [2070, 12, 36890, 30],+ [2071, 1, 36920, 30],+ [2071, 2, 36950, 29],+ [2071, 3, 36979, 30],+ [2071, 4, 37009, 29],+ [2071, 5, 37038, 30],+ [2071, 6, 37068, 29],+ [2071, 7, 37097, 29],+ [2071, 8, 37126, 30],+ [2071, -8, 37156, 29],+ [2071, 9, 37185, 30],+ [2071, 10, 37215, 29],+ [2071, 11, 37244, 30],+ [2071, 12, 37274, 30],+ [2072, 1, 37304, 30],+ [2072, 2, 37334, 29],+ [2072, 3, 37363, 30],+ [2072, 4, 37393, 29],+ [2072, 5, 37422, 30],+ [2072, 6, 37452, 29],+ [2072, 7, 37481, 29],+ [2072, 8, 37510, 30],+ [2072, 9, 37540, 29],+ [2072, 10, 37569, 30],+ [2072, 11, 37599, 29],+ [2072, 12, 37628, 30],+ [2073, 1, 37658, 30],+ [2073, 2, 37688, 29],+ [2073, 3, 37717, 30],+ [2073, 4, 37747, 30],+ [2073, 5, 37777, 29],+ [2073, 6, 37806, 30],+ [2073, 7, 37836, 29],+ [2073, 8, 37865, 29],+ [2073, 9, 37894, 30],+ [2073, 10, 37924, 29],+ [2073, 11, 37953, 30],+ [2073, 12, 37983, 29],+ [2074, 1, 38012, 30],+ [2074, 2, 38042, 29],+ [2074, 3, 38071, 30],+ [2074, 4, 38101, 30],+ [2074, 5, 38131, 29],+ [2074, 6, 38160, 30],+ [2074, -6, 38190, 29],+ [2074, 7, 38219, 30],+ [2074, 8, 38249, 29],+ [2074, 9, 38278, 30],+ [2074, 10, 38308, 29],+ [2074, 11, 38337, 30],+ [2074, 12, 38367, 29],+ [2075, 1, 38396, 30],+ [2075, 2, 38426, 29],+ [2075, 3, 38455, 30],+ [2075, 4, 38485, 29],+ [2075, 5, 38514, 30],+ [2075, 6, 38544, 30],+ [2075, 7, 38574, 29],+ [2075, 8, 38603, 30],+ [2075, 9, 38633, 29],+ [2075, 10, 38662, 30],+ [2075, 11, 38692, 29],+ [2075, 12, 38721, 30],+ [2076, 1, 38751, 29],+ [2076, 2, 38780, 30],+ [2076, 3, 38810, 29],+ [2076, 4, 38839, 30],+ [2076, 5, 38869, 29],+ [2076, 6, 38898, 30],+ [2076, 7, 38928, 29],+ [2076, 8, 38957, 30],+ [2076, 9, 38987, 30],+ [2076, 10, 39017, 29],+ [2076, 11, 39046, 30],+ [2076, 12, 39076, 29],+ [2077, 1, 39105, 30],+ [2077, 2, 39135, 29],+ [2077, 3, 39164, 30],+ [2077, 4, 39194, 29],+ [2077, -4, 39223, 29],+ [2077, 5, 39252, 30],+ [2077, 6, 39282, 29],+ [2077, 7, 39311, 30],+ [2077, 8, 39341, 30],+ [2077, 9, 39371, 30],+ [2077, 10, 39401, 29],+ [2077, 11, 39430, 30],+ [2077, 12, 39460, 29],+ [2078, 1, 39489, 30],+ [2078, 2, 39519, 29],+ [2078, 3, 39548, 30],+ [2078, 4, 39578, 29],+ [2078, 5, 39607, 29],+ [2078, 6, 39636, 30],+ [2078, 7, 39666, 29],+ [2078, 8, 39695, 30],+ [2078, 9, 39725, 30],+ [2078, 10, 39755, 29],+ [2078, 11, 39784, 30],+ [2078, 12, 39814, 30],+ [2079, 1, 39844, 29],+ [2079, 2, 39873, 30],+ [2079, 3, 39903, 29],+ [2079, 4, 39932, 30],+ [2079, 5, 39962, 29],+ [2079, 6, 39991, 29],+ [2079, 7, 40020, 30],+ [2079, 8, 40050, 29],+ [2079, 9, 40079, 30],+ [2079, 10, 40109, 29],+ [2079, 11, 40138, 30],+ [2079, 12, 40168, 30],+ [2080, 1, 40198, 30],+ [2080, 2, 40228, 29],+ [2080, 3, 40257, 30],+ [2080, -3, 40287, 29],+ [2080, 4, 40316, 30],+ [2080, 5, 40346, 29],+ [2080, 6, 40375, 29],+ [2080, 7, 40404, 30],+ [2080, 8, 40434, 29],+ [2080, 9, 40463, 29],+ [2080, 10, 40492, 30],+ [2080, 11, 40522, 30],+ [2080, 12, 40552, 30],+ [2081, 1, 40582, 29],+ [2081, 2, 40611, 30],+ [2081, 3, 40641, 30],+ [2081, 4, 40671, 29],+ [2081, 5, 40700, 30],+ [2081, 6, 40730, 29],+ [2081, 7, 40759, 29],+ [2081, 8, 40788, 30],+ [2081, 9, 40818, 29],+ [2081, 10, 40847, 29],+ [2081, 11, 40876, 30],+ [2081, 12, 40906, 30],+ [2082, 1, 40936, 29],+ [2082, 2, 40965, 30],+ [2082, 3, 40995, 30],+ [2082, 4, 41025, 30],+ [2082, 5, 41055, 29],+ [2082, 6, 41084, 29],+ [2082, 7, 41113, 30],+ [2082, -7, 41143, 29],+ [2082, 8, 41172, 30],+ [2082, 9, 41202, 29],+ [2082, 10, 41231, 29],+ [2082, 11, 41260, 30],+ [2082, 12, 41290, 30],+ [2083, 1, 41320, 29],+ [2083, 2, 41349, 30],+ [2083, 3, 41379, 30],+ [2083, 4, 41409, 29],+ [2083, 5, 41438, 30],+ [2083, 6, 41468, 29],+ [2083, 7, 41497, 30],+ [2083, 8, 41527, 29],+ [2083, 9, 41556, 30],+ [2083, 10, 41586, 29],+ [2083, 11, 41615, 30],+ [2083, 12, 41645, 29],+ [2084, 1, 41674, 30],+ [2084, 2, 41704, 29],+ [2084, 3, 41733, 30],+ [2084, 4, 41763, 29],+ [2084, 5, 41792, 30],+ [2084, 6, 41822, 30],+ [2084, 7, 41852, 29],+ [2084, 8, 41881, 30],+ [2084, 9, 41911, 29],+ [2084, 10, 41940, 30],+ [2084, 11, 41970, 29],+ [2084, 12, 41999, 30],+ [2085, 1, 42029, 29],+ [2085, 2, 42058, 30],+ [2085, 3, 42088, 29],+ [2085, 4, 42117, 29],+ [2085, 5, 42146, 30],+ [2085, -5, 42176, 30],+ [2085, 6, 42206, 29],+ [2085, 7, 42235, 30],+ [2085, 8, 42265, 30],+ [2085, 9, 42295, 29],+ [2085, 10, 42324, 30],+ [2085, 11, 42354, 29],+ [2085, 12, 42383, 30],+ [2086, 1, 42413, 29],+ [2086, 2, 42442, 30],+ [2086, 3, 42472, 29],+ [2086, 4, 42501, 29],+ [2086, 5, 42530, 30],+ [2086, 6, 42560, 29],+ [2086, 7, 42589, 30],+ [2086, 8, 42619, 30],+ [2086, 9, 42649, 29],+ [2086, 10, 42678, 30],+ [2086, 11, 42708, 30],+ [2086, 12, 42738, 29],+ [2087, 1, 42767, 30],+ [2087, 2, 42797, 29],+ [2087, 3, 42826, 30],+ [2087, 4, 42856, 29],+ [2087, 5, 42885, 29],+ [2087, 6, 42914, 30],+ [2087, 7, 42944, 29],+ [2087, 8, 42973, 30],+ [2087, 9, 43003, 29],+ [2087, 10, 43032, 30],+ [2087, 11, 43062, 30],+ [2087, 12, 43092, 30],+ [2088, 1, 43122, 29],+ [2088, 2, 43151, 30],+ [2088, 3, 43181, 29],+ [2088, 4, 43210, 30],+ [2088, -4, 43240, 29],+ [2088, 5, 43269, 29],+ [2088, 6, 43298, 30],+ [2088, 7, 43328, 29],+ [2088, 8, 43357, 29],+ [2088, 9, 43386, 30],+ [2088, 10, 43416, 30],+ [2088, 11, 43446, 30],+ [2088, 12, 43476, 29],+ [2089, 1, 43505, 30],+ [2089, 2, 43535, 30],+ [2089, 3, 43565, 29],+ [2089, 4, 43594, 30],+ [2089, 5, 43624, 29],+ [2089, 6, 43653, 29],+ [2089, 7, 43682, 29],+ [2089, 8, 43711, 30],+ [2089, 9, 43741, 29],+ [2089, 10, 43770, 30],+ [2089, 11, 43800, 30],+ [2089, 12, 43830, 29],+ [2090, 1, 43859, 30],+ [2090, 2, 43889, 30],+ [2090, 3, 43919, 30],+ [2090, 4, 43949, 29],+ [2090, 5, 43978, 30],+ [2090, 6, 44008, 29],+ [2090, 7, 44037, 29],+ [2090, 8, 44066, 30],+ [2090, -8, 44096, 29],+ [2090, 9, 44125, 29],+ [2090, 10, 44154, 30],+ [2090, 11, 44184, 30],+ [2090, 12, 44214, 29],+ [2091, 1, 44243, 30],+ [2091, 2, 44273, 30],+ [2091, 3, 44303, 29],+ [2091, 4, 44332, 30],+ [2091, 5, 44362, 29],+ [2091, 6, 44391, 30],+ [2091, 7, 44421, 29],+ [2091, 8, 44450, 30],+ [2091, 9, 44480, 29],+ [2091, 10, 44509, 29],+ [2091, 11, 44538, 30],+ [2091, 12, 44568, 29],+ [2092, 1, 44597, 30],+ [2092, 2, 44627, 30],+ [2092, 3, 44657, 29],+ [2092, 4, 44686, 30],+ [2092, 5, 44716, 30],+ [2092, 6, 44746, 29],+ [2092, 7, 44775, 30],+ [2092, 8, 44805, 29],+ [2092, 9, 44834, 30],+ [2092, 10, 44864, 29],+ [2092, 11, 44893, 30],+ [2092, 12, 44923, 29],+ [2093, 1, 44952, 29],+ [2093, 2, 44981, 30],+ [2093, 3, 45011, 30],+ [2093, 4, 45041, 29],+ [2093, 5, 45070, 30],+ [2093, 6, 45100, 29],+ [2093, -6, 45129, 30],+ [2093, 7, 45159, 30],+ [2093, 8, 45189, 29],+ [2093, 9, 45218, 30],+ [2093, 10, 45248, 29],+ [2093, 11, 45277, 30],+ [2093, 12, 45307, 29],+ [2094, 1, 45336, 29],+ [2094, 2, 45365, 30],+ [2094, 3, 45395, 29],+ [2094, 4, 45424, 30],+ [2094, 5, 45454, 29],+ [2094, 6, 45483, 30],+ [2094, 7, 45513, 30],+ [2094, 8, 45543, 29],+ [2094, 9, 45572, 30],+ [2094, 10, 45602, 30],+ [2094, 11, 45632, 29],+ [2094, 12, 45661, 30],+ [2095, 1, 45691, 29],+ [2095, 2, 45720, 30],+ [2095, 3, 45750, 29],+ [2095, 4, 45779, 29],+ [2095, 5, 45808, 30],+ [2095, 6, 45838, 29],+ [2095, 7, 45867, 30],+ [2095, 8, 45897, 29],+ [2095, 9, 45926, 30],+ [2095, 10, 45956, 30],+ [2095, 11, 45986, 30],+ [2095, 12, 46016, 29],+ [2096, 1, 46045, 30],+ [2096, 2, 46075, 29],+ [2096, 3, 46104, 30],+ [2096, 4, 46134, 29],+ [2096, -4, 46163, 29],+ [2096, 5, 46192, 30],+ [2096, 6, 46222, 29],+ [2096, 7, 46251, 29],+ [2096, 8, 46280, 30],+ [2096, 9, 46310, 30],+ [2096, 10, 46340, 30],+ [2096, 11, 46370, 29],+ [2096, 12, 46399, 30],+ [2097, 1, 46429, 30],+ [2097, 2, 46459, 29],+ [2097, 3, 46488, 30],+ [2097, 4, 46518, 29],+ [2097, 5, 46547, 29],+ [2097, 6, 46576, 29],+ [2097, 7, 46605, 30],+ [2097, 8, 46635, 29],+ [2097, 9, 46664, 30],+ [2097, 10, 46694, 30],+ [2097, 11, 46724, 29],+ [2097, 12, 46753, 30],+ [2098, 1, 46783, 30],+ [2098, 2, 46813, 30],+ [2098, 3, 46843, 29],+ [2098, 4, 46872, 30],+ [2098, 5, 46902, 29],+ [2098, 6, 46931, 29],+ [2098, 7, 46960, 29],+ [2098, 8, 46989, 30],+ [2098, 9, 47019, 29],+ [2098, 10, 47048, 30],+ [2098, 11, 47078, 29],+ [2098, 12, 47107, 30],+ [2099, 1, 47137, 30],+ [2099, 2, 47167, 30],+ [2099, -2, 47197, 29],+ [2099, 3, 47226, 30],+ [2099, 4, 47256, 30],+ [2099, 5, 47286, 29],+ [2099, 6, 47315, 29],+ [2099, 7, 47344, 30],+ [2099, 8, 47374, 29],+ [2099, 9, 47403, 29],+ [2099, 10, 47432, 30],+ [2099, 11, 47462, 29],+ [2099, 12, 47491, 30],+ [2100, 1, 47521, 30],+ [2100, 2, 47551, 30],+ [2100, 3, 47581, 29],+ [2100, 4, 47610, 30],+ [2100, 5, 47640, 29],+ [2100, 6, 47669, 30],+ [2100, 7, 47699, 29],+ [2100, 8, 47728, 30],+ [2100, 9, 47758, 29],+ [2100, 10, 47787, 29],+ [2100, 11, 47816, 30],+ [2100, 12, 47846, 1]+ ]+}diff --git a/kernel/av/lunar_calendar_test.go b/kernel/av/lunar_calendar_test.gonew file mode 100644index 0000000000..a10a516597--- /dev/null+++ b/kernel/av/lunar_calendar_test.go@@ -0,0 +1,118 @@+package av++import (+ "encoding/json"+ "os"+ "path/filepath"+ "testing"+ "time"++ "github.com/siyuan-note/siyuan/kernel/util"+)++func setLunarTestLanguage(t *testing.T, language string) {+ t.Helper()+ beforeLang, beforeTerms := util.Lang, util.AttrViewLangs+ data, err := os.ReadFile(filepath.Join("../../app/appearance/langs", language+".json"))+ if err != nil {+ t.Fatal(err)+ }+ var terms struct {+ AV map[string]any `json:"_attrView"`+ }+ if err = json.Unmarshal(data, &terms); err != nil {+ t.Fatal(err)+ }+ util.Lang, util.AttrViewLangs = language, map[string]map[string]any{language: terms.AV}+ t.Cleanup(func() { util.Lang, util.AttrViewLangs = beforeLang, beforeTerms })+}++func TestLunarCalendarCoverage(t *testing.T) {+ for index, month := range lunarCalendar.Months {+ if month[0] < 1901 || month[0] > 2100 || month[1] == 0 || month[1] < -12 || month[1] > 12 {+ t.Fatalf("invalid month: %v", month)+ }+ if index+1 < len(lunarCalendar.Months) {+ if month[3] != 29 && month[3] != 30 || month[2]+month[3] != lunarCalendar.Months[index+1][2] {+ t.Fatalf("month continuity: %v", month)+ }+ }+ for day := 1; day <= month[3]; day++ {+ want := lunarDate{month[0], month[1], day}+ solar, ok := lunarToSolar(want, time.UTC)+ if !ok {+ t.Fatalf("cannot convert %v", want)+ }+ if got, ok := solarToLunar(solar); !ok || got != want {+ t.Fatalf("round trip %v: %v", want, got)+ }+ }+ }+ for _, date := range []time.Time{time.Date(1901, 2, 18, 0, 0, 0, 0, time.UTC), time.Date(2101, 1, 1, 0, 0, 0, 0, time.UTC)} {+ if _, ok := solarToLunar(date); ok {+ t.Fatalf("out-of-range date accepted: %v", date)+ }+ }+ for _, date := range []lunarDate{{2026, -6, 1}, {2025, -6, 30}, {2025, 1, 31}, {2100, 12, 2}, {1900, 1, 1}} {+ if _, ok := lunarToSolar(date, time.UTC); ok {+ t.Fatalf("invalid lunar date accepted: %v", date)+ }+ }+}++func TestLunarCalendarKnownDates(t *testing.T) {+ for _, test := range []struct {+ solar string+ lunar lunarDate+ }{+ {"1901-02-19", lunarDate{1901, 1, 1}},+ {"1986-05-29", lunarDate{1986, 4, 21}},+ {"2025-07-25", lunarDate{2025, -6, 1}},+ {"2026-09-25", lunarDate{2026, 8, 15}},+ {"2033-12-22", lunarDate{2033, -11, 1}},+ {"2100-12-31", lunarDate{2100, 12, 1}},+ } {+ for _, offset := range []int{-7 * 3600, 8 * 3600} {+ location := time.FixedZone("test", offset)+ solar, err := time.ParseInLocation("2006-01-02", test.solar, location)+ if err != nil {+ t.Fatal(err)+ }+ if got, ok := solarToLunar(solar); !ok || got != test.lunar {+ t.Fatalf("%s: got %v, want %v", test.solar, got, test.lunar)+ }+ }+ }+}++func TestLunarDateLocalizedRoundTrips(t *testing.T) {+ files, err := filepath.Glob("../../app/appearance/langs/*.json")+ if err != nil {+ t.Fatal(err)+ }+ for _, path := range files {+ language := filepath.Base(path)+ language = language[:len(language)-5]+ t.Run(language, func(t *testing.T) {+ setLunarTestLanguage(t, language)+ parser := newCalendarTemplateDateParser(DateDisplayFormatLunar)+ for _, lunar := range []lunarDate{{2025, 6, 1}, {2025, -6, 1}, {2026, 8, 15}} {+ date, ok := lunarToSolar(lunar, time.Local)+ if !ok {+ t.Fatal(lunar)+ }+ date = date.Add(14*time.Hour + 7*time.Minute)+ text := formatDateDisplay(date.UnixMilli(), DateDisplayFormatLunar, false)+ got := parser(text, time.Local)+ if got == nil || got.Content != date.UnixMilli() {+ t.Fatalf("localized round trip: %q, %+v", text, got)+ }+ }+ original := time.Date(1800, 1, 2, 14, 7, 0, 0, time.Local)+ text := formatDateDisplay(original.UnixMilli(), DateDisplayFormatLunar, false)+ if parsed := parser(text, time.Local); parsed == nil || parsed.Content != original.UnixMilli() {+ t.Fatalf("legacy date lost outside lunar range: %q, %+v", text, parsed)+ }+ })+ }+}diff --git a/kernel/av/value.go b/kernel/av/value.goindex 766b28eb63..c6fe6e8622 100644--- a/kernel/av/value.go+++ b/kernel/av/value.go@@ -2383,12 +2383,13 @@ const (DateDisplayFormatMonthDayYear DateDisplayFormat = "month-day-year"DateDisplayFormatDayMonthYear DateDisplayFormat = "day-month-year"DateDisplayFormatYearMonthDay DateDisplayFormat = "year-month-day"+ DateDisplayFormatLunar DateDisplayFormat = "lunar")func (format DateDisplayFormat) IsValid() bool {switch format {case DateDisplayFormatDefault, DateDisplayFormatFull, DateDisplayFormatMonthDayYear,- DateDisplayFormatDayMonthYear, DateDisplayFormatYearMonthDay:+ DateDisplayFormatDayMonthYear, DateDisplayFormatYearMonthDay, DateDisplayFormatLunar:return true}return false@@ -2398,6 +2399,12 @@ func formatDateDisplay(content int64, format DateDisplayFormat, isNotTime bool)contentTime := time.UnixMilli(content)var formatted stringswitch format {+ case DateDisplayFormatLunar:+ if lunar, ok := solarToLunar(contentTime); ok {+ formatted = formatLunarDate(lunar)+ } else {+ formatted = contentTime.Format("2006-01-02") + " (" + GetAttributeViewI18n("lunarRange") + ")"+ }case DateDisplayFormatFull:months := strings.Split(GetAttributeViewI18n("dateMonths"), "|")month := contentTime.Month().String()diff --git a/kernel/model/attribute_view.go b/kernel/model/attribute_view.goindex 5987aec6f3..c73749ef30 100644--- a/kernel/model/attribute_view.go+++ b/kernel/model/attribute_view.go@@ -7569,6 +7569,9 @@ func newAttributeViewKey(keyID, keyName, keyType, keyIcon string, dateFormat av.if !dateFormat.IsValid() {return nil, errors.New("invalid date display format")}+ if dateFormat == av.DateDisplayFormatLunar && keyTyp != av.KeyTypeDate {+ return nil, errors.New("lunar calendar is only available for date fields")+ }ret.DateFormat = dateFormat}if av.KeyTypeRollup == keyTyp {@@ -7778,6 +7781,9 @@ func setAttributeViewColDateFormat(operation *Operation) (err error) {if !av.IsDateKeyType(colType) {return errors.New("date display format is only available for date fields")}+ if format == av.DateDisplayFormatLunar && colType != av.KeyTypeDate {+ return errors.New("lunar calendar is only available for date fields")+ }for _, keyValues := range attrView.KeyValues {if keyValues.Key.ID == operation.ID && keyValues.Key.Type == colType {keyValues.Key.DateFormat = formatdiff --git a/kernel/model/attribute_view_binding_undo_sqlcipher_test.go b/kernel/model/attribute_view_binding_undo_sqlcipher_test.goindex 70e5347b87..70aa9bb968 100644--- a/kernel/model/attribute_view_binding_undo_sqlcipher_test.go+++ b/kernel/model/attribute_view_binding_undo_sqlcipher_test.go@@ -8,6 +8,7 @@ import ("os""path/filepath""testing"+ "time""github.com/88250/lute/parse""github.com/siyuan-note/siyuan/kernel/av"@@ -71,9 +72,31 @@ func TestAttributeViewBindingEncryptedReplay(t *testing.T) {}treenode.UpsertBlockTree(tree)}+ // 对已有公历日期先按支持的密文格式写入,再验证历法设置不改变时间戳或认证读写。+ lunarKey := av.NewKey("20261009120000-lunare1", "Birthday", "", av.KeyTypeDate)+ lunarKey.DateFormat = av.DateDisplayFormatFull+ lunarTimestamp := time.Date(2025, 7, 25, 14, 7, 35, 123000000, time.Local).UnixMilli()+ before.KeyValues = append(before.KeyValues, &av.KeyValues{Key: lunarKey, Values: []*av.Value{+ {ID: "20261009120000-lunare2", KeyID: lunarKey.ID, Type: av.KeyTypeDate,+ Date: &av.ValueDate{Content: lunarTimestamp, IsNotEmpty: true}},+ }})if err := av.SaveAttributeView(before); err != nil {t.Fatal(err)}+ for _, format := range []av.DateDisplayFormat{av.DateDisplayFormatLunar, av.DateDisplayFormatFull} {+ if err = setAttributeViewColDateFormat(&Operation{AvID: before.ID, ID: lunarKey.ID, Typ: "date", Format: string(format)}); err != nil {+ t.Fatal(err)+ }+ cache.ClearAVCache()+ stored, readErr := av.ParseAttributeView(before.ID)+ if readErr != nil {+ t.Fatal(readErr)+ }+ field := stored.KeyValues[len(stored.KeyValues)-1]+ if field.Key.DateFormat != format || field.Values[0].Date.Content != lunarTimestamp {+ t.Fatal("encrypted calendar switch changed the stored date")+ }+ }key := before.KeyValues[2].Keyif err := setAttrViewColAttributePanelVisibility(&Operation{AvID: before.ID, ID: key.ID, Data: "hide"}); err != nil {t.Fatal(err)@@ -125,6 +148,9 @@ func TestAttributeViewBindingEncryptedReplay(t *testing.T) {if err = setAttrViewColAttributePanelVisibility(&Operation{AvID: before.ID, ID: key.ID, Data: "always"}); err == nil {t.Fatal("field visibility accepted inaccessible encrypted data")}+ if err = setAttributeViewColDateFormat(&Operation{AvID: before.ID, ID: lunarKey.ID, Typ: "date", Format: "lunar"}); err == nil {+ t.Fatal("calendar setting accepted inaccessible encrypted data")+ }if err = PerformTxSync(&Transaction{DoOperations: cloneOperations(tx.UndoOperations), isReplay: true}); err == nil {t.Fatal("binding replay accepted inaccessible encrypted data")}diff --git a/kernel/model/attribute_view_lunar_test.go b/kernel/model/attribute_view_lunar_test.gonew file mode 100644index 0000000000..c3c1758584--- /dev/null+++ b/kernel/model/attribute_view_lunar_test.go@@ -0,0 +1,43 @@+package model++import (+ "reflect"+ "testing"+ "time"++ "github.com/siyuan-note/siyuan/kernel/av"+ "github.com/siyuan-note/siyuan/kernel/cache"+)++func TestAttributeViewLunarFieldPreservesLegacyDates(t *testing.T) {+ setupAttributeViewValidationTest(t)+ attrView := av.NewAttributeView("20261009120000-lunart1")+ key := av.NewKey("20261009120000-lunark1", "Birthday", "", av.KeyTypeDate)+ key.DateFormat = av.DateDisplayFormatFull+ values := []*av.Value{+ {ID: "20261009120000-lunarv1", KeyID: key.ID, Type: av.KeyTypeDate, Date: &av.ValueDate{+ Content: time.Date(2025, 7, 25, 14, 7, 35, 123000000, time.Local).UnixMilli(), IsNotEmpty: true,+ Content2: time.Date(2025, 7, 26, 15, 8, 45, 456000000, time.Local).UnixMilli(), IsNotEmpty2: true, HasEndDate: true}},+ {ID: "20261009120000-lunarv2", KeyID: key.ID, Type: av.KeyTypeDate, Date: &av.ValueDate{+ Content: time.Date(1800, 1, 2, 0, 0, 0, 0, time.Local).UnixMilli(), IsNotEmpty: true, IsNotTime: true}},+ {ID: "20261009120000-lunarv3", KeyID: key.ID, Type: av.KeyTypeDate, Date: &av.ValueDate{IsNotTime: true}},+ }+ attrView.KeyValues = append(attrView.KeyValues, &av.KeyValues{Key: key, Values: values})+ if err := av.SaveAttributeView(attrView); err != nil {+ t.Fatal(err)+ }+ for _, format := range []av.DateDisplayFormat{av.DateDisplayFormatLunar, av.DateDisplayFormatFull} {+ if err := setAttributeViewColDateFormat(&Operation{AvID: attrView.ID, ID: key.ID, Typ: "date", Format: string(format)}); err != nil {+ t.Fatal(err)+ }+ cache.ClearAVCache()+ stored, err := av.ParseAttributeView(attrView.ID)+ if err != nil {+ t.Fatal(err)+ }+ actual := stored.KeyValues[len(stored.KeyValues)-1]+ if actual.Key.DateFormat != format || !reflect.DeepEqual(actual.Values, values) {+ t.Fatalf("calendar switch changed legacy values: %+v", actual)+ }+ }+}diff --git a/scripts/generate-lunar-calendar.py b/scripts/generate-lunar-calendar.pynew file mode 100644index 0000000000..57f0123df8--- /dev/null+++ b/scripts/generate-lunar-calendar.py@@ -0,0 +1,90 @@+"""从香港天文台逐年对照表生成前后端共用的离线农历数据。"""++from concurrent.futures import ThreadPoolExecutor+from datetime import date, timedelta+import json+from pathlib import Path+import re+import tempfile+import urllib.request+++SOURCE = "https://www.hko.gov.hk/en/gts/time/calendar/text/files/T{}e.txt"+FIRST_YEAR = 1901+LAST_YEAR = 2100+EPOCH = date(1970, 1, 1)+CACHE = Path(tempfile.gettempdir()) / "siyuan-lunar-calendar-source"+CACHE.mkdir(exist_ok=True)+++def read_year(year):+ cached = CACHE / (str(year) + ".txt")+ if not cached.exists():+ request = urllib.request.Request(SOURCE.format(year), headers={"User-Agent": "SiYuan-Coding-Agent"})+ with urllib.request.urlopen(request, timeout=60) as response:+ cached.write_bytes(response.read())+ rows = []+ # 旧年份文件使用传统编码;表中日期、月份及星期均为 ASCII。+ for line in cached.read_text(encoding="latin-1").splitlines():+ match = re.match(r"^(\d{4})/(\d{1,2})/(\d{1,2})\s+(.+?)\s{2,}", line)+ if match:+ solar = date(*map(int, match.group(1, 2, 3)))+ rows.append((solar, match.group(4)))+ # 2069 年文本省略了 12 月 30 日;只补齐相邻公历日与农历日同时连续的月内缺行。+ complete = []+ for solar, lunar in rows:+ if complete:+ previous, previous_lunar = complete[-1]+ gap = (solar - previous).days+ if gap > 1:+ if not previous_lunar.isdigit() or not lunar.isdigit() or int(lunar) - int(previous_lunar) != gap:+ raise ValueError("Unverifiable source gap: " + str(solar))+ for offset in range(1, gap):+ complete.append((previous + timedelta(days=offset), str(int(previous_lunar) + offset)))+ complete.append((solar, lunar))+ rows = complete+ expected = (date(year + 1, 1, 1) - date(year, 1, 1)).days+ if len(rows) != expected or any((rows[i][0] - rows[i - 1][0]).days != 1 for i in range(1, len(rows))):+ raise ValueError("Incomplete source year: " + str(year) + "; rows=" + str(len(rows)) + "; path=" + str(cached))+ return rows+++def main():+ months = []+ lunar_year = FIRST_YEAR - 1+ previous_month = 0+ with ThreadPoolExecutor(max_workers=6) as pool:+ for rows in pool.map(read_year, range(FIRST_YEAR, LAST_YEAR + 1)):+ for solar, lunar in rows:+ match = re.match(r"(\d+)(?:st|nd|rd|th) Lunar Month", lunar, re.IGNORECASE)+ if not match:+ continue+ month = int(match.group(1))+ leap = month == previous_month+ if month == 1 and not leap:+ lunar_year += 1+ previous_month = month+ if lunar_year < FIRST_YEAR:+ continue+ start = (solar - EPOCH).days+ if months:+ months[-1][3] = start - months[-1][2]+ if months[-1][3] not in (29, 30):+ raise ValueError("Invalid lunar month: " + str(months[-1]))+ months.append([lunar_year, -month if leap else month, start, 0])+ # 最后一个月只开放官方对照表已经覆盖的日期,不推算表外数据。+ end = (date(LAST_YEAR + 1, 1, 1) - EPOCH).days+ months[-1][3] = end - months[-1][2]+ if months[0][:2] != [FIRST_YEAR, 1] or months[-1][0] != LAST_YEAR:+ raise ValueError("Unexpected calendar coverage: " + str(months[0]) + " to " + str(months[-1]))+ output = Path(__file__).resolve().parents[1] / "kernel" / "av" / "lunar_calendar_data.json"+ data = {"source": SOURCE, "firstYear": FIRST_YEAR, "lastYear": LAST_YEAR, "months": months}+ # 每个农历月一行,便于审查来源更新与覆盖边界。+ text = json.dumps(data, ensure_ascii=False, indent=2)+ text = re.sub(r"\[\n\s+(\d+),\n\s+(-?\d+),\n\s+(-?\d+),\n\s+(\d+)\n\s+\]", r"[\1, \2, \3, \4]", text)+ output.write_text(text + "\n", encoding="utf-8")+ print("Generated", len(months), "months; boundaries:", months[0], months[-1])+++if __name__ == "__main__":+ main()