diff --git a/.dashboard.json b/.dashboard.json index d937de7..8db0997 100644 --- a/.dashboard.json +++ b/.dashboard.json @@ -1,12 +1,14 @@ { - "status": "done", + "status": "archived", "priority": "medium", "notes": "", + "description": "", "tags": [], "tasks": [], "thumbnail": "", "start": "", - "program": "", + "program": "publish\\ReminderOrganizer.exe", "itch": "", - "updatedAt": "2026-11-11T09:23:52.594Z" + "favorite": false, + "updatedAt": "2026-11-25T19:31:06.667Z" } \ No newline at end of file diff --git a/Core/BirthdayInput.cs b/Core/BirthdayInput.cs new file mode 100644 index 0000000..485ade5 --- /dev/null +++ b/Core/BirthdayInput.cs @@ -0,0 +1,49 @@ +#nullable enable +using System; +using System.Globalization; +using System.Text.RegularExpressions; + +namespace ReminderOrganizer.Core +{ + /// Parses quick birthday input: "19.3", "19.03.", "19.03.1986", "19.3.86", "1986-03-19". + public static class BirthdayInput + { + private static readonly Regex DayMonthYear = new(@"^\s*(\d{1,2})\s*[./\-\s]\s*(\d{1,2})\s*\.?\s*(?:[./\-\s]?\s*(\d{2}|\d{4}))?\s*$"); + private static readonly Regex Iso = new(@"^\s*(\d{4})-(\d{1,2})-(\d{1,2})\s*$"); + + public static bool TryParse(string? text, DateTime today, out int day, out int month, out int? year) + { + day = month = 0; + year = null; + if (string.IsNullOrWhiteSpace(text)) return false; + + var m = Iso.Match(text); + if (m.Success) + { + year = int.Parse(m.Groups[1].Value, CultureInfo.InvariantCulture); + month = int.Parse(m.Groups[2].Value, CultureInfo.InvariantCulture); + day = int.Parse(m.Groups[3].Value, CultureInfo.InvariantCulture); + } + else + { + m = DayMonthYear.Match(text); + if (!m.Success) return false; + day = int.Parse(m.Groups[1].Value, CultureInfo.InvariantCulture); + month = int.Parse(m.Groups[2].Value, CultureInfo.InvariantCulture); + if (m.Groups[3].Success) + { + int y = int.Parse(m.Groups[3].Value, CultureInfo.InvariantCulture); + if (m.Groups[3].Value.Length == 2) + y += y > today.Year % 100 ? 1900 : 2000; // "86" → 1986, "05" → 2005 + year = y; + } + } + + if (month < 1 || month > 12) return false; + if (day < 1 || day > DateTime.DaysInMonth(2000, month)) return false; // 2000: leap year, allows 29.02. + if (year is int yy && (yy < 1900 || yy > today.Year)) return false; + if (year is int y2 && day > DateTime.DaysInMonth(y2, month)) return false; + return true; + } + } +} diff --git a/Locales/de.json b/Locales/de.json index cad038e..d7e2192 100644 --- a/Locales/de.json +++ b/Locales/de.json @@ -121,5 +121,21 @@ "BucketTomorrow": "MORGEN", "BucketThisWeek": "NÄCHSTE 7 TAGE", "BucketLater": "SPÄTER", - "BucketDone": "ERLEDIGT" + "BucketDone": "ERLEDIGT", + "TypeAppointment": "Termin", + "TypeBirthday": "Geburtstag", + "BirthdayDate": "Geburtstag", + "BirthdayHint": "z. B. 19.03. oder 19.03.1986 – das Jahr ist optional", + "BirthdayInvalid": "Datum nicht erkannt – bitte TT.MM. oder TT.MM.JJJJ", + "Note": "Notiz", + "NewBirthday": "Neuer Geburtstag", + "EditBirthday": "Geburtstag bearbeiten", + "RelToday": "heute", + "RelTomorrow": "morgen", + "RelYesterday": "gestern", + "RelInDays": "in {0} Tagen", + "RelDaysAgo": "vor {0} Tagen", + "ViewList": "Liste", + "ViewCompact": "Kompakt", + "ViewCards": "Kacheln" } diff --git a/Locales/en.json b/Locales/en.json index c17ce9e..3f0764c 100644 --- a/Locales/en.json +++ b/Locales/en.json @@ -121,5 +121,21 @@ "BucketTomorrow": "TOMORROW", "BucketThisWeek": "NEXT 7 DAYS", "BucketLater": "LATER", - "BucketDone": "DONE" + "BucketDone": "DONE", + "TypeAppointment": "Appointment", + "TypeBirthday": "Birthday", + "BirthdayDate": "Date of birth", + "BirthdayHint": "e.g. 19.03. or 19.03.1986 – the year is optional", + "BirthdayInvalid": "Date not recognized – please use DD.MM. or DD.MM.YYYY", + "Note": "Note", + "NewBirthday": "New birthday", + "EditBirthday": "Edit birthday", + "RelToday": "today", + "RelTomorrow": "tomorrow", + "RelYesterday": "yesterday", + "RelInDays": "in {0} days", + "RelDaysAgo": "{0} days ago", + "ViewList": "List", + "ViewCompact": "Compact", + "ViewCards": "Cards" } diff --git a/MainWindow.xaml b/MainWindow.xaml index ecbd5dd..5d78171 100644 --- a/MainWindow.xaml +++ b/MainWindow.xaml @@ -1,4 +1,4 @@ - M1.5,3.5 L6,3.5 L7.5,5 L14.5,5 L14.5,13.5 L1.5,13.5 Z + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -799,145 +1154,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + diff --git a/Models/ReminderModels.cs b/Models/ReminderModels.cs index a2af0c8..128705e 100644 --- a/Models/ReminderModels.cs +++ b/Models/ReminderModels.cs @@ -1,6 +1,7 @@ -#nullable enable +#nullable enable using System; using System.Collections.ObjectModel; +using System.Globalization; using ReminderOrganizer.Core; namespace ReminderOrganizer.Models @@ -36,13 +37,13 @@ namespace ReminderOrganizer.Models public DateTime ReminderDate { get => _reminderDate; - set { if (SetProperty(ref _reminderDate, value)) OnPropertyChanged(nameof(AgeText)); } + set { if (SetProperty(ref _reminderDate, value)) RaiseDisplay(); } } public bool IsNotified { get => _isNotified; - set => SetProperty(ref _isNotified, value); + set { if (SetProperty(ref _isNotified, value)) OnPropertyChanged(nameof(RelativeDate)); } } public bool IsRecurring @@ -93,6 +94,59 @@ namespace ReminderOrganizer.Models [System.Text.Json.Serialization.JsonIgnore] public string? AgeText => UpcomingAge is int a ? (AgeFormatter?.Invoke(a) ?? a.ToString()) : null; + private bool _isBirthday; + /// Birthday: yearly, date only (no time shown), reminded at . + public bool IsBirthday + { + get => _isBirthday; + set { if (SetProperty(ref _isBirthday, value)) RaiseDisplay(); } + } + + public const int BirthdayHour = 9; + + /// Set once by the app: culture for month names, relative-date formatter. + public static Func? DisplayCulture { get; set; } + public static Func? RelativeFormatter { get; set; } + + /// "19. März" for birthdays, otherwise "19.03.2027 09:00". + [System.Text.Json.Serialization.JsonIgnore] + public string DisplayDate => IsBirthday + ? ReminderDate.ToString(DayMonthPattern(DisplayCulture?.Invoke() ?? CultureInfo.CurrentCulture), DisplayCulture?.Invoke() ?? CultureInfo.CurrentCulture) + : ReminderDate.ToString("dd.MM.yyyy HH:mm", CultureInfo.InvariantCulture); + + /// "heute", "morgen", "in 5 Tagen", "vor 2 Tagen". + [System.Text.Json.Serialization.JsonIgnore] + public string RelativeDate => IsNotified ? "" : RelativeFormatter?.Invoke(ReminderDate, DateTime.Now) ?? ""; + + [System.Text.Json.Serialization.JsonIgnore] + public int DaysUntil => (ReminderDate.Date - DateTime.Today).Days; + + /// Day number + short month for the card view. + [System.Text.Json.Serialization.JsonIgnore] + public string DayText => ReminderDate.Day.ToString(CultureInfo.InvariantCulture); + [System.Text.Json.Serialization.JsonIgnore] + public string MonthText => ReminderDate.ToString("MMM", DisplayCulture?.Invoke() ?? CultureInfo.CurrentCulture).TrimEnd('.').ToUpperInvariant(); + + public static string DayMonthPattern(CultureInfo c) => c.TwoLetterISOLanguageName == "de" ? "d. MMMM" : "MMMM d"; + + private void RaiseDisplay() + { + OnPropertyChanged(nameof(DisplayDate)); + OnPropertyChanged(nameof(RelativeDate)); + OnPropertyChanged(nameof(DaysUntil)); + OnPropertyChanged(nameof(DayText)); + OnPropertyChanged(nameof(MonthText)); + OnPropertyChanged(nameof(AgeText)); + } + + /// Next birthday on/after at BirthdayHour (29 Feb → 28 Feb in other years). + public static DateTime NextBirthday(int day, int month, DateTime today) + { + DateTime For(int year) => new(year, month, Math.Min(day, DateTime.DaysInMonth(year, month)), BirthdayHour, 0, 0); + var d = For(today.Year); + return d.Date >= today.Date ? d : For(today.Year + 1); + } + private string _folderName = ""; /// Runtime only: name of the folder holding this task (for the "Upcoming" view). [System.Text.Json.Serialization.JsonIgnore] @@ -242,5 +296,33 @@ namespace ReminderOrganizer.Models public bool? IsDarkMode { get; set; } public bool PlaySound { get; set; } = true; public bool HideDone { get; set; } + /// "list", "compact" or "cards". + public string ViewMode { get; set; } = "list"; + /// Folders and yearly tasks were checked for birthdays once. + public bool BirthdaysMigrated { get; set; } + + public static bool LooksLikeBirthdayFolder(string? name) => + name != null && (name.Contains("geburtstag", StringComparison.OrdinalIgnoreCase) || + name.Contains("birthday", StringComparison.OrdinalIgnoreCase)); + + /// Yearly tasks in a "Geburtstage"/"Birthdays" folder become birthday entries (one-time). + public int MigrateBirthdays() + { + if (BirthdaysMigrated) return 0; + BirthdaysMigrated = true; + int n = 0; + foreach (var f in Folders) + { + if (!LooksLikeBirthdayFolder(f.Name)) continue; + foreach (var t in f.Tasks) + { + if (t.IsBirthday || !t.IsRecurring || t.RecurrenceType != RecurrenceType.Yearly) continue; + t.IsBirthday = true; + n++; + } + } + return n; + } } } + diff --git a/Services/IcsExport.cs b/Services/IcsExport.cs index 62c6a81..9e3223c 100644 --- a/Services/IcsExport.cs +++ b/Services/IcsExport.cs @@ -28,9 +28,17 @@ namespace ReminderOrganizer.Services Line("BEGIN:VEVENT"); Line($"UID:{t.Id}@reminder-organizer"); Line($"DTSTAMP:{stamp}"); - // floating local time: shows at the same clock time in every calendar - Line($"DTSTART:{t.ReminderDate.ToString("yyyyMMdd'T'HHmmss", CultureInfo.InvariantCulture)}"); - Line("DURATION:PT30M"); + if (t.IsBirthday) + { + // all-day event + Line($"DTSTART;VALUE=DATE:{t.ReminderDate.ToString("yyyyMMdd", CultureInfo.InvariantCulture)}"); + } + else + { + // floating local time: shows at the same clock time in every calendar + Line($"DTSTART:{t.ReminderDate.ToString("yyyyMMdd'T'HHmmss", CultureInfo.InvariantCulture)}"); + Line("DURATION:PT30M"); + } var summary = t.UpcomingAge is int age ? $"{t.Name} ({age})" : t.Name; Line($"SUMMARY:{Escape(summary)}"); if (!string.IsNullOrWhiteSpace(t.Description)) Line($"DESCRIPTION:{Escape(t.Description)}"); @@ -49,7 +57,10 @@ namespace ReminderOrganizer.Services Line("BEGIN:VALARM"); Line("ACTION:DISPLAY"); Line($"DESCRIPTION:{Escape(t.Name)}"); - Line(t.LeadDays > 0 ? $"TRIGGER:-P{t.LeadDays}D" : "TRIGGER:PT0M"); + // all-day events start at midnight: remind at 09:00 (same day or lead days before) + Line(t.IsBirthday + ? (t.LeadDays > 0 ? $"TRIGGER:-P{t.LeadDays - 1}DT15H" : "TRIGGER:PT9H") + : (t.LeadDays > 0 ? $"TRIGGER:-P{t.LeadDays}D" : "TRIGGER:PT0M")); Line("END:VALARM"); Line("END:VEVENT"); } diff --git a/TaskWindow.xaml b/TaskWindow.xaml index c13b18e..520f4fd 100644 --- a/TaskWindow.xaml +++ b/TaskWindow.xaml @@ -1,4 +1,4 @@ - + + + + + + + + + @@ -181,14 +238,6 @@ - - - - - - diff --git a/TaskWindow.xaml.cs b/TaskWindow.xaml.cs index ead66a1..dc98509 100644 --- a/TaskWindow.xaml.cs +++ b/TaskWindow.xaml.cs @@ -14,13 +14,13 @@ namespace ReminderOrganizer public ReminderTask TaskResult => _viewModel.TaskResult; - public TaskWindow(ReminderTask? existingTask, bool darkMode) + public TaskWindow(ReminderTask? existingTask, bool darkMode, bool defaultBirthday = false) { InitializeComponent(); Theme.Apply(Resources, darkMode); var localizationService = (ILocalizationService)ServiceLocator.Services.GetService(typeof(ILocalizationService))!; - _viewModel = new TaskViewModel(localizationService, existingTask); + _viewModel = new TaskViewModel(localizationService, existingTask, defaultBirthday); _viewModel.RequestClose += OnRequestClose; DataContext = _viewModel; diff --git a/Tests/BirthdayTests.cs b/Tests/BirthdayTests.cs new file mode 100644 index 0000000..346ac77 --- /dev/null +++ b/Tests/BirthdayTests.cs @@ -0,0 +1,98 @@ +using System; +using ReminderOrganizer.Core; +using ReminderOrganizer.Models; +using ReminderOrganizer.Services; +using Xunit; + +namespace ReminderOrganizer.Tests +{ + public class BirthdayTests + { + private static readonly DateTime Today = new(2026, 11, 29); + + [Theory] + [InlineData("19.03.", 19, 3, null)] + [InlineData("19.3", 19, 3, null)] + [InlineData("19.03.1986", 19, 3, 1986)] + [InlineData("19.3.86", 19, 3, 1986)] + [InlineData("1.1.05", 1, 1, 2005)] + [InlineData("1986-03-19", 19, 3, 1986)] + [InlineData(" 29.02. ", 29, 2, null)] + public void Parses_quick_input(string input, int day, int month, int? year) + { + Assert.True(BirthdayInput.TryParse(input, Today, out var d, out var m, out var y)); + Assert.Equal((day, month, year), (d, m, y)); + } + + [Theory] + [InlineData("")] + [InlineData("32.01.")] + [InlineData("10.13.")] + [InlineData("29.02.2023")] // not a leap year + [InlineData("01.01.2030")] // future + [InlineData("abc")] + public void Rejects_bad_input(string input) + { + Assert.False(BirthdayInput.TryParse(input, Today, out _, out _, out _)); + } + + [Fact] + public void Next_birthday_this_year_or_next() + { + Assert.Equal(new DateTime(2026, 12, 14, 9, 0, 0), ReminderTask.NextBirthday(14, 12, Today)); + Assert.Equal(new DateTime(2027, 3, 19, 9, 0, 0), ReminderTask.NextBirthday(19, 3, Today)); + Assert.Equal(new DateTime(2026, 11, 29, 9, 0, 0), ReminderTask.NextBirthday(29, 11, Today)); // today counts + } + + [Fact] + public void Leap_day_birthday_falls_back_to_28th() + { + Assert.Equal(new DateTime(2027, 2, 28, 9, 0, 0), ReminderTask.NextBirthday(29, 2, Today)); + Assert.Equal(new DateTime(2028, 2, 29, 9, 0, 0), ReminderTask.NextBirthday(29, 2, new DateTime(2027, 3, 1))); + } + + [Fact] + public void Migration_marks_yearly_tasks_in_birthday_folders_once() + { + var data = new AppData(); + var bday = new Folder("Geburtstage"); + bday.Tasks.Add(new ReminderTask("Oma", "", new DateTime(2027, 1, 27)) { IsRecurring = true, RecurrenceType = RecurrenceType.Yearly }); + bday.Tasks.Add(new ReminderTask("Einmalig", "", new DateTime(2027, 1, 27))); + var work = new Folder("Arbeit"); + work.Tasks.Add(new ReminderTask("Jahresbericht", "", new DateTime(2027, 1, 27)) { IsRecurring = true, RecurrenceType = RecurrenceType.Yearly }); + data.Folders.Add(bday); + data.Folders.Add(work); + + Assert.Equal(1, data.MigrateBirthdays()); + Assert.True(bday.Tasks[0].IsBirthday); + Assert.False(bday.Tasks[1].IsBirthday); + Assert.False(work.Tasks[0].IsBirthday); + Assert.Equal(0, data.MigrateBirthdays()); + } + + [Fact] + public void Birthday_display_has_no_time() + { + ReminderTask.DisplayCulture = () => new System.Globalization.CultureInfo("de-DE"); + var t = new ReminderTask("x", "", new DateTime(2027, 3, 19, 9, 0, 0)) { IsBirthday = true }; + Assert.Equal("19. März", t.DisplayDate); + Assert.Equal("MÄR", t.MonthText); + t.IsBirthday = false; + Assert.Equal("19.03.2027 09:00", t.DisplayDate); + } + + [Fact] + public void Ics_birthday_is_all_day() + { + var data = new AppData(); + var f = new Folder("Geburtstage"); + f.Tasks.Add(new ReminderTask("Oma", "", new DateTime(2027, 1, 27, 9, 0, 0)) + { IsBirthday = true, IsRecurring = true, RecurrenceType = RecurrenceType.Yearly, LeadDays = 1 }); + data.Folders.Add(f); + var ics = IcsExport.Build(data, DateTime.UtcNow); + Assert.Contains("DTSTART;VALUE=DATE:20270127", ics); + Assert.DoesNotContain("DURATION", ics); + Assert.Contains("TRIGGER:-P0DT15H", ics); // 09:00 the day before + } + } +} diff --git a/ViewModels/MainViewModel.cs b/ViewModels/MainViewModel.cs index 5634ca2..955cecf 100644 --- a/ViewModels/MainViewModel.cs +++ b/ViewModels/MainViewModel.cs @@ -1,4 +1,4 @@ -#nullable enable +#nullable enable using System; using System.Collections.Generic; using System.Collections.ObjectModel; @@ -194,6 +194,40 @@ namespace ReminderOrganizer.ViewModels } } + // ---------- view mode ---------- + + public string ViewMode + { + get => _appData.ViewMode; + set + { + if (_appData.ViewMode == value) return; + _appData.ViewMode = value; + OnPropertyChanged(); + OnPropertyChanged(nameof(IsViewList)); + OnPropertyChanged(nameof(IsViewCompact)); + OnPropertyChanged(nameof(IsViewCards)); + _ = SaveAsync(); + } + } + public bool IsViewList { get => ViewMode == "list"; set { if (value) ViewMode = "list"; } } + public bool IsViewCompact { get => ViewMode == "compact"; set { if (value) ViewMode = "compact"; } } + public bool IsViewCards { get => ViewMode == "cards"; set { if (value) ViewMode = "cards"; } } + + /// "today", "tomorrow", "in 5 days", "yesterday", "3 days ago". + public string RelativeText(DateTime date, DateTime now) + { + int days = (date.Date - now.Date).Days; + return days switch + { + 0 => L("RelToday"), + 1 => L("RelTomorrow"), + -1 => L("RelYesterday"), + > 1 => string.Format(L("RelInDays"), days), + _ => string.Format(L("RelDaysAgo"), -days) + }; + } + // ---------- undo ---------- private Action? _undoAction; @@ -271,6 +305,8 @@ namespace ReminderOrganizer.ViewModels _autostartService = autostartService; ReminderTask.AgeFormatter = age => string.Format(L("TurnsAge"), age); + ReminderTask.DisplayCulture = () => new System.Globalization.CultureInfo(_localizationService.CurrentLanguage == "de" ? "de-DE" : "en-US"); + ReminderTask.RelativeFormatter = RelativeText; // Empty name = refresh every binding (all texts depend on the language). _localizationService.StringsChanged += (s, e) => @@ -326,6 +362,7 @@ namespace ReminderOrganizer.ViewModels if (firstRun) await SaveAsync(); + if (_appData.MigrateBirthdays() > 0) await SaveAsync(); _isDarkMode = _appData.IsDarkMode.Value; _appData.Folders.CollectionChanged += (s, e) => { HookFolders(); ReindexTasks(); }; HookFolders(); @@ -513,7 +550,10 @@ namespace ReminderOrganizer.ViewModels return; } - var taskWindow = new TaskWindow(null, IsDarkMode) { Owner = Application.Current.MainWindow }; + // Birthday folders (by name or because they mostly hold birthdays) open the birthday form. + bool birthday = AppData.LooksLikeBirthdayFolder(folder.Name) || + (folder.Tasks.Count > 0 && folder.Tasks.Count(t => t.IsBirthday) * 2 > folder.Tasks.Count); + var taskWindow = new TaskWindow(null, IsDarkMode, birthday) { Owner = Application.Current.MainWindow }; if (taskWindow.ShowDialog() == true) { folder.Tasks.Add(taskWindow.TaskResult); diff --git a/ViewModels/TaskViewModel.cs b/ViewModels/TaskViewModel.cs index b3e3c2a..415f96b 100644 --- a/ViewModels/TaskViewModel.cs +++ b/ViewModels/TaskViewModel.cs @@ -69,7 +69,7 @@ namespace ReminderOrganizer.ViewModels } } - public bool IsInPast => !IsRecurring && ReminderDate <= DateTime.Now; + public bool IsInPast => !IsBirthday && !IsRecurring && ReminderDate <= DateTime.Now; // lead reminder: index into LeadOptions public static readonly int[] LeadOptions = { 0, 1, 2, 3, 7 }; @@ -211,9 +211,8 @@ namespace ReminderOrganizer.ViewModels } } - public string WindowTitle => _isNewTask - ? _localizationService.GetString("NewTask") - : _localizationService.GetString("EditTask"); + public string WindowTitle => _localizationService.GetString( + IsBirthday ? (_isNewTask ? "NewBirthday" : "EditBirthday") : (_isNewTask ? "NewTask" : "EditTask")); public string NameLabel => _localizationService.GetString("Name"); public string DescriptionLabel => _localizationService.GetString("Description"); @@ -236,15 +235,92 @@ namespace ReminderOrganizer.ViewModels public event EventHandler? RequestClose; - public TaskViewModel(ILocalizationService localizationService, ReminderTask? existingTask = null) + // ---------- birthday mode ---------- + + private bool _isBirthday; + public bool IsBirthday + { + get => _isBirthday; + set + { + if (!SetProperty(ref _isBirthday, value)) return; + OnPropertyChanged(nameof(IsAppointment)); + OnPropertyChanged(nameof(WindowTitle)); + OnPropertyChanged(nameof(IsInPast)); + OnPropertyChanged(nameof(BirthdayPreview)); + if (value && _isNewTask && SelectedLeadIndex == 0) SelectedLeadIndex = 1; // birthdays: 1 day before by default + } + } + public bool IsAppointment { get => !IsBirthday; set => IsBirthday = !value; } + + private string _birthdayText = ""; + public string BirthdayText + { + get => _birthdayText; + set + { + if (!SetProperty(ref _birthdayText, value ?? "")) return; + OnPropertyChanged(nameof(BirthdayPreview)); + OnPropertyChanged(nameof(BirthdayInvalid)); + } + } + + private bool TryBirthday(out DateTime next, out int? year) + { + next = default; + if (!BirthdayInput.TryParse(BirthdayText, DateTime.Today, out var d, out var m, out year)) return false; + next = ReminderTask.NextBirthday(d, m, DateTime.Today); + return true; + } + + /// Red only once the input could be complete ("1.1" = 3 chars) – no error after the first digit. + public bool BirthdayInvalid => BirthdayText.Trim().Length >= 3 && !TryBirthday(out _, out _); + + /// "Next: Thu, 19 March 2027 · turns 41 · in 110 days" + public string BirthdayPreview + { + get + { + if (!TryBirthday(out var next, out var year)) + return _localizationService.GetString(BirthdayInvalid ? "BirthdayInvalid" : "BirthdayHint"); + var culture = ReminderTask.DisplayCulture?.Invoke() ?? System.Globalization.CultureInfo.CurrentCulture; + var text = next.ToString("ddd, " + ReminderTask.DayMonthPattern(culture) + " yyyy", culture); + if (year is int y) text += " · " + string.Format(_localizationService.GetString("TurnsAge"), next.Year - y); + var rel = ReminderTask.RelativeFormatter?.Invoke(next, DateTime.Now); + if (!string.IsNullOrEmpty(rel)) text += " · " + rel; + return text; + } + } + + public string AppointmentText => _localizationService.GetString("TypeAppointment"); + public string BirthdayTypeText => _localizationService.GetString("TypeBirthday"); + public string BirthdayLabel => _localizationService.GetString("BirthdayDate"); + public string NoteLabel => _localizationService.GetString("Note"); + + public TaskViewModel(ILocalizationService localizationService, ReminderTask? existingTask = null, bool defaultBirthday = false) { _localizationService = localizationService; _isNewTask = existingTask == null; - + if (_isNewTask) { _originalTask = new ReminderTask(); _reminderDate = DateTime.Now.AddHours(1); + _isBirthday = defaultBirthday; + if (defaultBirthday) _selectedLeadIndex = 1; + } + else if (existingTask!.IsBirthday) + { + _originalTask = existingTask; + _isBirthday = true; + _name = existingTask.Name; + _description = existingTask.Description; + _reminderDate = existingTask.ReminderDate; + _isRecurring = true; + _selectedRecurrenceIndex = (int)RecurrenceType.Yearly; + _selectedLeadIndex = Math.Max(0, Array.IndexOf(LeadOptions, existingTask.LeadDays)); + _birthdayText = existingTask.ReminderDate.ToString("dd.MM.", System.Globalization.CultureInfo.InvariantCulture) + + (existingTask.BirthYear?.ToString() ?? ""); } else { @@ -271,7 +347,8 @@ namespace ReminderOrganizer.ViewModels OnPropertyChanged(nameof(SelectedMinuteIndex)); } - private bool CanSave() => !string.IsNullOrWhiteSpace(Name) && !BirthYearError; + private bool CanSave() => !string.IsNullOrWhiteSpace(Name) && + (IsBirthday ? TryBirthday(out _, out _) : !BirthYearError); private void ValidateInput() { @@ -311,6 +388,28 @@ namespace ReminderOrganizer.ViewModels { if (!CanSave()) return; + if (IsBirthday && TryBirthday(out var nextBirthday, out var birthYear)) + { + var lead = LeadOptions[SelectedLeadIndex]; + // Editing on the birthday itself after it was already reminded: keep next year's date. + if (!_isNewTask && nextBirthday <= DateTime.Now && _originalTask.ReminderDate > DateTime.Now) + nextBirthday = nextBirthday.AddYears(1); + if (_isNewTask || _originalTask.ReminderDate != nextBirthday || _originalTask.LeadDays != lead) + _originalTask.IsPreNotified = false; + _originalTask.IsBirthday = true; + _originalTask.Name = Name.Trim(); + _originalTask.Description = Description?.Trim() ?? ""; + _originalTask.IsRecurring = true; + _originalTask.RecurrenceType = RecurrenceType.Yearly; + _originalTask.BirthYear = birthYear; + _originalTask.LeadDays = lead; + _originalTask.ReminderDate = nextBirthday; + _originalTask.IsNotified = false; + RequestClose?.Invoke(this, true); + return; + } + _originalTask.IsBirthday = false; + var leadDays = LeadOptions[SelectedLeadIndex]; bool timingChanged = _originalTask.ReminderDate != ReminderDate || _originalTask.LeadDays != leadDays; _originalTask.LeadDays = leadDays; diff --git a/docs/itchio/README.md b/docs/itchio/README.md new file mode 100644 index 0000000..8c83cf6 --- /dev/null +++ b/docs/itchio/README.md @@ -0,0 +1,55 @@ +# itch.io-Seite: Reminder Organizer + +Alles für die Seite liegt in diesem Ordner. Neu erzeugen: +- Motive: `cd sprite-generator` → `gen generate itch_keyart` / `gen generate itch_cover` (Prompts in `prompts.py`) +- Bilder: `py -3.12 ..\..\..\_Tools\Itch\itch_images.py --title "Reminder Organizer" --tagline "Never forget a date again" --backdrop ..\..\sprite-generator\output\itch_keyart_raw_00003_.png --cover-art ..\..\sprite-generator\output\itch_cover_raw_00004_.png --out . --font C:\Windows\Fonts\segoeuib.ttf --color "#C7D2FE"` +- Screenshots: echte App, 1600×1000, Englisch, mit Beispieldaten in eigenem Datenordner (`REMINDER_ORGANIZER_DATA`), hell + dunkel + +## Dateien +| Datei | Wofür | +|---|---| +| `cover.png` (630×500) | Cover image | +| `screenshots\01_upcoming.png` … `06_recurring.png` (1600×1000) | Screenshots – Reihenfolge so lassen (01 Upcoming dunkel, 02 Geburtstage hell, 03 Ordner, 04 Neuer Task, 05 helles Theme, 06 wiederkehrend) | +| `banner_960x256.png` / `banner_1920x512.png` | Edit theme → Banner | +| `background_1920x1200.jpg` | Edit theme → Background (oben mittig, nicht wiederholen) | +| `description.html` | Description (im Browser öffnen, Strg+A, kopieren, einfügen) | +| `install.html` | Download & install instructions (genauso einfügen) | +| `..\..\publish\ReminderOrganizer.exe` (≈ 78 MB) | Upload (Windows, ganze App in einer Datei) – vorher `release.bat` | + +## Felder unter „Edit game“ +| Feld | Eintrag | +|---|---| +| Title | `Reminder Organizer` | +| Project URL | `reminder-organizer` → `https://sn09.itch.io/reminder-organizer` | +| Short description or tagline | `Folders, recurring reminders and birthdays – a small Windows tray app that never lets you forget a date.` | +| Classification | **Tools** | +| Kind of project | **Downloadable** | +| Release status | **Released** | +| Pricing | **No payments** + Haken „Donate“ → *Suggested donation* z. B. $2 (kostenlos, Spende freiwillig) | +| Uploads | `publish\ReminderOrganizer.exe` → Haken **Windows** (Anzeigename z. B. „Reminder Organizer 1.1.0 (Windows, 64-bit)“) | +| Genre | – (bei Tools kein Genre) | +| Tags (max. 10) | `reminder`, `productivity`, `to-do-list`, `calendar`, `organizer`, `notifications`, `birthday`, `system-tray`, `windows`, `dark-mode` | +| AI generation disclosure | **Yes** – Grafik: App-Icon, Cover, Banner, Hintergrund (Flux/ComfyUI); Sound: Erinnerungston (Stable Audio). Screenshots und App-Oberfläche sind echt. | +| App store links | – | +| Custom noun | `app` | +| Community | **Comments** einschalten; Discord-Link steht in der Description | +| Visibility | erst **Draft** (Vorschau prüfen), dann **Public** | +| Languages | English, German | +| Inputs | Keyboard, Mouse | +| Accessibility | – (nichts Passendes; Dark/Light-Theme steht in der Description) | +| Multiplayer | – | +| Average session | A few minutes | +| Links | Discord: `https://discord.gg/Ej4JPmCZva` | +| Gameplay video or trailer | – (kein Trailer, App hat keine Musik) | +| Download & install instructions | Inhalt von `install.html` | + +## Seiten-Design („Edit theme“) +- Hintergrund `#121218`, Text `#F5F5F5`, Links/Akzente `#6366F1` (wie Dark-Theme der App), Schrift: „Inter“ oder „Lato“ +- Banner `banner_960x256.png`, Background `background_1920x1200.jpg` (oben mittig, nicht wiederholen) + +## Vor dem Hochladen prüfen +- [ ] `release.bat` (Tests laufen mit) → frische `publish\ReminderOrganizer.exe`, Version 1.1.0 +- [ ] EXE in einen leeren Ordner kopieren und starten: Fenster, Tray-Icon, Testerinnerung erscheint als Windows-Benachrichtigung +- [ ] Description in der Vorschau ansehen (Emojis, Links Discord/E-Mail klickbar) +- [ ] Spenden-Einstellung: Payout-Konto (PayPal/Stripe) auf itch.io eingerichtet +- [ ] Nach dem Veröffentlichen: Projekt-Dashboard erkennt die Seite automatisch (sonst Bearbeiten → itch.io-Seite) diff --git a/docs/itchio/background_1920x1200.jpg b/docs/itchio/background_1920x1200.jpg new file mode 100644 index 0000000..85883de Binary files /dev/null and b/docs/itchio/background_1920x1200.jpg differ diff --git a/docs/itchio/banner_1920x512.png b/docs/itchio/banner_1920x512.png new file mode 100644 index 0000000..6504413 Binary files /dev/null and b/docs/itchio/banner_1920x512.png differ diff --git a/docs/itchio/banner_960x256.png b/docs/itchio/banner_960x256.png new file mode 100644 index 0000000..c65ae88 Binary files /dev/null and b/docs/itchio/banner_960x256.png differ diff --git a/docs/itchio/cover.png b/docs/itchio/cover.png new file mode 100644 index 0000000..9b1326b Binary files /dev/null and b/docs/itchio/cover.png differ diff --git a/docs/itchio/description.html b/docs/itchio/description.html new file mode 100644 index 0000000..d886e1c --- /dev/null +++ b/docs/itchio/description.html @@ -0,0 +1,28 @@ +

🔔 Never forget a date again

+

Reminder Organizer is a small Windows app that keeps your reminders in folders and pops them up as Windows notifications at the right time. It sits quietly in the system tray, starts with Windows if you like, and even catches up on reminders you missed while the PC was off. Birthdays, bills, appointments, chores – all in one tidy list.

+ +

✨ Features

+
    +
  • 📅 Upcoming view – every folder in one list, grouped into Overdue, Today, Tomorrow, Next 7 days and Later
  • +
  • 🔁 Recurring reminders – daily, weekly, monthly or yearly, or just once
  • +
  • ⏰ Remind in advance – get a heads-up 1, 2 or 3 days or a week before the date
  • +
  • 🎂 Birthdays – add the year of birth and the app shows "turns 40"
  • +
  • 📁 Coloured folders – sort by drag and drop, drag a task onto a folder to move it
  • +
  • 🔍 Search and filters – All, Today, Overdue, plus "Hide done"
  • +
  • 📤 Import & export – CSV import/export and a calendar export (.ics) for Outlook, Google and Apple Calendar
  • +
  • 🌙 Dark and light theme, reminder sound (can be turned off), undo after deleting
  • +
+ +

🕹️ Controls

+

🖱️ Mouse: click, drag and drop, right-click menus · ⌨️ Keyboard: Ctrl+N new task · Ctrl+F search · Del delete · Ctrl+Z undo · Esc clear search

+ +

🌍 Languages

+

English and German – the first start follows your Windows language and theme.

+ +

💻 Requirements

+

Windows 10 or 11 (64-bit) · about 80 MB · one file, no install, no .NET needed. Your reminders are saved in %APPDATA%\ReminderOrganizer with an automatic backup.

+ +

💬 Community

+

Ideas, bugs or questions? Join the Discord community or write to infomichaelmedia1@gmail.com.

+ +

© 2026 Michael Media. The icon, artwork and reminder sound were created with the help of AI tools.

diff --git a/docs/itchio/install.html b/docs/itchio/install.html new file mode 100644 index 0000000..da27f23 --- /dev/null +++ b/docs/itchio/install.html @@ -0,0 +1,28 @@ +

Windows (64-bit)

+
    +
  1. Download ReminderOrganizer.exe and put it in a folder of your choice (for example Documents\Tools).
  2. +
  3. Double-click it. That's all – the whole app is in this one file, no installation needed.
  4. +
+

The very first start takes a few seconds longer while the app unpacks itself. Closing the window keeps the app running in the system tray (notification area) so your reminders still pop up – double-click the tray icon to open it again, right-click it to quit. Turn on File → Settings → Autostart to start it hidden with Windows.

+ +

Windows SmartScreen

+

Because the app is new and not signed, Windows may show "Windows protected your PC". Click More info → Run anyway.

+ +

Your reminders

+

Everything is saved automatically in %APPDATA%\ReminderOrganizer\tasks.json, together with a backup of the previous save (tasks.json.bak). To move to another PC, use File → Export CSV and import it there.

+ +

Update

+

Quit the app (tray icon → right-click → Exit), download the new ReminderOrganizer.exe and replace the old one. Your reminders stay in %APPDATA%\ReminderOrganizer and are kept.

+ +

Uninstall

+
    +
  1. If Autostart is on, turn it off first (File → Settings → Autostart).
  2. +
  3. Quit the app and delete ReminderOrganizer.exe.
  4. +
  5. To also remove your reminders, delete %APPDATA%\ReminderOrganizer. The unpacked app files are in %TEMP%\.net\ReminderOrganizer.
  6. +
+ +

Problems?

+
    +
  • No notifications: check that Windows notifications and Focus assist / Do not disturb allow them.
  • +
  • Still stuck? Ask in the Discord community or write to infomichaelmedia1@gmail.com. Please attach %APPDATA%\ReminderOrganizer\error.log if there is one.
  • +
diff --git a/docs/itchio/screenshots/01_upcoming.png b/docs/itchio/screenshots/01_upcoming.png new file mode 100644 index 0000000..4ccefcf Binary files /dev/null and b/docs/itchio/screenshots/01_upcoming.png differ diff --git a/docs/itchio/screenshots/02_birthdays.png b/docs/itchio/screenshots/02_birthdays.png new file mode 100644 index 0000000..9d2799c Binary files /dev/null and b/docs/itchio/screenshots/02_birthdays.png differ diff --git a/docs/itchio/screenshots/03_folders.png b/docs/itchio/screenshots/03_folders.png new file mode 100644 index 0000000..03e08af Binary files /dev/null and b/docs/itchio/screenshots/03_folders.png differ diff --git a/docs/itchio/screenshots/04_new_task.png b/docs/itchio/screenshots/04_new_task.png new file mode 100644 index 0000000..9d9e9da Binary files /dev/null and b/docs/itchio/screenshots/04_new_task.png differ diff --git a/docs/itchio/screenshots/05_light_theme.png b/docs/itchio/screenshots/05_light_theme.png new file mode 100644 index 0000000..d1b8143 Binary files /dev/null and b/docs/itchio/screenshots/05_light_theme.png differ diff --git a/docs/itchio/screenshots/06_recurring.png b/docs/itchio/screenshots/06_recurring.png new file mode 100644 index 0000000..4f70ee6 Binary files /dev/null and b/docs/itchio/screenshots/06_recurring.png differ diff --git a/docs/screenshots/birthday-dialog.png b/docs/screenshots/birthday-dialog.png new file mode 100644 index 0000000..f76c2c8 Binary files /dev/null and b/docs/screenshots/birthday-dialog.png differ diff --git a/docs/screenshots/cards.png b/docs/screenshots/cards.png new file mode 100644 index 0000000..d2f7830 Binary files /dev/null and b/docs/screenshots/cards.png differ diff --git a/sprite-generator/prompts.py b/sprite-generator/prompts.py index 400bccb..90d671f 100644 --- a/sprite-generator/prompts.py +++ b/sprite-generator/prompts.py @@ -1,4 +1,4 @@ -"""Was generate.py erzeugt. Immer "plain solid black background", nie "transparent".""" +"""Was generate.py erzeugt. Immer "plain solid black background", nie "transparent".""" PROMPTS = [ ("icon", @@ -8,3 +8,22 @@ PROMPTS = [ ] SIZES = {"icon": (1024, 1024)} + +STYLE_ITCH = "glossy modern 3D illustration, soft gradients, rounded friendly shapes, indigo #6366F1 as main colour with blue, green, pink and teal accents, calm evening light, clean and cosy, high detail" + +PROMPTS += [ + ("itch_keyart", + "wide scene, a tidy desk by a window at dusk, a large friendly glossy indigo bell with a small green " + "checkmark badge stands on the right, around it neat stacks of blank calendar cards, coloured folders " + "in blue, green, pink and teal, a small wrapped birthday gift and a round clock, soft glow, " + "the left half is a calm dark indigo gradient with empty space, " + STYLE_ITCH + + ", no text, no letters, no numbers, no logo, no watermark"), + ("itch_cover", + "a large friendly glossy indigo bell with a small green checkmark badge in the lower centre, " + "surrounded by floating blank calendar pages, coloured folders in blue, green, pink and teal, " + "a small wrapped gift box and a round clock, the upper third is a calm smooth indigo-to-violet " + "gradient sky with nothing in it, " + STYLE_ITCH + + ", no text, no letters, no numbers, no logo, no watermark"), +] + +SIZES.update({"itch_keyart": (1920, 1088), "itch_cover": (1264, 1008)})