diff --git a/lib/DayCalculator.dart b/lib/DayCalculator.dart new file mode 100644 index 0000000..9be8f0a --- /dev/null +++ b/lib/DayCalculator.dart @@ -0,0 +1,10 @@ +// Based on this article: +// https://artofmemory.com/blog/how-to-calculate-the-day-of-the-week-4203.html + +class DayCalculator { + // Calculates (YY + floor(YY / 4)) % 7 + static int getYearValue(int year){ + var yy = year % 100; + return (yy + (yy / 4).floor()) % 7; + } +} \ No newline at end of file