GingerCal 1.3: month view, Galician interface, Nginx Proxy Manager bridge option

This commit is contained in:
xocko committed 2026-10-15 17:42:46 +02:00
1 parent f44ecf4871
commit 42c3d6da91
39 files changed
+1409 -220

No files matched your search

+14
View File
@@ -157,6 +157,20 @@ public class CoreTest {
for (Ev e : fe) { if (e.title.equals("Standup")) fs++; if (e.title.equals("Standup (moved)")) fm++; }
check(fs == 4 && fm == 1, "client-side RRULE/EXDATE/override expansion (" + fs + "+" + fm + ")");
// --- which days an event shows on in the month grid
long d0m = ICal.startOfDay(now), d1m = ICal.addDays(d0m, 1), d2m = ICal.addDays(d0m, 2);
check(ICal.onDay(d0m + 10 * ICal.HOUR, d0m + 11 * ICal.HOUR, d0m) && !ICal.onDay(d0m + 10 * ICal.HOUR, d0m + 11 * ICal.HOUR, d1m), "timed event on its day only");
check(ICal.onDay(d0m, d2m, d0m) && ICal.onDay(d0m, d2m, d1m) && !ICal.onDay(d0m, d2m, d2m), "2-day all-day spans exactly 2 days");
check(ICal.onDay(d0m + 22 * ICal.HOUR, d1m, d0m) && !ICal.onDay(d0m + 22 * ICal.HOUR, d1m, d1m), "ending at midnight stays on first day");
check(ICal.onDay(d0m + 23 * ICal.HOUR, d1m + 2 * ICal.HOUR, d1m), "overnight event shows on both days");
check(ICal.onDay(d1m, d1m, d1m) && !ICal.onDay(d1m, d1m, d0m), "zero-length event at midnight on its day");
java.util.TimeZone saved = java.util.TimeZone.getDefault();
java.util.TimeZone.setDefault(java.util.TimeZone.getTimeZone("Europe/Madrid"));
java.util.Calendar dst = java.util.Calendar.getInstance(); dst.clear(); dst.set(2026, 9, 25); // 25 h day
long dstDay = dst.getTimeInMillis(), dstNext = ICal.addDays(dstDay, 1);
check(dstNext - dstDay == 25 * ICal.HOUR && ICal.onDay(dstDay + 24 * ICal.HOUR, dstDay + 24 * ICal.HOUR + 1, dstDay), "DST-end day is 25 h long and handled");
java.util.TimeZone.setDefault(saved);
// --- folding
String longLine = ICal.fold("DESCRIPTION:" + "ñ".repeat(60));
boolean okFold = true;
+55
View File
@@ -0,0 +1,55 @@
package org.gingercal;
import java.util.Calendar;
import java.util.TimeZone;
/** Galician output: date names, month titles, first weekday, formatted and server messages. */
public class I18nTest {
static int fails;
static void check(String got, String want) {
boolean ok = got.equals(want);
System.out.println((ok ? " ok " : " FAIL ") + got + (ok ? "" : " (want: " + want + ")"));
if (!ok) fails++;
}
public static void main(String[] a) throws Exception {
TimeZone.setDefault(TimeZone.getTimeZone("Europe/Madrid"));
Calendar c = Calendar.getInstance();
c.clear();
c.set(2026, Calendar.OCTOBER, 15, 9, 30);
long t = c.getTimeInMillis();
L.gl = true;
check(L.df("EEE d MMM").format(c.getTime()), "xov 15 out");
check(L.df("EEEE d 'de' MMMM").format(c.getTime()), "xoves 15 de outubro");
check(L.monthTitle(t), "Outubro de 2026");
c.set(Calendar.MONTH, Calendar.JUNE);
check(L.monthTitle(c.getTimeInMillis()), "Xuño de 2026");
check(String.valueOf(L.firstDayOfWeek() == Calendar.MONDAY), "true");
check(L.f("Today · %s", "xov 15 out"), "Hoxe · xov 15 out");
check(L.f("%d min before", 15), "15 min antes");
check(L.f("Every %d hours", 3), "Cada 3 horas");
Syncer.Result r = new Syncer.Result();
r.calendars = 2;
r.fetched = 1;
r.events = 7;
r.skipped = 1;
check(r.summary(), "Calendarios: 2, actualizados: 1 (eventos: 7), sen cambios: 1");
check(new DavException.UntrustedCert("AA", "s", "i", "e", false).getMessage(),
"Este teléfono non confía no certificado do servidor");
try {
Dav.checkRedirect("http://192.168.1.20/remote.php/dav/", "https://nxc.anosanube.ovh/remote.php/dav/",
new java.util.ArrayList<String>(), 301);
} catch (DavException e) {
check(e.getMessage().substring(0, 58), "O servidor redirixiu http:// a https://nxc.anosanube.ovh (");
}
check(L.t("not in the table"), "not in the table"); // unknown text falls back to English
L.gl = false;
check(L.monthTitle(t), "October 2026");
check(r.summary(), "2 calendars: 1 refreshed (7 events), 1 unchanged");
System.out.println(fails == 0 ? "ALL PASSED" : fails + " FAILED");
System.exit(fails == 0 ? 0 : 1);
}
}