Skip to content

Commit

Permalink
imp - Finalized legacy calendar for non-Sunday weeks
Browse files Browse the repository at this point in the history
---

We've finalized the legacy calendar for working with calendars that don't use Sunday as the first day of the week.

---

Type: imp
Breaking: False
Doc Required: False
Part: 1/1
  • Loading branch information
AptiviCEO committed Feb 26, 2024
1 parent 93008a7 commit 695d5d0
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public static void PrintCalendar(int Year, int Month, CalendarTypes calendar = C
// Dim out the weekends
if (IsWeekend)
{
var WeekendOptions = new CellOptions((int)CurrentDate.DayOfWeek + 1, CurrentWeek)
var WeekendOptions = new CellOptions(currentDay, CurrentWeek)
{
ColoredCell = true,
CellColor = KernelColorTools.GetColor(KernelColorType.WeekendDay),
Expand All @@ -113,7 +113,7 @@ public static void PrintCalendar(int Year, int Month, CalendarTypes calendar = C
// Highlight today
if (IsToday)
{
var TodayOptions = new CellOptions((int)CurrentDate.DayOfWeek + 1, CurrentWeek)
var TodayOptions = new CellOptions(currentDay, CurrentWeek)
{
ColoredCell = true,
CellColor = KernelColorTools.GetColor(KernelColorType.TodayDay),
Expand Down Expand Up @@ -146,7 +146,7 @@ public static void PrintCalendar(int Year, int Month, CalendarTypes calendar = C
if (((EventInstance.IsYearly && CurrentDate >= sDate && CurrentDate <= eDate) ||
(!EventInstance.IsYearly && CurrentDate == nDate)) && !EventMarked)
{
var EventCell = new CellOptions((int)CurrentDate.DayOfWeek + 1, CurrentWeek)
var EventCell = new CellOptions(currentDay, CurrentWeek)
{
ColoredCell = true,
CellColor = KernelColorTools.GetColor(KernelColorType.EventDay),
Expand All @@ -159,9 +159,9 @@ public static void PrintCalendar(int Year, int Month, CalendarTypes calendar = C
string markStart = ReminderMarked && EventMarked ? "[" : ReminderMarked ? "(" : EventMarked ? "<" : " ";
string markEnd = ReminderMarked && EventMarked ? "]" : ReminderMarked ? ")" : EventMarked ? ">" : " ";
CurrentDayMark = $"{markStart}{CurrentDay}{markEnd}";
CalendarData[CurrentWeekIndex, (int)CurrentDate.DayOfWeek] = CurrentDayMark;
CalendarData[CurrentWeekIndex, currentDay - 1] = CurrentDayMark;
}
TableColor.WriteTable(CalendarDays, CalendarData, 2, true, CalendarCellOptions);
TableColor.WriteTable(mappedDays.Keys.Select((dow) => $"{CalendarDays[(int)dow]}").ToArray(), CalendarData, 2, true, CalendarCellOptions);
}

}
Expand Down

0 comments on commit 695d5d0

Please sign in to comment.