diff options
-rwxr-xr-x | src/time.cpp | 24 | ||||
-rwxr-xr-x | src/time.h | 6 | ||||
-rwxr-xr-x | test.sh | 4 |
3 files changed, 18 insertions, 16 deletions
diff --git a/src/time.cpp b/src/time.cpp index 15dd0ce..224a6f0 100755 --- a/src/time.cpp +++ b/src/time.cpp @@ -216,19 +216,19 @@ workday::workday(const moment& previous_wrap, if((each_block.start.day==25 || each_block.start.day==26) && each_block.start.month==12) each_block.upvalue(2, "Christmas"); moment easter = gaussEaster(each_block.start.year); - if(each_block.start.day == (easter-(delta){0,0,-3}).day && - each_block.start.month == (easter-(delta){0,0,-3}).month) each_block.upvalue(2, "Maundy Thursday"); - if(each_block.start.day == (easter-(delta){0,0,-2}).day && - each_block.start.month == (easter-(delta){0,0,-2}).month) each_block.upvalue(2, "Good Friday"); + if(each_block.start.day == (easter-(delta){0,0,3}).day && + each_block.start.month == (easter-(delta){0,0,3}).month) each_block.upvalue(2, "Maundy Thursday"); + if(each_block.start.day == (easter-(delta){0,0,2}).day && + each_block.start.month == (easter-(delta){0,0,2}).month) each_block.upvalue(2, "Good Friday"); if(each_block.start.day == easter.day && each_block.start.month == easter.month) each_block.upvalue(2, "Easter"); - if(each_block.start.day == (easter-(delta){0,0,1}).day && - each_block.start.month == (easter-(delta){0,0,1}).month) each_block.upvalue(2, "Easter"); - if(each_block.start.day == (easter-(delta){0,0,39}).day && - each_block.start.month == (easter-(delta){0,0,39}).month) each_block.upvalue(2, "Feast of the Ascension"); - if(each_block.start.day == (easter-(delta){0,0,49}).day && - each_block.start.month == (easter-(delta){0,0,49}).month) each_block.upvalue(2, "Pentecost"); - if(each_block.start.day == (easter-(delta){0,0,50}).day && - each_block.start.month == (easter-(delta){0,0,50}).month) each_block.upvalue(2, "Pentecost Monday"); + if(each_block.start.day == (easter+(delta){0,0,1}).day && + each_block.start.month == (easter+(delta){0,0,1}).month) each_block.upvalue(2, "Easter"); + if(each_block.start.day == (easter+(delta){0,0,39}).day && + each_block.start.month == (easter+(delta){0,0,39}).month) each_block.upvalue(2, "Feast of the Ascension"); + if(each_block.start.day == (easter+(delta){0,0,49}).day && + each_block.start.month == (easter+(delta){0,0,49}).month) each_block.upvalue(2, "Pentecost"); + if(each_block.start.day == (easter+(delta){0,0,50}).day && + each_block.start.month == (easter+(delta){0,0,50}).month) each_block.upvalue(2, "Pentecost Monday"); } } @@ -19,9 +19,9 @@ enum weekday{ }; struct delta{ - signed int minutes; - signed int hours; - signed int days; + unsigned int minutes; + unsigned int hours; + unsigned int days; }; std::ostream& operator<<(std::ostream& stream, const delta& other); @@ -1,6 +1,6 @@ ./satscalc <<EOF-MARKER 3462 -12 +13 0 2022 09 15 22 00 w @@ -62,5 +62,7 @@ p 0 2030 04 22 08 00 0 +2030 05 17 08 00 +0 EOF-MARKER |