Started work on a calculator 'lib' that the app is going to use
This commit is contained in:
parent
74f09d84cd
commit
d8805322d2
1 changed files with 10 additions and 0 deletions
10
lib/DayCalculator.dart
Normal file
10
lib/DayCalculator.dart
Normal file
|
@ -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;
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue